summaryrefslogtreecommitdiff
path: root/test/kdm_test.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-04-14 01:00:05 +0200
committerCarl Hetherington <cth@carlh.net>2021-04-14 01:00:05 +0200
commit274dd30f2b11fe8ea563a2ac7436c9d463865b0b (patch)
tree199e7447606339d461f6f87d16095376d8f809b3 /test/kdm_test.cc
parent4bd57fbbac67ac04ec47a9765b9f278aa1691851 (diff)
Fix/hide some warnings.
Diffstat (limited to 'test/kdm_test.cc')
-rw-r--r--test/kdm_test.cc28
1 files changed, 22 insertions, 6 deletions
diff --git a/test/kdm_test.cc b/test/kdm_test.cc
index ce589a8c..5b0ae622 100644
--- a/test/kdm_test.cc
+++ b/test/kdm_test.cc
@@ -31,21 +31,26 @@
files in the program, then also delete it here.
*/
-#include "encrypted_kdm.h"
-#include "decrypted_kdm.h"
+
#include "certificate_chain.h"
-#include "util.h"
-#include "test.h"
#include "cpl.h"
+#include "decrypted_kdm.h"
+#include "encrypted_kdm.h"
#include "mono_picture_asset.h"
-#include "reel_mono_picture_asset.h"
+#include "picture_asset_writer.h"
#include "reel.h"
+#include "reel_mono_picture_asset.h"
+#include "test.h"
#include "types.h"
-#include "picture_asset_writer.h"
+#include "util.h"
+#include "warnings.h"
#include <libcxml/cxml.h>
+LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
+LIBDCP_ENABLE_WARNINGS
#include <boost/test/unit_test.hpp>
+
using std::list;
using std::string;
using std::vector;
@@ -53,6 +58,7 @@ using std::make_shared;
using std::shared_ptr;
using boost::optional;
+
/** Check reading and decryption of a KDM */
BOOST_AUTO_TEST_CASE (kdm_test)
{
@@ -76,6 +82,7 @@ BOOST_AUTO_TEST_CASE (kdm_test)
BOOST_CHECK_EQUAL (keys.back().key().hex(), "5327fb7ec2e807bd57059615bf8a169d");
}
+
/** Check that we can read in a KDM and then write it back out again the same */
BOOST_AUTO_TEST_CASE (kdm_passthrough_test)
{
@@ -94,6 +101,7 @@ BOOST_AUTO_TEST_CASE (kdm_passthrough_test)
);
}
+
/** Test some of the utility methods of DecryptedKDM */
BOOST_AUTO_TEST_CASE (decrypted_kdm_test)
{
@@ -124,6 +132,7 @@ BOOST_AUTO_TEST_CASE (decrypted_kdm_test)
delete[] data;
}
+
/** Check that <KeyType> tags have the scope attribute.
* Wolfgang Woehl believes this is compulsory and I am more-or-less inclined to agree.
*/
@@ -149,6 +158,7 @@ BOOST_AUTO_TEST_CASE (kdm_key_type_scope)
}
}
+
static cxml::ConstNodePtr
kdm_forensic_test (cxml::Document& doc, bool picture, optional<int> audio)
{
@@ -177,6 +187,7 @@ kdm_forensic_test (cxml::Document& doc, bool picture, optional<int> audio)
optional_node_child("ForensicMarkFlagList");
}
+
/** Check ForensicMarkFlagList handling: disable picture and all audio */
BOOST_AUTO_TEST_CASE (kdm_forensic_test1)
{
@@ -189,6 +200,7 @@ BOOST_AUTO_TEST_CASE (kdm_forensic_test1)
BOOST_CHECK_EQUAL (flags.back()->content(), "http://www.smpte-ra.org/430-1/2006/KDM#mrkflg-audio-disable");
}
+
/** Check ForensicMarkFlagList handling: disable picture but not audio */
BOOST_AUTO_TEST_CASE (kdm_forensic_test2)
{
@@ -200,6 +212,7 @@ BOOST_AUTO_TEST_CASE (kdm_forensic_test2)
BOOST_CHECK_EQUAL (flags.front()->content(), "http://www.smpte-ra.org/430-1/2006/KDM#mrkflg-picture-disable");
}
+
/** Check ForensicMarkFlagList handling: disable audio but not picture */
BOOST_AUTO_TEST_CASE (kdm_forensic_test3)
{
@@ -211,6 +224,7 @@ BOOST_AUTO_TEST_CASE (kdm_forensic_test3)
BOOST_CHECK_EQUAL (flags.front()->content(), "http://www.smpte-ra.org/430-1/2006/KDM#mrkflg-audio-disable");
}
+
/** Check ForensicMarkFlagList handling: disable picture and audio above channel 3 */
BOOST_AUTO_TEST_CASE (kdm_forensic_test4)
{
@@ -223,6 +237,7 @@ BOOST_AUTO_TEST_CASE (kdm_forensic_test4)
BOOST_CHECK_EQUAL (flags.back()->content(), "http://www.smpte-ra.org/430-1/2006/KDM#mrkflg-audio-disable-above-channel-3");
}
+
/** Check ForensicMarkFlagList handling: disable neither */
BOOST_AUTO_TEST_CASE (kdm_forensic_test5)
{
@@ -231,6 +246,7 @@ BOOST_AUTO_TEST_CASE (kdm_forensic_test5)
BOOST_CHECK (!forensic);
}
+
/** Check that KDM validity periods are checked for being within the certificate validity */
BOOST_AUTO_TEST_CASE (validity_period_test1)
{