diff options
Diffstat (limited to 'libs/audiographer/tests/general')
10 files changed, 64 insertions, 64 deletions
diff --git a/libs/audiographer/tests/general/chunker_test.cc b/libs/audiographer/tests/general/chunker_test.cc index c667360601..ea5c29a410 100644 --- a/libs/audiographer/tests/general/chunker_test.cc +++ b/libs/audiographer/tests/general/chunker_test.cc @@ -33,13 +33,13 @@ class ChunkerTest : public CppUnit::TestFixture void testSynchronousProcess() { chunker->add_output (sink); - nframes_t frames_output = 0; + framecnt_t frames_output = 0; ProcessContext<float> const context (random_data, frames, 1); chunker->process (context); frames_output = sink->get_data().size(); - CPPUNIT_ASSERT_EQUAL ((nframes_t) 0, frames_output); + CPPUNIT_ASSERT_EQUAL ((framecnt_t) 0, frames_output); chunker->process (context); frames_output = sink->get_data().size(); @@ -51,7 +51,7 @@ class ChunkerTest : public CppUnit::TestFixture chunker->process (context); frames_output = sink->get_data().size(); - CPPUNIT_ASSERT_EQUAL ((nframes_t) 0, frames_output); + CPPUNIT_ASSERT_EQUAL ((framecnt_t) 0, frames_output); chunker->process (context); frames_output = sink->get_data().size(); @@ -65,7 +65,7 @@ class ChunkerTest : public CppUnit::TestFixture assert (frames % 2 == 0); chunker->add_output (sink); - nframes_t frames_output = 0; + framecnt_t frames_output = 0; ProcessContext<float> const half_context (random_data, frames / 2, 1); ProcessContext<float> const context (random_data, frames, 1); @@ -73,12 +73,12 @@ class ChunkerTest : public CppUnit::TestFixture // 0.5 chunker->process (half_context); frames_output = sink->get_data().size(); - CPPUNIT_ASSERT_EQUAL ((nframes_t) 0, frames_output); + CPPUNIT_ASSERT_EQUAL ((framecnt_t) 0, frames_output); // 1.5 chunker->process (context); frames_output = sink->get_data().size(); - CPPUNIT_ASSERT_EQUAL ((nframes_t) 0, frames_output); + CPPUNIT_ASSERT_EQUAL ((framecnt_t) 0, frames_output); // 2.5 chunker->process (context); @@ -93,7 +93,7 @@ class ChunkerTest : public CppUnit::TestFixture // 3.5 chunker->process (context); frames_output = sink->get_data().size(); - CPPUNIT_ASSERT_EQUAL ((nframes_t) 0, frames_output); + CPPUNIT_ASSERT_EQUAL ((framecnt_t) 0, frames_output); // 4.0 chunker->process (half_context); @@ -112,7 +112,7 @@ class ChunkerTest : public CppUnit::TestFixture chunker.reset (new Chunker<float>(frames / 4)); chunker->add_output (sink); - nframes_t frames_output = 0; + framecnt_t frames_output = 0; ProcessContext<float> const half_context (random_data, frames / 2, 1); ProcessContext<float> const context (random_data, frames, 1); @@ -120,12 +120,12 @@ class ChunkerTest : public CppUnit::TestFixture // 0.5 chunker->process (half_context); frames_output = sink->get_data().size(); - CPPUNIT_ASSERT_EQUAL ((nframes_t) frames / 2, frames_output); + CPPUNIT_ASSERT_EQUAL ((framecnt_t) frames / 2, frames_output); // 1.5 chunker->process (context); frames_output = sink->get_data().size(); - CPPUNIT_ASSERT_EQUAL ((nframes_t) frames / 2 * 3, frames_output); + CPPUNIT_ASSERT_EQUAL ((framecnt_t) frames / 2 * 3, frames_output); // 2.5 chunker->process (context); @@ -141,7 +141,7 @@ class ChunkerTest : public CppUnit::TestFixture boost::shared_ptr<VectorSink<float> > sink; float * random_data; - nframes_t frames; + framecnt_t frames; }; CPPUNIT_TEST_SUITE_REGISTRATION (ChunkerTest); diff --git a/libs/audiographer/tests/general/deinterleaver_test.cc b/libs/audiographer/tests/general/deinterleaver_test.cc index 3d644a3cf1..3260045b11 100644 --- a/libs/audiographer/tests/general/deinterleaver_test.cc +++ b/libs/audiographer/tests/general/deinterleaver_test.cc @@ -61,9 +61,9 @@ class DeInterleaverTest : public CppUnit::TestFixture CPPUNIT_ASSERT_THROW (deinterleaver->process (c.beginning (total_frames - 1)), Exception); } - void assert_outputs (nframes_t expected_frames) + void assert_outputs (framecnt_t expected_frames) { - nframes_t generated_frames = 0; + framecnt_t generated_frames = 0; generated_frames = sink_a->get_data().size(); CPPUNIT_ASSERT_EQUAL (expected_frames, generated_frames); @@ -89,7 +89,7 @@ class DeInterleaverTest : public CppUnit::TestFixture assert_outputs (frames_per_channel); // Now with less frames - nframes_t const less_frames = frames_per_channel / 4; + framecnt_t const less_frames = frames_per_channel / 4; deinterleaver->process (c.beginning (less_frames * channels)); assert_outputs (less_frames); } @@ -120,8 +120,8 @@ class DeInterleaverTest : public CppUnit::TestFixture boost::shared_ptr<VectorSink<float> > sink_c; float * random_data; - nframes_t frames_per_channel; - nframes_t total_frames; + framecnt_t frames_per_channel; + framecnt_t total_frames; unsigned int channels; }; diff --git a/libs/audiographer/tests/general/interleaver_deinterleaver_test.cc b/libs/audiographer/tests/general/interleaver_deinterleaver_test.cc index 908abafdf2..da042b9494 100644 --- a/libs/audiographer/tests/general/interleaver_deinterleaver_test.cc +++ b/libs/audiographer/tests/general/interleaver_deinterleaver_test.cc @@ -55,7 +55,7 @@ class InterleaverDeInterleaverTest : public CppUnit::TestFixture CPPUNIT_ASSERT (TestUtils::array_equals (random_data_a, sink_a->get_array(), total_frames)); // And a second round... - nframes_t less_frames = (frames_per_channel / 10) * channels; + framecnt_t less_frames = (frames_per_channel / 10) * channels; deinterleaver->process (c.beginning (less_frames)); CPPUNIT_ASSERT (TestUtils::array_equals (random_data_a, sink_a->get_array(), less_frames)); } @@ -85,7 +85,7 @@ class InterleaverDeInterleaverTest : public CppUnit::TestFixture CPPUNIT_ASSERT (TestUtils::array_equals (random_data_c, sink_c->get_array(), frames_per_channel)); // And a second round... - nframes_t less_frames = frames_per_channel / 5; + framecnt_t less_frames = frames_per_channel / 5; interleaver->input (0)->process (c_a.beginning (less_frames)); interleaver->input (1)->process (c_b.beginning (less_frames)); interleaver->input (2)->process (c_c.beginning (less_frames)); @@ -108,8 +108,8 @@ class InterleaverDeInterleaverTest : public CppUnit::TestFixture float * random_data_b; float * random_data_c; - nframes_t frames_per_channel; - nframes_t total_frames; + framecnt_t frames_per_channel; + framecnt_t total_frames; unsigned int channels; }; diff --git a/libs/audiographer/tests/general/interleaver_test.cc b/libs/audiographer/tests/general/interleaver_test.cc index 1512d054fc..b82aac74bb 100644 --- a/libs/audiographer/tests/general/interleaver_test.cc +++ b/libs/audiographer/tests/general/interleaver_test.cc @@ -69,11 +69,11 @@ class InterleaverTest : public CppUnit::TestFixture interleaver->input (1)->process (c); interleaver->input (2)->process (c); - nframes_t expected_frames = frames * channels; - nframes_t generated_frames = sink->get_data().size(); + framecnt_t expected_frames = frames * channels; + framecnt_t generated_frames = sink->get_data().size(); CPPUNIT_ASSERT_EQUAL (expected_frames, generated_frames); - nframes_t less_frames = frames / 2; + framecnt_t less_frames = frames / 2; interleaver->input (0)->process (c.beginning (less_frames)); interleaver->input (1)->process (c.beginning (less_frames)); interleaver->input (2)->process (c.beginning (less_frames)); @@ -100,8 +100,8 @@ class InterleaverTest : public CppUnit::TestFixture interleaver->input (1)->process (c); interleaver->input (2)->process (c); - nframes_t expected_frames = frames * channels; - nframes_t generated_frames = sink->get_data().size(); + framecnt_t expected_frames = frames * channels; + framecnt_t generated_frames = sink->get_data().size(); CPPUNIT_ASSERT_EQUAL (expected_frames, generated_frames); } @@ -119,9 +119,9 @@ class InterleaverTest : public CppUnit::TestFixture boost::shared_ptr<VectorSink<float> > sink; - nframes_t channels; + framecnt_t channels; float * random_data; - nframes_t frames; + framecnt_t frames; }; CPPUNIT_TEST_SUITE_REGISTRATION (InterleaverTest); diff --git a/libs/audiographer/tests/general/normalizer_test.cc b/libs/audiographer/tests/general/normalizer_test.cc index b08fd73a0e..be23680202 100644 --- a/libs/audiographer/tests/general/normalizer_test.cc +++ b/libs/audiographer/tests/general/normalizer_test.cc @@ -54,7 +54,7 @@ class NormalizerTest : public CppUnit::TestFixture boost::shared_ptr<VectorSink<float> > sink; float * random_data; - nframes_t frames; + framecnt_t frames; }; CPPUNIT_TEST_SUITE_REGISTRATION (NormalizerTest); diff --git a/libs/audiographer/tests/general/peak_reader_test.cc b/libs/audiographer/tests/general/peak_reader_test.cc index 53b7a15174..6b60598a2e 100644 --- a/libs/audiographer/tests/general/peak_reader_test.cc +++ b/libs/audiographer/tests/general/peak_reader_test.cc @@ -48,7 +48,7 @@ class PeakReaderTest : public CppUnit::TestFixture boost::shared_ptr<PeakReader> reader; float * random_data; - nframes_t frames; + framecnt_t frames; }; CPPUNIT_TEST_SUITE_REGISTRATION (PeakReaderTest); diff --git a/libs/audiographer/tests/general/sample_format_converter_test.cc b/libs/audiographer/tests/general/sample_format_converter_test.cc index 1456528ebf..9239564d5b 100644 --- a/libs/audiographer/tests/general/sample_format_converter_test.cc +++ b/libs/audiographer/tests/general/sample_format_converter_test.cc @@ -62,7 +62,7 @@ class SampleFormatConverterTest : public CppUnit::TestFixture converter->init (frames, D_Tri, 32); converter->add_output (sink); - nframes_t frames_output = 0; + framecnt_t frames_output = 0; { ProcessContext<float> pc(random_data, frames / 2, 1); @@ -88,7 +88,7 @@ class SampleFormatConverterTest : public CppUnit::TestFixture { boost::shared_ptr<SampleFormatConverter<float> > converter (new SampleFormatConverter<float>(1)); boost::shared_ptr<VectorSink<float> > sink (new VectorSink<float>()); - nframes_t frames_output = 0; + framecnt_t frames_output = 0; converter->init(frames, D_Tri, 32); converter->add_output (sink); @@ -110,7 +110,7 @@ class SampleFormatConverterTest : public CppUnit::TestFixture CPPUNIT_ASSERT_EQUAL (frames, frames_output); CPPUNIT_ASSERT (TestUtils::array_filled(sink->get_array(), frames)); - for (nframes_t i = 0; i < frames; ++i) { + for (framecnt_t i = 0; i < frames; ++i) { // fp comparison needs a bit of tolerance, 1.01 << 1.5 CPPUNIT_ASSERT(sink->get_data()[i] < 1.01); CPPUNIT_ASSERT(sink->get_data()[i] > -1.01); @@ -121,7 +121,7 @@ class SampleFormatConverterTest : public CppUnit::TestFixture { boost::shared_ptr<SampleFormatConverter<int32_t> > converter (new SampleFormatConverter<int32_t>(1)); boost::shared_ptr<VectorSink<int32_t> > sink (new VectorSink<int32_t>()); - nframes_t frames_output = 0; + framecnt_t frames_output = 0; converter->init(frames, D_Tri, 32); converter->add_output (sink); @@ -137,7 +137,7 @@ class SampleFormatConverterTest : public CppUnit::TestFixture { boost::shared_ptr<SampleFormatConverter<int32_t> > converter (new SampleFormatConverter<int32_t>(1)); boost::shared_ptr<VectorSink<int32_t> > sink (new VectorSink<int32_t>()); - nframes_t frames_output = 0; + framecnt_t frames_output = 0; converter->init(frames, D_Tri, 24); converter->add_output (sink); @@ -153,7 +153,7 @@ class SampleFormatConverterTest : public CppUnit::TestFixture { boost::shared_ptr<SampleFormatConverter<int16_t> > converter (new SampleFormatConverter<int16_t>(1)); boost::shared_ptr<VectorSink<int16_t> > sink (new VectorSink<int16_t>()); - nframes_t frames_output = 0; + framecnt_t frames_output = 0; converter->init(frames, D_Tri, 16); converter->add_output (sink); @@ -169,7 +169,7 @@ class SampleFormatConverterTest : public CppUnit::TestFixture { boost::shared_ptr<SampleFormatConverter<uint8_t> > converter (new SampleFormatConverter<uint8_t>(1)); boost::shared_ptr<VectorSink<uint8_t> > sink (new VectorSink<uint8_t>()); - nframes_t frames_output = 0; + framecnt_t frames_output = 0; converter->init(frames, D_Tri, 8); converter->add_output (sink); @@ -185,7 +185,7 @@ class SampleFormatConverterTest : public CppUnit::TestFixture { boost::shared_ptr<SampleFormatConverter<int32_t> > converter (new SampleFormatConverter<int32_t>(3)); boost::shared_ptr<VectorSink<int32_t> > sink (new VectorSink<int32_t>()); - nframes_t frames_output = 0; + framecnt_t frames_output = 0; converter->init(frames, D_Tri, 32); converter->add_output (sink); @@ -193,7 +193,7 @@ class SampleFormatConverterTest : public CppUnit::TestFixture ProcessContext<float> pc(random_data, 4, 1); CPPUNIT_ASSERT_THROW (converter->process (pc), Exception); - nframes_t new_frame_count = frames - (frames % 3); + framecnt_t new_frame_count = frames - (frames % 3); converter->process (ProcessContext<float> (pc.data(), new_frame_count, 3)); frames_output = sink->get_data().size(); CPPUNIT_ASSERT_EQUAL (new_frame_count, frames_output); @@ -203,7 +203,7 @@ class SampleFormatConverterTest : public CppUnit::TestFixture private: float * random_data; - nframes_t frames; + framecnt_t frames; }; CPPUNIT_TEST_SUITE_REGISTRATION (SampleFormatConverterTest); diff --git a/libs/audiographer/tests/general/silence_trimmer_test.cc b/libs/audiographer/tests/general/silence_trimmer_test.cc index add24d026a..dfcf3c7ca2 100644 --- a/libs/audiographer/tests/general/silence_trimmer_test.cc +++ b/libs/audiographer/tests/general/silence_trimmer_test.cc @@ -50,14 +50,14 @@ class SilenceTrimmerTest : public CppUnit::TestFixture { ProcessContext<float> c (zero_data, frames, 1); trimmer->process (c); - nframes_t frames_processed = sink->get_data().size(); - CPPUNIT_ASSERT_EQUAL ((nframes_t) 0, frames_processed); + framecnt_t frames_processed = sink->get_data().size(); + CPPUNIT_ASSERT_EQUAL ((framecnt_t) 0, frames_processed); } { ProcessContext<float> c (random_data, frames, 1); trimmer->process (c); - nframes_t frames_processed = sink->get_data().size(); + framecnt_t frames_processed = sink->get_data().size(); CPPUNIT_ASSERT_EQUAL (frames, frames_processed); CPPUNIT_ASSERT (TestUtils::array_equals (sink->get_array(), random_data, frames)); } @@ -65,14 +65,14 @@ class SilenceTrimmerTest : public CppUnit::TestFixture { ProcessContext<float> c (zero_data, frames, 1); trimmer->process (c); - nframes_t frames_processed = sink->get_data().size(); + framecnt_t frames_processed = sink->get_data().size(); CPPUNIT_ASSERT_EQUAL (frames, frames_processed); } { ProcessContext<float> c (random_data, frames, 1); trimmer->process (c); - nframes_t frames_processed = sink->get_data().size(); + framecnt_t frames_processed = sink->get_data().size(); CPPUNIT_ASSERT_EQUAL (3 * frames, frames_processed); CPPUNIT_ASSERT (TestUtils::array_equals (sink->get_array(), random_data, frames)); CPPUNIT_ASSERT (TestUtils::array_equals (&sink->get_array()[frames], zero_data, frames)); @@ -82,7 +82,7 @@ class SilenceTrimmerTest : public CppUnit::TestFixture { ProcessContext<float> c (zero_data, frames, 1); trimmer->process (c); - nframes_t frames_processed = sink->get_data().size(); + framecnt_t frames_processed = sink->get_data().size(); CPPUNIT_ASSERT_EQUAL (3 * frames, frames_processed); } } @@ -97,7 +97,7 @@ class SilenceTrimmerTest : public CppUnit::TestFixture { ProcessContext<float> c (half_random_data, frames, 1); trimmer->process (c); - nframes_t frames_processed = sink->get_data().size(); + framecnt_t frames_processed = sink->get_data().size(); CPPUNIT_ASSERT_EQUAL (frames / 2, frames_processed); CPPUNIT_ASSERT (TestUtils::array_equals (sink->get_array(), &half_random_data[frames / 2], frames / 2)); } @@ -105,14 +105,14 @@ class SilenceTrimmerTest : public CppUnit::TestFixture { ProcessContext<float> c (zero_data, frames, 1); trimmer->process (c); - nframes_t frames_processed = sink->get_data().size(); + framecnt_t frames_processed = sink->get_data().size(); CPPUNIT_ASSERT_EQUAL (frames / 2, frames_processed); } { ProcessContext<float> c (half_random_data, frames, 1); trimmer->process (c); - nframes_t frames_processed = sink->get_data().size(); + framecnt_t frames_processed = sink->get_data().size(); CPPUNIT_ASSERT_EQUAL (2 * frames + frames / 2, frames_processed); CPPUNIT_ASSERT (TestUtils::array_equals (&sink->get_array()[frames + frames / 2], half_random_data, frames)); } @@ -129,7 +129,7 @@ class SilenceTrimmerTest : public CppUnit::TestFixture { trimmer->add_output (sink); - nframes_t silence = frames / 2; + framecnt_t silence = frames / 2; trimmer->add_silence_to_beginning (silence); { @@ -145,7 +145,7 @@ class SilenceTrimmerTest : public CppUnit::TestFixture { trimmer->add_output (sink); - nframes_t silence = frames / 3; + framecnt_t silence = frames / 3; trimmer->add_silence_to_end (silence); { @@ -159,8 +159,8 @@ class SilenceTrimmerTest : public CppUnit::TestFixture trimmer->process (c); } - nframes_t frames_processed = sink->get_data().size(); - nframes_t total_frames = 2 * frames + silence; + framecnt_t frames_processed = sink->get_data().size(); + framecnt_t total_frames = 2 * frames + silence; CPPUNIT_ASSERT_EQUAL (total_frames, frames_processed); CPPUNIT_ASSERT (TestUtils::array_equals (sink->get_array(), random_data, frames)); CPPUNIT_ASSERT (TestUtils::array_equals (&sink->get_array()[frames], random_data, frames)); @@ -174,7 +174,7 @@ class SilenceTrimmerTest : public CppUnit::TestFixture float * random_data; float * zero_data; float * half_random_data; - nframes_t frames; + framecnt_t frames; }; CPPUNIT_TEST_SUITE_REGISTRATION (SilenceTrimmerTest); diff --git a/libs/audiographer/tests/general/sr_converter_test.cc b/libs/audiographer/tests/general/sr_converter_test.cc index 68e21d3558..75834127f5 100644 --- a/libs/audiographer/tests/general/sr_converter_test.cc +++ b/libs/audiographer/tests/general/sr_converter_test.cc @@ -31,8 +31,8 @@ class SampleRateConverterTest : public CppUnit::TestFixture void testNoConversion() { assert (frames % 2 == 0); - nframes_t const half_frames = frames / 2; - nframes_t frames_output = 0; + framecnt_t const half_frames = frames / 2; + framecnt_t frames_output = 0; converter->init (44100, 44100); converter->add_output (sink); @@ -52,8 +52,8 @@ class SampleRateConverterTest : public CppUnit::TestFixture void testUpsampleLength() { assert (frames % 2 == 0); - nframes_t const half_frames = frames / 2; - nframes_t frames_output = 0; + framecnt_t const half_frames = frames / 2; + framecnt_t frames_output = 0; converter->init (44100, 88200); converter->allocate_buffers (half_frames); @@ -66,15 +66,15 @@ class SampleRateConverterTest : public CppUnit::TestFixture converter->process (c2); frames_output = sink->get_data().size(); - nframes_t tolerance = 3; + framecnt_t tolerance = 3; CPPUNIT_ASSERT (2 * frames - tolerance < frames_output && frames_output < 2 * frames + tolerance); } void testDownsampleLength() { assert (frames % 2 == 0); - nframes_t const half_frames = frames / 2; - nframes_t frames_output = 0; + framecnt_t const half_frames = frames / 2; + framecnt_t frames_output = 0; converter->init (88200, 44100); converter->allocate_buffers (half_frames); @@ -87,14 +87,14 @@ class SampleRateConverterTest : public CppUnit::TestFixture converter->process (c2); frames_output = sink->get_data().size(); - nframes_t tolerance = 3; + framecnt_t tolerance = 3; CPPUNIT_ASSERT (half_frames - tolerance < frames_output && frames_output < half_frames + tolerance); } void testRespectsEndOfInput() { assert (frames % 2 == 0); - nframes_t const half_frames = frames / 2; + framecnt_t const half_frames = frames / 2; converter->init (44100, 48000); converter->allocate_buffers (half_frames); @@ -123,7 +123,7 @@ class SampleRateConverterTest : public CppUnit::TestFixture boost::shared_ptr<ProcessContextGrabber<float> > grabber; float * random_data; - nframes_t frames; + framecnt_t frames; }; CPPUNIT_TEST_SUITE_REGISTRATION (SampleRateConverterTest); diff --git a/libs/audiographer/tests/general/threader_test.cc b/libs/audiographer/tests/general/threader_test.cc index c599d87953..1e87c8d34d 100644 --- a/libs/audiographer/tests/general/threader_test.cc +++ b/libs/audiographer/tests/general/threader_test.cc @@ -149,7 +149,7 @@ class ThreaderTest : public CppUnit::TestFixture float * random_data; float * zero_data; - nframes_t frames; + framecnt_t frames; }; CPPUNIT_TEST_SUITE_REGISTRATION (ThreaderTest); |