summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-09-03 12:09:11 +0200
committerCarl Hetherington <cth@carlh.net>2020-09-21 21:57:18 +0200
commitdbc99439fb29d9c7aec3941b7d7cda92910a36fe (patch)
tree2eb911605d819e0132c2c603be6848ab26580b5e
parent15682e0e208cf9b6286d71ad0efd78fe7118332f (diff)
Remove stdout noise from tests.
-rw-r--r--test/sound_frame_test.cc5
-rw-r--r--test/verify_test.cc27
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<dcp::VerificationNote> const & notes)
@@ -129,6 +131,7 @@ dump_notes (list<dcp::VerificationNote> 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<dcp::VerificationNote> notes = dcp::verify (directories, &stage, &progress, xsd_test);
+ list<dcp::VerificationNote> 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<dcp::VerificationNote> notes = dcp::verify (directories, &stage, &progress, xsd_test);
- dump_notes (notes);
-
BOOST_REQUIRE_EQUAL (notes.size(), 6);
list<dcp::VerificationNote>::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<boost::filesystem::path (int)>
list<dcp::VerificationNote> 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<boost::filesystem::path (int)>
list<dcp::VerificationNote> 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<dcp::VerificationNote> notes = dcp::verify (directories, &stage, &progress, xsd_test);
- dump_notes (notes);
-
BOOST_REQUIRE_EQUAL (notes.size(), 3);
list<dcp::VerificationNote>::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<boost::filesystem::path> directories = setup (8, 14);
list<dcp::VerificationNote> notes = dcp::verify (directories, &stage, &progress, xsd_test);
- dump_notes (notes);
-
BOOST_REQUIRE_EQUAL (notes.size(), 4);
list<dcp::VerificationNote>::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<boost::filesystem::path> dirs;
dirs.push_back (dir);
list<dcp::VerificationNote> 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<boost::filesystem::path> dirs;
dirs.push_back (dir);
list<dcp::VerificationNote> 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<boost::filesystem::path> dirs;
dirs.push_back (dir);
list<dcp::VerificationNote> 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<boost::filesystem::path> dirs;
dirs.push_back (vf_dir);
list<dcp::VerificationNote> 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);
}