diff options
| -rw-r--r-- | test/verify_test.cc | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/test/verify_test.cc b/test/verify_test.cc index 02067cf3..52d774bd 100644 --- a/test/verify_test.cc +++ b/test/verify_test.cc @@ -963,19 +963,32 @@ BOOST_AUTO_TEST_CASE (verify_valid_cpl_metadata) } +path +find_prefix(path dir, string prefix) +{ + auto iter = std::find_if(directory_iterator(dir), directory_iterator(), [prefix](path const& p) { + return boost::starts_with(p.filename().string(), prefix); + }); + + BOOST_REQUIRE(iter != directory_iterator()); + return iter->path(); +} + + path find_cpl (path dir) { - for (auto i: directory_iterator(dir)) { - if (boost::starts_with(i.path().filename().string(), "cpl_")) { - return i.path(); - } - } + return find_prefix(dir, "cpl_"); +} + - BOOST_REQUIRE (false); - return {}; +path +find_pkl(path dir) +{ + return find_prefix(dir, "pkl_"); } + /* DCP with invalid CompositionMetadataAsset */ BOOST_AUTO_TEST_CASE (verify_invalid_cpl_metadata_bad_tag) { |
