summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-10-06 02:37:16 +0200
committerCarl Hetherington <cth@carlh.net>2023-10-09 01:21:22 +0200
commitf0f4dd5e6b6ed5e50d0444a4de3b2a13156edf64 (patch)
treedce96c211c6d92062187e8c40026c04a26af72e9 /test
parent89e39ea9e20bc4f8e88e42a57d4505e1fa69fde5 (diff)
Use dcp::filesystem to wrap filesystem calls and fix_long_path2623-add-windows
anything that is passed to read_file() from libcxml. This should fix #2623 and other similar problems.
Diffstat (limited to 'test')
-rw-r--r--test/test.cc3
-rw-r--r--test/zipper_test.cc6
2 files changed, 8 insertions, 1 deletions
diff --git a/test/test.cc b/test/test.cc
index 630026120..9b08dfb4e 100644
--- a/test/test.cc
+++ b/test/test.cc
@@ -46,6 +46,7 @@
#include <dcp/cpl.h>
#include <dcp/dcp.h>
#include <dcp/equality_options.h>
+#include <dcp/filesystem.h>
#include <dcp/mono_picture_asset.h>
#include <dcp/mono_picture_frame.h>
#include <dcp/openjpeg_image.h>
@@ -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";
}
diff --git a/test/zipper_test.cc b/test/zipper_test.cc
index 1b8c386f4..37e6176f0 100644
--- a/test/zipper_test.cc
+++ b/test/zipper_test.cc
@@ -28,6 +28,7 @@
#include "lib/exceptions.h"
#include "lib/zipper.h"
#include "test.h"
+#include <dcp/filesystem.h>
#include <dcp/util.h>
#include <boost/test/unit_test.hpp>
#include <boost/filesystem.hpp>
@@ -44,6 +45,11 @@ BOOST_AUTO_TEST_CASE (zipper_test1)
zipper.add ("bar.txt", "xxxxxxCCCCbbbbbbb1");
zipper.close ();
+ /* Make sure we aren't in a UNC current working directory otherwise the use of cmd.exe
+ * in system() below will fail.
+ */
+ boost::filesystem::current_path(dcp::filesystem::unfix_long_path(boost::filesystem::current_path()));
+
boost::filesystem::remove_all ("build/test/zipper_test1", ec);
#ifdef DCPOMATIC_WINDOWS
/* unzip on windows crashes every so often (with a return code -1073740940, for some reason)