diff options
author | Bryce Van Dyk <[email protected]> | 2018-03-12 09:38:23 -0400 |
---|---|---|
committer | Matthew Gregan <[email protected]> | 2018-03-13 08:59:20 +1300 |
commit | c88a484e1aac878419946334c49d35d6948beec7 (patch) | |
tree | 9410457d2a1fbcb2c9af2a453aa772c1cebf2ea4 /test | |
parent | 34354eb36226a0d65aa187f82e9326faae293dd7 (diff) | |
download | cubeb-c88a484e1aac878419946334c49d35d6948beec7.tar.gz cubeb-c88a484e1aac878419946334c49d35d6948beec7.zip |
Relax some of the checks in the loopback test to avoid false positives.
- For the silent loopback test we check that we don't get any sound above an
epsilon. The value of this epsilon has been increased to accommodate a wider
range of systems.
- The delay on all tests has been increased to allow for more time to capture
looped samples. The original 150ms delay was sufficient on the machine I tested
with, however, I've seen the tests fail due to not having enough looped input.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_loopback.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/test_loopback.cpp b/test/test_loopback.cpp index 4fe5137..41624b7 100644 --- a/test/test_loopback.cpp +++ b/test/test_loopback.cpp @@ -294,7 +294,7 @@ void run_loopback_duplex_test(bool is_float) cleanup_stream_at_exit(stream, cubeb_stream_destroy); cubeb_stream_start(stream); - delay(150); + delay(300); cubeb_stream_stop(stream); /* access after stop should not happen, but lock just in case and to appease sanitization tools */ @@ -377,7 +377,7 @@ void run_loopback_separate_streams_test(bool is_float) cubeb_stream_start(input_stream); cubeb_stream_start(output_stream); - delay(150); + delay(300); cubeb_stream_stop(output_stream); cubeb_stream_stop(input_stream); @@ -444,7 +444,7 @@ void run_loopback_silence_test(bool is_float) cleanup_input_stream_at_exit(input_stream, cubeb_stream_destroy); cubeb_stream_start(input_stream); - delay(50); + delay(300); cubeb_stream_stop(input_stream); /* access after stop should not happen, but lock just in case and to appease sanitization tools */ @@ -453,7 +453,7 @@ void run_loopback_silence_test(bool is_float) /* expect to have at least ~50ms of frames */ ASSERT_GE(input_frames.size(), SAMPLE_FREQUENCY / 20); - double EPISILON = 0.000001; + double EPISILON = 0.0001; /* frames should be 0.0, but use epsilon to avoid possible issues with impls that may use ~0.0 silence values. */ for (double frame : input_frames) { @@ -544,7 +544,7 @@ void run_loopback_device_selection_test(bool is_float) cubeb_stream_start(input_stream); cubeb_stream_start(output_stream); - delay(150); + delay(300); cubeb_stream_stop(output_stream); cubeb_stream_stop(input_stream); |