X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Ftest.cc;h=2bd31292a562ffab3dd49522810935257c089e18;hb=5b916bf26e3ad1cc49ef8e498bd5e4ff844ed7db;hp=630026120736327eb22cea872c9a5772f4315f8b;hpb=d371403c252203ff3f0f572bdae9b0ea95ecdb2f;p=dcpomatic.git diff --git a/test/test.cc b/test/test.cc index 630026120..2bd31292a 100644 --- a/test/test.cc +++ b/test/test.cc @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -107,7 +108,7 @@ TestPaths::TestPaths::private_data () boost::filesystem::path TestPaths::xsd () { - return boost::filesystem::canonical(boost::filesystem::path("..") / boost::filesystem::path("libdcp") / boost::filesystem::path("xsd")); + return boost::filesystem::current_path().parent_path() / "libdcp" / "xsd"; } @@ -842,7 +843,7 @@ dcp_file (shared_ptr film, string prefix) vector matches; std::copy_if(recursive_directory_iterator(film->dir(film->dcp_name())), recursive_directory_iterator(), std::back_inserter(matches), [&prefix](directory_entry const& entry) { - return boost::algorithm::starts_with(entry.path().leaf().string(), prefix); + return boost::algorithm::starts_with(entry.path().filename().string(), prefix); }); BOOST_REQUIRE_MESSAGE(matches.size() == 1, "Found " << matches.size() << " files with prefix " << prefix); @@ -853,7 +854,7 @@ boost::filesystem::path subtitle_file (shared_ptr film) { for (auto i: boost::filesystem::recursive_directory_iterator(film->directory().get() / film->dcp_name(false))) { - if (boost::algorithm::starts_with(i.path().leaf().string(), "sub_")) { + if (boost::algorithm::starts_with(i.path().filename().string(), "sub_")) { return i.path(); } }