From 98199b85dfb35a5de045b2c675d4a1bdccd83cf5 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 14 Apr 2024 18:18:09 +0200 Subject: Move some methods higher up the file. --- test/verify_test.cc | 69 ++++++++++++++++++++++++++++------------------------- 1 file changed, 37 insertions(+), 32 deletions(-) (limited to 'test') 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) { -- cgit v1.2.3