Examine gcov result for all test programs.
[libdcp.git] / test / decryption_test.cc
index 8dfeffa658d36a3e498345cb01c3cb65454e1bb2..d9170daaf0c2253c9bfb8816d59d668546aff1c1 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
 
     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
 */
 
 #include <boost/test/unit_test.hpp>
-#include "kdm.h"
 #include "dcp.h"
 #include "mono_picture_frame.h"
 #include "cpl.h"
+#include "decrypted_kdm.h"
+#include "encrypted_kdm.h"
 #include "argb_frame.h"
 #include "mono_picture_mxf.h"
 #include "reel_picture_asset.h"
@@ -58,11 +59,13 @@ BOOST_AUTO_TEST_CASE (decryption_test)
        encrypted.read ();
        BOOST_CHECK_EQUAL (encrypted.encrypted (), true);
 
-       dcp::KDM kdm (
-               "test/data/kdm_TONEPLATES-SMPTE-ENC_.smpte-430-2.ROOT.NOT_FOR_PRODUCTION_20130706_20230702_CAR_OV_t1_8971c838.xml",
-               "test/data/private.key"
+       dcp::DecryptedKDM kdm (
+               dcp::EncryptedKDM (
+                       dcp::file_to_string ("test/data/kdm_TONEPLATES-SMPTE-ENC_.smpte-430-2.ROOT.NOT_FOR_PRODUCTION_20130706_20230702_CAR_OV_t1_8971c838.xml")
+                       ),
+               dcp::file_to_string ("test/data/private.key")
                );
-
+       
        encrypted.add (kdm);
 
        shared_ptr<const dcp::ARGBFrame> plaintext_frame = get_frame (plaintext);
@@ -78,8 +81,8 @@ BOOST_AUTO_TEST_CASE (decryption_test)
 /** Load in a KDM that didn't work at first */
 BOOST_AUTO_TEST_CASE (failing_kdm_test)
 {
-       dcp::KDM kdm (
-               "test/data/target.pem.crt.de5d4eba-e683-41ca-bdda-aa4ad96af3f4.kdm.xml",
-               "test/data/private.key"
+       dcp::DecryptedKDM kdm (
+               dcp::EncryptedKDM (dcp::file_to_string ("test/data/target.pem.crt.de5d4eba-e683-41ca-bdda-aa4ad96af3f4.kdm.xml")),
+               dcp::file_to_string ("test/data/private.key")
                );
 }