From 54038beb4437c027e584fc95110f6fd4dbf2207d Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 25 Aug 2016 11:41:21 +0100 Subject: Add channel details to high-audio-level hints (#822). --- test/audio_analysis_test.cc | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'test') diff --git a/test/audio_analysis_test.cc b/test/audio_analysis_test.cc index c960884a1..8328c7cd2 100644 --- a/test/audio_analysis_test.cc +++ b/test/audio_analysis_test.cc @@ -36,6 +36,7 @@ #include "lib/playlist.h" #include "test.h" +using std::vector; using boost::shared_ptr; static float @@ -61,9 +62,11 @@ BOOST_AUTO_TEST_CASE (audio_analysis_serialisation_test) } } - float const peak = random_float (); - DCPTime const peak_time = DCPTime (rand ()); - a.set_sample_peak (peak, peak_time); + vector peak; + for (int i = 0; i < channels; ++i) { + peak.push_back (AudioAnalysis::PeakTime (random_float(), DCPTime (rand()))); + } + a.set_sample_peak (peak); a.write ("build/test/audio_analysis_serialisation_test"); @@ -79,10 +82,11 @@ BOOST_AUTO_TEST_CASE (audio_analysis_serialisation_test) } } - BOOST_CHECK (b.sample_peak ()); - BOOST_CHECK_CLOSE (b.sample_peak().get(), peak, 1); - BOOST_CHECK (b.sample_peak_time ()); - BOOST_CHECK_EQUAL (b.sample_peak_time().get().get(), peak_time.get()); + BOOST_REQUIRE_EQUAL (b.sample_peak().size(), 3); + for (int i = 0; i < channels; ++i) { + BOOST_CHECK_CLOSE (b.sample_peak()[i].peak, peak[i].peak, 1); + BOOST_CHECK_EQUAL (b.sample_peak()[i].time.get(), peak[i].time.get()); + } } static void -- cgit v1.2.3