X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fzipper_test.cc;h=1b8c386f4356e369090266be63e51a4f8abc5f1a;hb=01cfa8b85b93589476ce3dbff5f9f207ad737abf;hp=1ec7ff80b9e74398fd13fc1af533542e3bfb29d2;hpb=8611fc8597605aa51373adb4fc8f0c697b8c7360;p=dcpomatic.git diff --git a/test/zipper_test.cc b/test/zipper_test.cc index 1ec7ff80b..1b8c386f4 100644 --- a/test/zipper_test.cc +++ b/test/zipper_test.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2020 Carl Hetherington + Copyright (C) 2020-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,18 +18,21 @@ */ + /** @file test/zipper_test.cc * @brief Test Zipper class. * @ingroup selfcontained */ -#include "lib/zipper.h" + #include "lib/exceptions.h" +#include "lib/zipper.h" #include "test.h" #include #include #include + /** Basic test of Zipper working normally */ BOOST_AUTO_TEST_CASE (zipper_test1) { @@ -42,7 +45,15 @@ BOOST_AUTO_TEST_CASE (zipper_test1) zipper.close (); 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) + * so try using the built-in tar which can unzip things. + */ + boost::filesystem::create_directories ("build/test/zipper_test1"); + int const r = system ("tar -xf build\\test\\zipped.zip -C build\\test\\zipper_test1"); +#else int const r = system ("unzip build/test/zipped.zip -d build/test/zipper_test1"); +#endif BOOST_REQUIRE_EQUAL (r, 0); BOOST_CHECK_EQUAL (dcp::file_to_string("build/test/zipper_test1/foo.txt"), "1234567890");