summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorArun Raghavan <git@arunraghavan.net>2016-02-17 19:47:05 +0530
committerArun Raghavan <git@arunraghavan.net>2016-02-25 09:09:13 +0530
commitaa02e1654bcdfa0677e19ab9bb27b44dc8bf26b9 (patch)
tree96274c20b4aac48952cdf27d0458c71fe3b79533 /src/tests
parent8949ed96c635959ea9d010c5d4b7fcc021486532 (diff)
downloadpulseaudio-aa02e1654bcdfa0677e19ab9bb27b44dc8bf26b9.tar.gz
build-sys: Move to compiling with C11 support
This is needed for building with anonymous unions. A bunch of calls to fail() that used to mysteriously work need fixing -- fail() is a macro that takes a printf-style message as an argument. Not passing this somehow worked with the previous compiler flags, but breaks with -std=c11.
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/connect-stress.c6
-rw-r--r--src/tests/cpu-mix-test.c2
-rw-r--r--src/tests/cpu-remap-test.c4
-rw-r--r--src/tests/cpu-sconv-test.c4
-rw-r--r--src/tests/cpu-volume-test.c2
-rw-r--r--src/tests/cpulimit-test.c4
-rw-r--r--src/tests/extended-test.c4
-rw-r--r--src/tests/get-binary-name-test.c2
-rw-r--r--src/tests/interpol-test.c2
-rw-r--r--src/tests/mult-s16-test.c2
-rw-r--r--src/tests/sync-playback.c4
11 files changed, 18 insertions, 18 deletions
diff --git a/src/tests/connect-stress.c b/src/tests/connect-stress.c
index 7c755e9ff..055ef1326 100644
--- a/src/tests/connect-stress.c
+++ b/src/tests/connect-stress.c
@@ -80,7 +80,7 @@ static void connect(const char *name, int *try) {
/* Connect the context */
if (pa_context_connect(context, NULL, 0, NULL) < 0) {
fprintf(stderr, "pa_context_connect() failed.\n");
- fail();
+ ck_abort();
}
ret = pa_threaded_mainloop_start(mainloop);
@@ -144,7 +144,7 @@ static void stream_state_callback(pa_stream *s, void *userdata) {
default:
case PA_STREAM_FAILED:
fprintf(stderr, "Stream error: %s\n", pa_strerror(pa_context_errno(pa_stream_get_context(s))));
- fail();
+ ck_abort();
}
}
@@ -190,7 +190,7 @@ static void context_state_callback(pa_context *c, void *userdata) {
case PA_CONTEXT_FAILED:
default:
fprintf(stderr, "Context error: %s\n", pa_strerror(pa_context_errno(c)));
- fail();
+ ck_abort();
}
}
diff --git a/src/tests/cpu-mix-test.c b/src/tests/cpu-mix-test.c
index f3bc0cce4..f42530d18 100644
--- a/src/tests/cpu-mix-test.c
+++ b/src/tests/cpu-mix-test.c
@@ -118,7 +118,7 @@ static void run_mix_test(
i,
samples[i], samples_ref[i],
samples0[i], samples1[i]);
- fail();
+ ck_abort();
}
}
}
diff --git a/src/tests/cpu-remap-test.c b/src/tests/cpu-remap-test.c
index cfe86479b..7af5e2923 100644
--- a/src/tests/cpu-remap-test.c
+++ b/src/tests/cpu-remap-test.c
@@ -70,7 +70,7 @@ static void run_remap_test_float(
pa_log_debug("Correctness test failed: align=%d", align);
pa_log_debug("%d: %.24f != %.24f\n", i,
out[i], out_ref[i]);
- fail();
+ ck_abort();
}
}
}
@@ -123,7 +123,7 @@ static void run_remap_test_s16(
if (abs(out[i] - out_ref[i]) > 3) {
pa_log_debug("Correctness test failed: align=%d", align);
pa_log_debug("%d: %d != %d\n", i, out[i], out_ref[i]);
- fail();
+ ck_abort();
}
}
}
diff --git a/src/tests/cpu-sconv-test.c b/src/tests/cpu-sconv-test.c
index 2eb51de15..3f189d176 100644
--- a/src/tests/cpu-sconv-test.c
+++ b/src/tests/cpu-sconv-test.c
@@ -65,7 +65,7 @@ static void run_conv_test_float_to_s16(
if (abs(samples[i] - samples_ref[i]) > 1) {
pa_log_debug("Correctness test failed: align=%d", align);
pa_log_debug("%d: %04hx != %04hx (%.24f)\n", i, samples[i], samples_ref[i], floats[i]);
- fail();
+ ck_abort();
}
}
}
@@ -115,7 +115,7 @@ static void run_conv_test_s16_to_float(
if (fabsf(floats[i] - floats_ref[i]) > 0.0001f) {
pa_log_debug("Correctness test failed: align=%d", align);
pa_log_debug("%d: %.24f != %.24f (%d)\n", i, floats[i], floats_ref[i], samples[i]);
- fail();
+ ck_abort();
}
}
}
diff --git a/src/tests/cpu-volume-test.c b/src/tests/cpu-volume-test.c
index 01ac2fc53..15f065821 100644
--- a/src/tests/cpu-volume-test.c
+++ b/src/tests/cpu-volume-test.c
@@ -78,7 +78,7 @@ static void run_volume_test(
pa_log_debug("Correctness test failed: align=%d, channels=%d", align, channels);
pa_log_debug("%d: %04hx != %04hx (%04hx * %08x)\n", i, samples[i], samples_ref[i],
samples_orig[i], volumes[i % channels]);
- fail();
+ ck_abort();
}
}
}
diff --git a/src/tests/cpulimit-test.c b/src/tests/cpulimit-test.c
index 3a8124f95..e01a5b805 100644
--- a/src/tests/cpulimit-test.c
+++ b/src/tests/cpulimit-test.c
@@ -48,7 +48,7 @@ static void func(pa_mainloop_api *m, pa_signal_event *e, int sig, void *userdata
if ((now - start) >= 30) {
m->quit(m, 1);
fprintf(stderr, "Test failed\n");
- fail();
+ ck_abort();
} else
raise(SIGUSR1);
}
@@ -78,7 +78,7 @@ START_TEST (cpulimit_test) {
if ((now - start) >= 30) {
fprintf(stderr, "Test failed\n");
- fail();
+ ck_abort();
break;
}
}
diff --git a/src/tests/extended-test.c b/src/tests/extended-test.c
index ee766b898..0d08facf6 100644
--- a/src/tests/extended-test.c
+++ b/src/tests/extended-test.c
@@ -100,7 +100,7 @@ static void stream_state_callback(pa_stream *s, void *userdata) {
default:
case PA_STREAM_FAILED:
fprintf(stderr, "Stream error: %s\n", pa_strerror(pa_context_errno(pa_stream_get_context(s))));
- fail();
+ ck_abort();
}
}
@@ -151,7 +151,7 @@ static void context_state_callback(pa_context *c, void *userdata) {
case PA_CONTEXT_FAILED:
default:
fprintf(stderr, "Context error: %s\n", pa_strerror(pa_context_errno(c)));
- fail();
+ ck_abort();
}
}
diff --git a/src/tests/get-binary-name-test.c b/src/tests/get-binary-name-test.c
index 4c855bb07..cd53bdebb 100644
--- a/src/tests/get-binary-name-test.c
+++ b/src/tests/get-binary-name-test.c
@@ -39,7 +39,7 @@ START_TEST (getbinaryname_test) {
if (!pa_get_binary_name(exename, allocated)) {
pa_log_error("failed to read binary name");
pa_xfree(exename);
- fail();
+ ck_abort();
}
if (strlen(exename) < allocated - 1) {
diff --git a/src/tests/interpol-test.c b/src/tests/interpol-test.c
index 7a7bffce9..b4cf18cc4 100644
--- a/src/tests/interpol-test.c
+++ b/src/tests/interpol-test.c
@@ -144,7 +144,7 @@ static void context_state_callback(pa_context *c, void *userdata) {
case PA_CONTEXT_FAILED:
default:
pa_log_error("Context error: %s", pa_strerror(pa_context_errno(c)));
- fail();
+ ck_abort();
}
}
diff --git a/src/tests/mult-s16-test.c b/src/tests/mult-s16-test.c
index 7340d8592..91740c2fe 100644
--- a/src/tests/mult-s16-test.c
+++ b/src/tests/mult-s16-test.c
@@ -65,7 +65,7 @@ START_TEST (mult_s16_test) {
if (a != b) {
pa_log_debug("%d: %d != %d", i, a, b);
- fail();
+ ck_abort();
}
}
diff --git a/src/tests/sync-playback.c b/src/tests/sync-playback.c
index f06b45944..9ef038ca5 100644
--- a/src/tests/sync-playback.c
+++ b/src/tests/sync-playback.c
@@ -106,7 +106,7 @@ static void stream_state_callback(pa_stream *s, void *userdata) {
default:
case PA_STREAM_FAILED:
fprintf(stderr, "Stream error: %s\n", pa_strerror(pa_context_errno(pa_stream_get_context(s))));
- fail();
+ ck_abort();
}
}
@@ -148,7 +148,7 @@ static void context_state_callback(pa_context *c, void *userdata) {
case PA_CONTEXT_FAILED:
default:
fprintf(stderr, "Context error: %s\n", pa_strerror(pa_context_errno(c)));
- fail();
+ ck_abort();
}
}