Fix includes.
[libdcp.git] / test / encryption_test.cc
index 29b8f1fb348b653195d52ce6ea0c1321bec532af..6e145056127223288d0237b912a617233fc6c6b7 100644 (file)
@@ -36,8 +36,9 @@
 #include "dcp.h"
 #include "certificate_chain.h"
 #include "cpl.h"
-#include "mono_picture_asset.h"
-#include "picture_asset_writer.h"
+#include "filesystem.h"
+#include "mono_j2k_picture_asset.h"
+#include "j2k_picture_asset_writer.h"
 #include "sound_asset_writer.h"
 #include "sound_asset.h"
 #include "reel.h"
@@ -93,7 +94,7 @@ BOOST_AUTO_TEST_CASE (encryption_test)
        mp->set_metadata (mxf_metadata);
        mp->set_key (key);
 
-       auto writer = mp->start_write ("build/test/DCP/encryption_test/video.mxf", false);
+       auto writer = mp->start_write("build/test/DCP/encryption_test/video.mxf", dcp::PictureAsset::Behaviour::MAKE_NEW);
        dcp::ArrayData j2c ("test/data/flat_red.j2c");
        for (int i = 0; i < 24; ++i) {
                writer->write (j2c.data (), j2c.size ());
@@ -155,6 +156,11 @@ BOOST_AUTO_TEST_CASE (encryption_test)
 
        kdm.encrypt (signer, signer->leaf(), vector<string>(), dcp::Formulation::MODIFIED_TRANSITIONAL_1, true, 0).as_xml("build/test/encryption_test.kdm.xml");
 
+       /* 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()));
+
        int r = system (
                "xmllint --path schema --nonet --noout --schema schema/SMPTE-430-1-2006-Amd-1-2009-KDM.xsd build/test/encryption_test.kdm.xml "
 #ifndef LIBDCP_WINDOWS