aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/test_audio.cpp
diff options
context:
space:
mode:
authorMatthew Gregan <[email protected]>2016-11-11 14:50:16 +1300
committerMatthew Gregan <[email protected]>2016-11-11 14:50:16 +1300
commit5a2b774ba4190528f467f5fb70ec7e4dd55eb386 (patch)
tree79ed308ce4eb06d215c58b9a1c6bd94c5887b106 /test/test_audio.cpp
parentbc2d794afbb7ad4caa08bb9f6c19c7750c4386c7 (diff)
downloadcubeb-5a2b774ba4190528f467f5fb70ec7e4dd55eb386.tar.gz
cubeb-5a2b774ba4190528f467f5fb70ec7e4dd55eb386.zip
Allow building gtests as a single binary.
Syntax only changes. This is necessary for Gecko integration.
Diffstat (limited to 'test/test_audio.cpp')
-rw-r--r--test/test_audio.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/test_audio.cpp b/test/test_audio.cpp
index a06cf05..902096f 100644
--- a/test/test_audio.cpp
+++ b/test/test_audio.cpp
@@ -7,7 +7,9 @@
/* libcubeb api/function exhaustive test. Plays a series of tones in different
* conditions. */
+#if !defined(_XOPEN_SOURCE)
#define _XOPEN_SOURCE 600
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
@@ -92,7 +94,7 @@ long data_cb_short(cubeb_stream * /*stream*/, void * user, const void * /*inputb
return nframes;
}
-void state_cb(cubeb_stream * /*stream*/, void * /*user*/, cubeb_state /*state*/)
+void state_cb_audio(cubeb_stream * /*stream*/, void * /*user*/, cubeb_state /*state*/)
{
}
@@ -154,7 +156,7 @@ int run_test(int num_channels, int sampling_rate, int is_float)
}
r = cubeb_stream_init(ctx, &stream, "test tone", NULL, NULL, NULL, &params,
- 4096, is_float ? data_cb_float : data_cb_short, state_cb, synth);
+ 4096, is_float ? data_cb_float : data_cb_short, state_cb_audio, synth);
if (r != CUBEB_OK) {
fprintf(stderr, "Error initializing cubeb stream: %d\n", r);
goto cleanup;
@@ -207,7 +209,7 @@ int run_panning_volume_test(int is_float)
r = cubeb_stream_init(ctx, &stream, "test tone", NULL, NULL, NULL, &params,
4096, is_float ? data_cb_float : data_cb_short,
- state_cb, synth);
+ state_cb_audio, synth);
if (r != CUBEB_OK) {
fprintf(stderr, "Error initializing cubeb stream: %d\n", r);
goto cleanup;