From a8369274952ad81ed2b05800d182e35efd26e41d Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Tue, 17 Feb 2009 20:34:05 +0200 Subject: tests/sync-playback: check if pa_context_connect succeed --- src/tests/sync-playback.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/tests') diff --git a/src/tests/sync-playback.c b/src/tests/sync-playback.c index 42c479a1..f2a15601 100644 --- a/src/tests/sync-playback.c +++ b/src/tests/sync-playback.c @@ -174,11 +174,16 @@ int main(int argc, char *argv[]) { pa_context_set_state_callback(context, context_state_callback, NULL); - pa_context_connect(context, NULL, 0, NULL); + /* Connect the context */ + if (pa_context_connect(context, NULL, 0, NULL) < 0) { + fprintf(stderr, "pa_context_connect() failed.\n"); + goto quit; + } if (pa_mainloop_run(m, &ret) < 0) fprintf(stderr, "pa_mainloop_run() failed.\n"); +quit: pa_context_unref(context); for (i = 0; i < NSTREAMS; i++) -- cgit From 5ea7dac11c225aa26367974d7cf37e71a096ef27 Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Tue, 17 Feb 2009 20:36:38 +0200 Subject: tests/interpol-test: check if mainloop_start() succeed --- src/tests/interpol-test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/tests') diff --git a/src/tests/interpol-test.c b/src/tests/interpol-test.c index 20d2c230..d7da660c 100644 --- a/src/tests/interpol-test.c +++ b/src/tests/interpol-test.c @@ -126,7 +126,8 @@ int main(int argc, char *argv[]) { pa_gettimeofday(&start); - pa_threaded_mainloop_start(m); + r = pa_threaded_mainloop_start(m); + assert(r >= 0); for (k = 0; k < 5000; k++) { pa_bool_t success = FALSE, changed = FALSE; -- cgit From 25bbea67492cb7c6e9b8e78beb6553864c290a1a Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Tue, 17 Feb 2009 20:38:51 +0200 Subject: tests/thread-mainloop-test: check if threaded_mainloop_start() succeed --- src/tests/thread-mainloop-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/tests') diff --git a/src/tests/thread-mainloop-test.c b/src/tests/thread-mainloop-test.c index 263cd57d..3bcf4f16 100644 --- a/src/tests/thread-mainloop-test.c +++ b/src/tests/thread-mainloop-test.c @@ -47,7 +47,7 @@ int main(int argc, char *argv[]) { pa_assert_se(m = pa_threaded_mainloop_new()); pa_assert_se(a = pa_threaded_mainloop_get_api(m)); - pa_threaded_mainloop_start(m); + pa_assert_se(pa_threaded_mainloop_start(m) >= 0); pa_threaded_mainloop_lock(m); -- cgit From 60d53c6523dfd59fbcc99ff443ba993e285ca366 Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Tue, 17 Feb 2009 22:58:59 +0200 Subject: tests/ipacl-test: check inet_pton() --- src/tests/ipacl-test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/tests') diff --git a/src/tests/ipacl-test.c b/src/tests/ipacl-test.c index 7b7564a4..f89665cd 100644 --- a/src/tests/ipacl-test.c +++ b/src/tests/ipacl-test.c @@ -25,6 +25,7 @@ #endif #include "../pulsecore/winsock.h" +#include "../pulsecore/macro.h" #include @@ -96,7 +97,7 @@ int main(int argc, char *argv[]) { memset(&sa6, 0, sizeof(sa6)); sa6.sin6_family = AF_INET6; sa6.sin6_port = htons(22); - inet_pton(AF_INET6, "::1", &sa6.sin6_addr); + pa_assert_se(inet_pton(AF_INET6, "::1", &sa6.sin6_addr) == 1); r = connect(fd, (struct sockaddr*) &sa6, sizeof(sa6)); assert(r >= 0); -- cgit