aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorPaul Adenot <[email protected]>2022-12-02 15:32:53 +0100
committerPaul Adenot <[email protected]>2022-12-02 15:40:20 +0100
commitb8765e132de947a391a7e9b3787c4cc682ed82f1 (patch)
tree1c7f53a863ee9f7628f400296dc6fdf4bfe7c98a /test
parent7f5589a431b166a3c37bb5d5e0614cf2b1bf6387 (diff)
downloadcubeb-b8765e132de947a391a7e9b3787c4cc682ed82f1.tar.gz
cubeb-b8765e132de947a391a7e9b3787c4cc682ed82f1.zip
Inline values for stream params in test_logging.cpp, undef defines in test to avoid breaking unified builds when building tests in Firefox.
Diffstat (limited to 'test')
-rw-r--r--test/test_audio.cpp9
-rw-r--r--test/test_deadlock.cpp2
-rw-r--r--test/test_device_changed_callback.cpp7
-rw-r--r--test/test_duplex.cpp7
-rw-r--r--test/test_logging.cpp13
-rw-r--r--test/test_overload_callback.cpp3
-rw-r--r--test/test_record.cpp3
-rw-r--r--test/test_resampler.cpp5
-rw-r--r--test/test_ring_buffer.cpp2
-rw-r--r--test/test_sanity.cpp6
-rw-r--r--test/test_tone.cpp3
11 files changed, 45 insertions, 15 deletions
diff --git a/test/test_audio.cpp b/test/test_audio.cpp
index ea1b999..bc4b435 100644
--- a/test/test_audio.cpp
+++ b/test/test_audio.cpp
@@ -26,11 +26,6 @@
using namespace std;
#define MAX_NUM_CHANNELS 32
-
-#if !defined(M_PI)
-#define M_PI 3.14159265358979323846
-#endif
-
#define VOLUME 0.2
float get_frequency(int channel_index)
@@ -242,3 +237,7 @@ TEST(cubeb, run_channel_rate_test)
}
}
}
+
+
+#undef MAX_NUM_CHANNELS
+#undef VOLUME
diff --git a/test/test_deadlock.cpp b/test/test_deadlock.cpp
index 0d4d7f5..373ba6a 100644
--- a/test/test_deadlock.cpp
+++ b/test/test_deadlock.cpp
@@ -258,3 +258,5 @@ TEST(cubeb, run_deadlock_test)
cubeb_stream_stop(stream);
}
+
+#undef CALL_THREAD_KILLER
diff --git a/test/test_device_changed_callback.cpp b/test/test_device_changed_callback.cpp
index 2f44f61..d1e60a8 100644
--- a/test/test_device_changed_callback.cpp
+++ b/test/test_device_changed_callback.cpp
@@ -107,3 +107,10 @@ TEST(cubeb, device_changed_callbacks)
cubeb_stream_destroy(stream);
}
+
+#undef SAMPLE_FREQUENCY
+#undef STREAM_FORMAT
+#undef INPUT_CHANNELS
+#undef INPUT_LAYOUT
+#undef OUTPUT_CHANNELS
+#undef OUTPUT_LAYOUT
diff --git a/test/test_duplex.cpp b/test/test_duplex.cpp
index ff0b397..8cc93c3 100644
--- a/test/test_duplex.cpp
+++ b/test/test_duplex.cpp
@@ -337,3 +337,10 @@ TEST(cubeb, one_duplex_one_input)
ASSERT_FALSE(duplex_stream_state.invalid_audio_value.load());
}
+
+#undef SAMPLE_FREQUENCY
+#undef STREAM_FORMAT
+#undef INPUT_CHANNELS
+#undef INPUT_LAYOUT
+#undef OUTPUT_CHANNELS
+#undef OUTPUT_LAYOUT
diff --git a/test/test_logging.cpp b/test/test_logging.cpp
index fdbf8d4..f802372 100644
--- a/test/test_logging.cpp
+++ b/test/test_logging.cpp
@@ -21,11 +21,6 @@
#define PRINT_LOGS_TO_STDERR 0
-#define SAMPLE_FREQUENCY 48000
-#define STREAM_FORMAT CUBEB_SAMPLE_FLOAT32LE
-#define OUTPUT_CHANNELS 2
-#define OUTPUT_LAYOUT CUBEB_LAYOUT_STEREO
-
std::atomic<uint32_t> log_statements_received = {0};
std::atomic<uint32_t> data_callback_call_count = {0};
@@ -100,10 +95,10 @@ TEST(cubeb, logging)
std::unique_ptr<cubeb, decltype(&cubeb_destroy)> cleanup_cubeb_at_exit(
ctx, cubeb_destroy);
- output_params.format = STREAM_FORMAT;
- output_params.rate = SAMPLE_FREQUENCY;
- output_params.channels = OUTPUT_CHANNELS;
- output_params.layout = OUTPUT_LAYOUT;
+ output_params.format = CUBEB_SAMPLE_FLOAT32LE;
+ output_params.rate = 48000;
+ output_params.channels = 2;
+ output_params.layout = CUBEB_LAYOUT_STEREO;
output_params.prefs = CUBEB_STREAM_PREF_NONE;
r = cubeb_get_min_latency(ctx, &output_params, &latency_frames);
diff --git a/test/test_overload_callback.cpp b/test/test_overload_callback.cpp
index 4a19ce9..d62e1ba 100644
--- a/test/test_overload_callback.cpp
+++ b/test/test_overload_callback.cpp
@@ -90,3 +90,6 @@ TEST(cubeb, overload_callback)
delay(500);
cubeb_stream_stop(stream);
}
+
+#undef SAMPLE_FREQUENCY
+#undef STREAM_FORMAT
diff --git a/test/test_record.cpp b/test/test_record.cpp
index ed40a2c..eeebd29 100644
--- a/test/test_record.cpp
+++ b/test/test_record.cpp
@@ -114,3 +114,6 @@ TEST(cubeb, record)
ASSERT_FALSE(stream_state.invalid_audio_value.load());
#endif
}
+
+#undef SAMPLE_FREQUENCY
+#undef STREAM_FORMAT
diff --git a/test/test_resampler.cpp b/test/test_resampler.cpp
index b4e1485..3d55db6 100644
--- a/test/test_resampler.cpp
+++ b/test/test_resampler.cpp
@@ -53,7 +53,7 @@ const uint32_t max_chunks = 30; /* ms */
const uint32_t chunk_increment = 10;
#endif
-#define DUMP_ARRAYS
+// #define DUMP_ARRAYS
#ifdef DUMP_ARRAYS
/**
* Files produced by dump(...) can be converted to .wave files using:
@@ -1084,3 +1084,6 @@ TEST(cubeb, individual_methods) {
ASSERT_EQ(frames_needed2, 0u);
}
+
+#undef NOMINMAX
+#undef DUMP_ARRAYS
diff --git a/test/test_ring_buffer.cpp b/test/test_ring_buffer.cpp
index 261cd79..cfaedd5 100644
--- a/test/test_ring_buffer.cpp
+++ b/test/test_ring_buffer.cpp
@@ -225,3 +225,5 @@ TEST(cubeb, ring_buffer)
test_reset_api();
}
+
+#undef NOMINMAX
diff --git a/test/test_sanity.cpp b/test/test_sanity.cpp
index 5fc72f5..d681c50 100644
--- a/test/test_sanity.cpp
+++ b/test/test_sanity.cpp
@@ -690,3 +690,9 @@ TEST(cubeb, stable_devid)
ASSERT_EQ(r, CUBEB_OK);
cubeb_destroy(ctx);
}
+
+#undef STREAM_RATE
+#undef STREAM_LATENCY
+#undef STREAM_CHANNELS
+#undef STREAM_LAYOUT
+#undef STREAM_FORMAT
diff --git a/test/test_tone.cpp b/test/test_tone.cpp
index 70a7188..9d0e1af 100644
--- a/test/test_tone.cpp
+++ b/test/test_tone.cpp
@@ -119,3 +119,6 @@ TEST(cubeb, tone)
ASSERT_TRUE(user_data->position.load());
}
+
+#undef SAMPLE_FREQUENCY
+#undef STREAM_FORMAT