From dbc99439fb29d9c7aec3941b7d7cda92910a36fe Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 3 Sep 2020 12:09:11 +0200 Subject: [PATCH] Remove stdout noise from tests. --- test/sound_frame_test.cc | 5 ++++- test/verify_test.cc | 27 ++++++++------------------- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/test/sound_frame_test.cc b/test/sound_frame_test.cc index d0840d8c..d5491a78 100644 --- a/test/sound_frame_test.cc +++ b/test/sound_frame_test.cc @@ -78,7 +78,10 @@ BOOST_AUTO_TEST_CASE (sound_frame_test) BOOST_AUTO_TEST_CASE (sound_frame_test2) { - BOOST_CHECK_THROW (dcp::SoundAsset("frobozz"), dcp::FileError); + { + dcp::ASDCPErrorSuspender sus; + BOOST_CHECK_THROW (dcp::SoundAsset("frobozz"), dcp::FileError); + } dcp::SoundAsset asset ( private_test / diff --git a/test/verify_test.cc b/test/verify_test.cc index 14d498b0..f70c53e7 100644 --- a/test/verify_test.cc +++ b/test/verify_test.cc @@ -121,6 +121,8 @@ private: std::string _content; }; + +#if 0 static void dump_notes (list const & notes) @@ -129,6 +131,7 @@ dump_notes (list const & notes) std::cout << dcp::note_to_string(i) << "\n"; } } +#endif /* Check DCP as-is (should be OK) */ BOOST_AUTO_TEST_CASE (verify_test1) @@ -175,8 +178,6 @@ BOOST_AUTO_TEST_CASE (verify_test1) ++st; BOOST_REQUIRE (st == stages.end()); - dump_notes (notes); - BOOST_CHECK_EQUAL (notes.size(), 0); } @@ -198,7 +199,11 @@ BOOST_AUTO_TEST_CASE (verify_test2) BOOST_REQUIRE (fwrite (&x, sizeof(x), 1, mod) == 1); fclose (mod); - list notes = dcp::verify (directories, &stage, &progress, xsd_test); + list notes; + { + dcp::ASDCPErrorSuspender sus; + notes = dcp::verify (directories, &stage, &progress, xsd_test); + } BOOST_REQUIRE_EQUAL (notes.size(), 2); BOOST_CHECK_EQUAL (notes.front().type(), dcp::VerificationNote::VERIFY_ERROR); @@ -219,8 +224,6 @@ BOOST_AUTO_TEST_CASE (verify_test3) list notes = dcp::verify (directories, &stage, &progress, xsd_test); - dump_notes (notes); - BOOST_REQUIRE_EQUAL (notes.size(), 6); list::const_iterator i = notes.begin(); BOOST_CHECK_EQUAL (i->type(), dcp::VerificationNote::VERIFY_ERROR); @@ -293,8 +296,6 @@ void check_after_replace (int n, boost::function list notes = dcp::verify (directories, &stage, &progress, xsd_test); - dump_notes (notes); - BOOST_REQUIRE_EQUAL (notes.size(), 1); BOOST_CHECK_EQUAL (notes.front().code(), code1); } @@ -311,8 +312,6 @@ void check_after_replace (int n, boost::function list notes = dcp::verify (directories, &stage, &progress, xsd_test); - dump_notes (notes); - BOOST_REQUIRE_EQUAL (notes.size(), 2); BOOST_CHECK_EQUAL (notes.front().code(), code1); BOOST_CHECK_EQUAL (notes.back().code(), code2); @@ -337,8 +336,6 @@ void check_after_replace ( list notes = dcp::verify (directories, &stage, &progress, xsd_test); - dump_notes (notes); - BOOST_REQUIRE_EQUAL (notes.size(), 3); list::const_iterator i = notes.begin (); BOOST_CHECK_EQUAL (i->code(), code1); @@ -488,8 +485,6 @@ BOOST_AUTO_TEST_CASE (verify_test13) ++st; BOOST_REQUIRE (st == stages.end()); - dump_notes (notes); - BOOST_CHECK_EQUAL (notes.size(), 0); } @@ -499,8 +494,6 @@ BOOST_AUTO_TEST_CASE (verify_test14) vector directories = setup (8, 14); list notes = dcp::verify (directories, &stage, &progress, xsd_test); - dump_notes (notes); - BOOST_REQUIRE_EQUAL (notes.size(), 4); list::const_iterator i = notes.begin (); BOOST_CHECK_EQUAL (i->code(), dcp::VerificationNote::DURATION_TOO_SMALL); @@ -659,7 +652,6 @@ BOOST_AUTO_TEST_CASE (verify_test19) vector dirs; dirs.push_back (dir); list notes = dcp::verify (dirs, &stage, &progress, xsd_test); - dump_notes(notes); BOOST_REQUIRE_EQUAL (notes.size(), 2); BOOST_CHECK_EQUAL (notes.front().code(), dcp::VerificationNote::XML_VALIDATION_ERROR); BOOST_CHECK_EQUAL (notes.back().code(), dcp::VerificationNote::XML_VALIDATION_ERROR); @@ -686,7 +678,6 @@ BOOST_AUTO_TEST_CASE (verify_test20) vector dirs; dirs.push_back (dir); list notes = dcp::verify (dirs, &stage, &progress, xsd_test); - dump_notes (notes); BOOST_REQUIRE_EQUAL (notes.size(), 0); } @@ -711,7 +702,6 @@ BOOST_AUTO_TEST_CASE (verify_test21) vector dirs; dirs.push_back (dir); list notes = dcp::verify (dirs, &stage, &progress, xsd_test); - dump_notes (notes); BOOST_REQUIRE_EQUAL (notes.size(), 2); BOOST_CHECK_EQUAL (notes.front().code(), dcp::VerificationNote::XML_VALIDATION_ERROR); BOOST_CHECK_EQUAL (notes.back().code(), dcp::VerificationNote::XML_VALIDATION_ERROR); @@ -748,7 +738,6 @@ BOOST_AUTO_TEST_CASE (verify_test22) vector dirs; dirs.push_back (vf_dir); list notes = dcp::verify (dirs, &stage, &progress, xsd_test); - dump_notes (notes); BOOST_REQUIRE_EQUAL (notes.size(), 1); BOOST_CHECK_EQUAL (notes.front().code(), dcp::VerificationNote::EXTERNAL_ASSET); } -- 2.30.2