From e6913e8eb44e1dc990ef89f19ab64792880898a5 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 5 Jun 2015 01:26:06 +0100 Subject: [PATCH] Rationalise naming of test outputs; fix missing check of dcp_test2. --- run/tests | 13 ++++++++++--- test/encryption_test.cc | 18 +++++++++--------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/run/tests b/run/tests index e8357d73..c4065dff 100755 --- a/run/tests +++ b/run/tests @@ -34,15 +34,22 @@ if [ "$?" != "0" ]; then exit 1 fi -# Check the first DCP written by the unit tests +# Check the DCP written by dcp_test1 diff -ur test/ref/DCP/dcp_test1 $work/DCP/dcp_test1 if [ "$?" != "0" ]; then echo "FAIL: files differ" exit 1 fi -# Check the second DCP written by the unit tests -diff -ur test/ref/DCP/bar $work/DCP/bar +# Check the DCP written by dcp_test2 +diff -ur test/ref/DCP/dcp_test2 $work/DCP/dcp_test2 +if [ "$?" != "0" ]; then + echo "FAIL: files differ" + exit 1 +fi + +# Check the DCP written by encryption_test +diff -ur test/ref/DCP/encryption_test $work/DCP/encryption_test if [ "$?" != "0" ]; then echo "FAIL: files differ" exit 1 diff --git a/test/encryption_test.cc b/test/encryption_test.cc index 071de9db..e0256cb4 100644 --- a/test/encryption_test.cc +++ b/test/encryption_test.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2014 Carl Hetherington + Copyright (C) 2013-2015 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -61,9 +61,9 @@ BOOST_AUTO_TEST_CASE (encryption_test) xml_metadata.creator = "OpenDCP 0.0.25"; xml_metadata.issue_date = "2012-07-17T04:45:18+00:00"; - boost::filesystem::remove_all ("build/test/DCP/bar"); - boost::filesystem::create_directories ("build/test/DCP/bar"); - dcp::DCP d ("build/test/DCP/bar"); + boost::filesystem::remove_all ("build/test/DCP/encryption_test"); + boost::filesystem::create_directories ("build/test/DCP/encryption_test"); + dcp::DCP d ("build/test/DCP/encryption_test"); /* Use test/ref/crypt so this test is repeatable */ dcp::CertificateChain chain; @@ -86,7 +86,7 @@ BOOST_AUTO_TEST_CASE (encryption_test) mp->set_metadata (mxf_metadata); mp->set_key (key); - shared_ptr writer = mp->start_write ("build/test/DCP/bar/video.mxf", dcp::SMPTE, false); + shared_ptr writer = mp->start_write ("build/test/DCP/encryption_test/video.mxf", dcp::SMPTE, false); dcp::File j2c ("test/data/32x32_red_square.j2c"); for (int i = 0; i < 24; ++i) { writer->write (j2c.data (), j2c.size ()); @@ -95,7 +95,7 @@ BOOST_AUTO_TEST_CASE (encryption_test) shared_ptr ms (new dcp::SoundMXF (dcp::Fraction (24, 1), 48000, 1)); ms->set_key (key); - shared_ptr sound_writer = ms->start_write ("build/test/DCP/bar/audio.mxf", dcp::SMPTE); + shared_ptr sound_writer = ms->start_write ("build/test/DCP/encryption_test/audio.mxf", dcp::SMPTE); SF_INFO info; info.format = 0; @@ -135,10 +135,10 @@ BOOST_AUTO_TEST_CASE (encryption_test) "2012-07-17T04:45:18+00:00" ); - kdm.encrypt(signer, signer->certificates().leaf(), dcp::MODIFIED_TRANSITIONAL_1).as_xml ("build/test/bar.kdm.xml"); + kdm.encrypt(signer, signer->certificates().leaf(), dcp::MODIFIED_TRANSITIONAL_1).as_xml ("build/test/encryption_test.kdm.xml"); int r = system ( - "xmllint --path schema --nonet --noout --schema schema/SMPTE-430-1-2006-Amd-1-2009-KDM.xsd build/test/bar.kdm.xml " + "xmllint --path schema --nonet --noout --schema schema/SMPTE-430-1-2006-Amd-1-2009-KDM.xsd build/test/encryption_test.kdm.xml " "> build/test/xmllint.log 2>&1 < /dev/null" ); @@ -154,7 +154,7 @@ BOOST_AUTO_TEST_CASE (encryption_test) "--trusted-pem test/ref/crypt/ca.self-signed.pem " "--id-attr:Id http://www.smpte-ra.org/schemas/430-3/2006/ETM:AuthenticatedPublic " "--id-attr:Id http://www.smpte-ra.org/schemas/430-3/2006/ETM:AuthenticatedPrivate " - "build/test/bar.kdm.xml > build/test/xmlsec1.log 2>&1 < /dev/null"); + "build/test/encryption_test.kdm.xml > build/test/xmlsec1.log 2>&1 < /dev/null"); #ifdef LIBDCP_POSIX BOOST_CHECK_EQUAL (WEXITSTATUS (r), 0); -- 2.30.2