aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/test_resampler.cpp
diff options
context:
space:
mode:
authorMatthew Gregan <[email protected]>2016-03-24 14:33:09 +1300
committerMatthew Gregan <[email protected]>2016-03-24 14:33:09 +1300
commit2e1b6fb870b59aa8221857fe401c9e7eb679c016 (patch)
tree9a1db49f95c622d069950c6336bf8cca71d661e0 /test/test_resampler.cpp
parent885faf0d28cc5a91e20149f5c70731866ba9b7be (diff)
parentb4713bb6099e5c20e80db884f6f6946d12f3dd7b (diff)
downloadcubeb-2e1b6fb870b59aa8221857fe401c9e7eb679c016.tar.gz
cubeb-2e1b6fb870b59aa8221857fe401c9e7eb679c016.zip
Merge branch 'padenot-fixes-wasapi'
Diffstat (limited to 'test/test_resampler.cpp')
-rw-r--r--test/test_resampler.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/test/test_resampler.cpp b/test/test_resampler.cpp
index 4ddab11..ba27b2a 100644
--- a/test/test_resampler.cpp
+++ b/test/test_resampler.cpp
@@ -5,9 +5,7 @@
* accompanying file LICENSE for details.
*/
-#define OUTSIDE_SPEEX
-#define RANDOM_PREFIX speex
-
+#include "config.h"
#include "cubeb_resampler_internal.h"
#include <assert.h>
#include <stdio.h>
@@ -345,7 +343,6 @@ void test_resampler_duplex(uint32_t input_channels, uint32_t output_channels,
const uint32_t duration_s = 2;
int32_t duration_frames = duration_s * target_rate;
- uint32_t resampled_chunk_frame_count = chunk_duration * target_rate / 1000;
uint32_t input_array_frame_count = ceil(chunk_duration * input_rate / 1000) + ceilf(static_cast<float>(input_rate) / target_rate) * 2;
uint32_t output_array_frame_count = chunk_duration * output_rate / 1000;
auto_array<float> input_buffer(input_channels * input_array_frame_count);
@@ -486,13 +483,15 @@ void test_output_only_noop()
test_output_only_noop_data_cb, nullptr,
CUBEB_RESAMPLER_QUALITY_VOIP);
- long out_frames = 128;
+ const long out_frames = 128;
float out_buffer[out_frames];
long got;
got = cubeb_resampler_fill(resampler, nullptr, nullptr,
out_buffer, out_frames);
+ assert(got == out_frames);
+
cubeb_resampler_destroy(resampler);
}
@@ -502,7 +501,7 @@ long test_drain_data_cb(cubeb_stream * stm, void * user_ptr,
{
assert(output_buffer);
assert(!input_buffer);
- return frame_count - 1;
+ return frame_count - 10;
}
void test_resampler_drain()
@@ -520,7 +519,7 @@ void test_resampler_drain()
test_drain_data_cb, nullptr,
CUBEB_RESAMPLER_QUALITY_VOIP);
- long out_frames = 128;
+ const long out_frames = 128;
float out_buffer[out_frames];
long got;