summaryrefslogtreecommitdiffstats
path: root/src/tests/rtstutter.c
diff options
context:
space:
mode:
authorDiego Elio 'Flameeyes' Pettenò <flameeyes@gmail.com>2009-07-17 21:03:22 +0200
committerDiego Elio 'Flameeyes' Pettenò <flameeyes@gmail.com>2009-07-17 21:03:22 +0200
commit542607f4c602e632b32efe2b6fd21f81ff52bd8d (patch)
tree4ea9be2d54a2e6058601585e69e6b84b045f5972 /src/tests/rtstutter.c
parent8c85c9999661a57e1bd10e79ad398b812ff4ea87 (diff)
Make the rtstutter tests mostly pointless without CLOCK_REALTIME.
On the other hand, this actually makes the test build, and test at least that it doesn't abort away, when the CLOCK_REALTIME interface is not present (or when clock_gettime is not found).
Diffstat (limited to 'src/tests/rtstutter.c')
-rw-r--r--src/tests/rtstutter.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/tests/rtstutter.c b/src/tests/rtstutter.c
index a4b5d596..c93fee93 100644
--- a/src/tests/rtstutter.c
+++ b/src/tests/rtstutter.c
@@ -67,7 +67,9 @@ static void* work(void *p) {
pa_log_notice("CPU%i: Sleeping for 1s", PA_PTR_TO_UINT(p));
sleep(1);
+#ifdef CLOCK_REALTIME
pa_assert_se(clock_gettime(CLOCK_REALTIME, &end) == 0);
+#endif
nsec =
(uint64_t) ((((double) rand())*(double)(msec_upper-msec_lower)*PA_NSEC_PER_MSEC)/RAND_MAX) +
@@ -84,7 +86,9 @@ static void* work(void *p) {
}
do {
+#ifdef CLOCK_REALTIME
pa_assert_se(clock_gettime(CLOCK_REALTIME, &now) == 0);
+#endif
} while (now.tv_sec < end.tv_sec ||
(now.tv_sec == end.tv_sec && now.tv_nsec < end.tv_nsec));
}