diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/sound_frame_test.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/sound_frame_test.cc b/test/sound_frame_test.cc index d5491a78..a9088e26 100644 --- a/test/sound_frame_test.cc +++ b/test/sound_frame_test.cc @@ -64,6 +64,7 @@ BOOST_AUTO_TEST_CASE (sound_frame_test) int const read = sf_readf_int (sndfile, ref_data, frame_length); BOOST_REQUIRE_EQUAL (read, frame_length); + /* Check raw data is as we expect */ uint8_t const * p = frame->data (); for (int i = 0; i < (frame_length * channels); ++i) { int x = ref_data[i] >> 8; @@ -74,6 +75,14 @@ BOOST_AUTO_TEST_CASE (sound_frame_test) BOOST_REQUIRE_EQUAL (x, y); p += 3; } + + /* Check SoundFrame::get() */ + int* ref = ref_data; + for (int sample = 0; sample < frame_length; ++sample) { + for (int channel = 0; channel < channels; ++channel) { + BOOST_REQUIRE_EQUAL ((*ref++) >> 8, frame->get(channel, sample)); + } + } } BOOST_AUTO_TEST_CASE (sound_frame_test2) |
