diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-04-14 18:18:09 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-04-14 22:48:35 +0200 |
| commit | 98199b85dfb35a5de045b2c675d4a1bdccd83cf5 (patch) | |
| tree | 452b98e9df1607e131befddab388fa796f339f3c /test | |
| parent | 16a42e43922f3ae40dac6e0e4a8474439401b2c8 (diff) | |
Move some methods higher up the file.
Diffstat (limited to 'test')
| -rw-r--r-- | test/verify_test.cc | 69 |
1 files changed, 37 insertions, 32 deletions
diff --git a/test/verify_test.cc b/test/verify_test.cc index b4019acd..038d85cc 100644 --- a/test/verify_test.cc +++ b/test/verify_test.cc @@ -148,6 +148,43 @@ prepare_directory (path path) } +static +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(); +} + + +static +path +find_cpl(path dir) +{ + return find_prefix(dir, "cpl_"); +} + + +static +path +find_pkl(path dir) +{ + return find_prefix(dir, "pkl_"); +} + + +static +path +find_asset_map(path dir) +{ + return find_prefix(dir, "ASSETMAP"); +} + + /** Copy dcp_test{reference_number} to build/test/verify_test{verify_test_suffix} * to make a new sacrificial test DCP. */ @@ -1163,38 +1200,6 @@ 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) -{ - return find_prefix(dir, "cpl_"); -} - - -path -find_pkl(path dir) -{ - return find_prefix(dir, "pkl_"); -} - - -path -find_asset_map(path dir) -{ - return find_prefix(dir, "ASSETMAP"); -} - - /* DCP with invalid CompositionMetadataAsset */ BOOST_AUTO_TEST_CASE (verify_invalid_cpl_metadata_bad_tag) { |
