Comments.
[libdcp.git] / test / kdm_test.cc
index 7de62f5a2aac9290b68ae96ed0ea394c99dd4f15..4051a44ada972639bddb78883903cd37a9705b15 100644 (file)
 #include <libxml++/libxml++.h>
 #include "encrypted_kdm.h"
 #include "decrypted_kdm.h"
+#include "util.h"
 
 using std::list;
 using std::stringstream;
 using boost::shared_ptr;
 
+/** Check reading and decryption of a KDM */
 BOOST_AUTO_TEST_CASE (kdm_test)
 {
        dcp::DecryptedKDM kdm (
-               dcp::EncryptedKDM ("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::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")
                );
 
        list<dcp::DecryptedKDMKey> keys = kdm.keys ();
@@ -46,11 +50,11 @@ 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 */
+/** Check that we can read in a KDM and then write it back out again the same */
 BOOST_AUTO_TEST_CASE (kdm_passthrough_test)
 {
        dcp::EncryptedKDM kdm (
-               "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/kdm_TONEPLATES-SMPTE-ENC_.smpte-430-2.ROOT.NOT_FOR_PRODUCTION_20130706_20230702_CAR_OV_t1_8971c838.xml")
                );
 
        shared_ptr<xmlpp::DomParser> parser (new xmlpp::DomParser ());