summaryrefslogtreecommitdiff
path: root/tests/ptimer-test.c
AgeCommit message (Collapse)AuthorFilesLines
2018-02-09Clean up includesMarkus Armbruster1-1/+1
Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes, with the change to target/s390x/gen-features.c manually reverted, and blank lines around deletions collapsed. Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20180201111846.21846-3-armbru@redhat.com>
2017-03-01tests: fix ptimer leaksMarc-André Lureau1-47/+75
Spotted by ASAN. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2016-10-24tests: ptimer: Replace 10000 with 1Dmitry Osipenko1-28/+28
The 10000 is an arbitrarily chosen value used for advancing the QEMU time, so that ptimer's now != last. Change it to 1 to make code a bit more readable. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Message-id: 63256eaac54c84dac7c797f41296cc49e751d09d.1475421224.git.digetx@gmail.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-10-24tests: ptimer: Change the copyright commentDmitry Osipenko1-1/+1
Eric Blake suggested that use of "Author:" in the copyright text of the files created by individuals is incorrect, replace it with "Copyright". Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Message-id: 9d8b626f462d4a5094b1945fbd763b8a2e28dd86.1475421224.git.digetx@gmail.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-10-24tests: ptimer: Add tests for "no counter round down" policyDmitry Osipenko1-41/+76
PTIMER_POLICY_NO_COUNTER_ROUND_DOWN makes ptimer_get_count() return the actual counter value and not the one less. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Message-id: 0082889309b3dc66c03c8de00b8c1ef40c1e3955.1475421224.git.digetx@gmail.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-10-24tests: ptimer: Add tests for "no immediate reload" policyDmitry Osipenko1-16/+57
PTIMER_POLICY_NO_IMMEDIATE_RELOAD makes ptimer to not to re-load counter on setting counter value to "0" or starting to run with "0". Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Message-id: a7acf805e447cc7f637ecacbd45cca34ea3bf425.1475421224.git.digetx@gmail.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-10-24tests: ptimer: Add tests for "no immediate trigger" policyDmitry Osipenko1-8/+56
PTIMER_POLICY_NO_IMMEDIATE_TRIGGER makes ptimer to not to trigger on starting to run with / setting counter to "0". Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Message-id: 12b1e745f90fe2ca3d59197166bc3d379260f912.1475421224.git.digetx@gmail.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-10-24tests: ptimer: Add tests for "continuous trigger" policyDmitry Osipenko1-3/+18
PTIMER_POLICY_CONTINUOUS_TRIGGER makes periodic ptimer to re-trigger every period in case of load = delta = 0. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Message-id: 7a908ab38b902d521eb959941f9efe2df8ce4297.1475421224.git.digetx@gmail.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-10-24tests: ptimer: Add tests for "wraparound after one period" policyDmitry Osipenko1-23/+104
PTIMER_POLICY_WRAP_AFTER_ONE_PERIOD changes ptimer behaviour in a such way, that it would wrap around after one period instead of doing it immediately. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Message-id: ce27bb84ed9f2b64300dd4e90f3eff235a7dcedf.1475421224.git.digetx@gmail.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-10-17tests: cleanup ptimer-testPaolo Bonzini1-11/+11
1) ptimer-test is not a qtest---it runs the ptimer.c code directly in the ptimer-test process 2) ptimer-test has its own stubs file, so there is no need to add more stubs to stubs/vmstate.c Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-09-22tests: Add ptimer testsDmitry Osipenko1-0/+568
Ptimer is a generic countdown timer helper that is used by many timer device models as well as by the QEMU core. Add QTests for the ptimer. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Message-id: 1de89fe6e1ccaf6c8071ee3469e1a844df948359.1473252818.git.digetx@gmail.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>