diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-12-15 07:44:41 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-12-15 07:44:41 +0100 |
| commit | b4400c1b8c288aefa2cb0f4d2fa47a94b1a79b65 (patch) | |
| tree | 3f14220eb1423f966301a51bc9bbfdc58a07de3c /test/ffmpeg_dcp_test.cc | |
| parent | 52b3eee4e7285e26469b2a5f4d9d9eac20aba387 (diff) | |
Fix test now that Film::cpls() checks a bit less.
Diffstat (limited to 'test/ffmpeg_dcp_test.cc')
| -rw-r--r-- | test/ffmpeg_dcp_test.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/test/ffmpeg_dcp_test.cc b/test/ffmpeg_dcp_test.cc index c0921bd4c..5e436b503 100644 --- a/test/ffmpeg_dcp_test.cc +++ b/test/ffmpeg_dcp_test.cc @@ -59,13 +59,15 @@ BOOST_AUTO_TEST_CASE(ffmpeg_have_dcp_test, * boost::unit_test::depends_on("ffmpe BOOST_CHECK(!film->cpls().empty()); p /= film->dcp_name(); - auto i = boost::filesystem::directory_iterator(p); - while (i != boost::filesystem::directory_iterator() && !boost::algorithm::starts_with(i->path().filename().string(), "j2c")) { - ++i; - } - - if (i != boost::filesystem::directory_iterator()) { - boost::filesystem::remove(i->path()); + auto iter = std::find_if( + boost::filesystem::directory_iterator(p), + boost::filesystem::directory_iterator(), + [](boost::filesystem::directory_entry const& entry) { + return boost::algorithm::starts_with(entry.path().filename().string(), "cpl"); + }); + + if (iter != boost::filesystem::directory_iterator()) { + boost::filesystem::remove(iter->path()); } BOOST_CHECK(film->cpls().empty()); |
