summaryrefslogtreecommitdiffstats
path: root/src/tests/thread-mainloop-test.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2007-10-28 19:13:50 +0000
committerLennart Poettering <lennart@poettering.net>2007-10-28 19:13:50 +0000
commita67c21f093202f142438689d3f7cfbdf4ea82eea (patch)
tree5c3295037f033904bc11ab8b3adae5b7331101e9 /src/tests/thread-mainloop-test.c
parent6687dd013169fd8436aa1b45ccdacff074a40d05 (diff)
merge 'lennart' branch back into trunk.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1971 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/tests/thread-mainloop-test.c')
-rw-r--r--src/tests/thread-mainloop-test.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/tests/thread-mainloop-test.c b/src/tests/thread-mainloop-test.c
index 9d0e5de1..558e53a5 100644
--- a/src/tests/thread-mainloop-test.c
+++ b/src/tests/thread-mainloop-test.c
@@ -23,18 +23,19 @@
#include <config.h>
#endif
-#include <assert.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <pulse/timeval.h>
#include <pulse/util.h>
+#include <pulse/thread-mainloop.h>
#include <pulsecore/gccmacro.h>
-#include <pulse/thread-mainloop.h>
+#include <pulsecore/macro.h>
static void tcb(pa_mainloop_api*a, pa_time_event *e, const struct timeval *tv, void *userdata) {
+ pa_assert_se(pa_threaded_mainloop_in_thread(userdata));
fprintf(stderr, "TIME EVENT START\n");
pa_threaded_mainloop_signal(userdata, 1);
fprintf(stderr, "TIME EVENT END\n");
@@ -45,15 +46,15 @@ int main(PA_GCC_UNUSED int argc, PA_GCC_UNUSED char *argv[]) {
pa_threaded_mainloop *m;
struct timeval tv;
- m = pa_threaded_mainloop_new();
- assert(m);
- a = pa_threaded_mainloop_get_api(m);
- assert(a);
+ pa_assert_se(m = pa_threaded_mainloop_new());
+ pa_assert_se(a = pa_threaded_mainloop_get_api(m));
pa_threaded_mainloop_start(m);
pa_threaded_mainloop_lock(m);
+ pa_assert_se(!pa_threaded_mainloop_in_thread(m));
+
pa_gettimeofday(&tv);
tv.tv_sec += 5;
a->time_new(a, &tv, tcb, m);