summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-06-08 09:55:20 +0100
committerCarl Hetherington <cth@carlh.net>2015-06-08 09:55:20 +0100
commit3ac1487997a968278c69728bd5eaa5dcf03b66ca (patch)
treedd487956bfe7458826ae7b23e8c8c30f8091bfac
parent331b2f8297b2b8a6db07a22dbbff7f913fe7a2f1 (diff)
Some comments and test tweaks.
-rw-r--r--src/load_font_node.h2
-rw-r--r--test/certificates_test.cc1
-rw-r--r--test/colour_conversion_test.cc2
-rw-r--r--test/colour_test.cc2
-rw-r--r--test/cpl_sar_test.cc6
-rw-r--r--test/encryption_test.cc6
-rw-r--r--test/exception_test.cc1
-rw-r--r--test/fraction_test.cc1
-rw-r--r--test/interop_load_font_test.cc2
-rw-r--r--test/kdm_test.cc3
-rw-r--r--test/read_dcp_test.cc2
-rw-r--r--test/read_subtitle_test.cc14
-rw-r--r--test/recovery_test.cc2
-rw-r--r--test/rewrite_subs.cc1
-rw-r--r--test/round_trip_test.cc2
-rw-r--r--test/smpte_load_font_test.cc1
16 files changed, 36 insertions, 12 deletions
diff --git a/src/load_font_node.h b/src/load_font_node.h
index 58e5920a..3ff70497 100644
--- a/src/load_font_node.h
+++ b/src/load_font_node.h
@@ -35,6 +35,8 @@ public:
LoadFontNode (std::string id_)
: id (id_)
{}
+
+ virtual ~LoadFontNode () {}
std::string id;
};
diff --git a/test/certificates_test.cc b/test/certificates_test.cc
index dc08a193..374dbc13 100644
--- a/test/certificates_test.cc
+++ b/test/certificates_test.cc
@@ -26,6 +26,7 @@ using std::list;
using std::string;
using boost::shared_ptr;
+/** Check that loading certificates from files via strings works */
BOOST_AUTO_TEST_CASE (certificates)
{
dcp::CertificateChain c;
diff --git a/test/colour_conversion_test.cc b/test/colour_conversion_test.cc
index 2eb5edf5..7ff93468 100644
--- a/test/colour_conversion_test.cc
+++ b/test/colour_conversion_test.cc
@@ -54,6 +54,7 @@ check_modified_gamma (shared_ptr<const TransferFunction> tf, int bit_depth, bool
}
}
+/** Check that the gamma correction LUTs are right for sRGB */
BOOST_AUTO_TEST_CASE (colour_conversion_test1)
{
ColourConversion cc = ColourConversion::srgb_to_xyz ();
@@ -67,6 +68,7 @@ BOOST_AUTO_TEST_CASE (colour_conversion_test1)
check_gamma (cc.out(), 16, true, 1 / 2.6);
}
+/** Check that the gamma correction LUTs are right for REC709 */
BOOST_AUTO_TEST_CASE (colour_conversion_test2)
{
ColourConversion cc = ColourConversion::rec709_to_xyz ();
diff --git a/test/colour_test.cc b/test/colour_test.cc
index f2be8ead..cebe95ab 100644
--- a/test/colour_test.cc
+++ b/test/colour_test.cc
@@ -23,7 +23,7 @@
using std::stringstream;
-/* Check that dcp::Colour works */
+/** Check that dcp::Colour works */
BOOST_AUTO_TEST_CASE (colour)
{
dcp::Colour z;
diff --git a/test/cpl_sar_test.cc b/test/cpl_sar_test.cc
index 691439db..cafa589f 100644
--- a/test/cpl_sar_test.cc
+++ b/test/cpl_sar_test.cc
@@ -25,9 +25,9 @@
using boost::shared_ptr;
-/* Test for a reported bug where <ScreenAspectRatio> in Interop files uses
- excessive decimal places and (sometimes) the wrong decimal point character.
-*/
+/** Test for a reported bug where <ScreenAspectRatio> in Interop files uses
+ * excessive decimal places and (sometimes) the wrong decimal point character.
+ */
BOOST_AUTO_TEST_CASE (cpl_sar)
{
shared_ptr<dcp::ReelMonoPictureAsset> pa (
diff --git a/test/encryption_test.cc b/test/encryption_test.cc
index 299e5f9b..d09f04bd 100644
--- a/test/encryption_test.cc
+++ b/test/encryption_test.cc
@@ -41,9 +41,9 @@
using boost::shared_ptr;
-/* Load a certificate chain from build/test/data/ *.pem and then build
- an encrypted DCP and a KDM using it.
-*/
+/** Load a certificate chain from build/test/data/ *.pem and then build
+ * an encrypted DCP and a KDM using it.
+ */
BOOST_AUTO_TEST_CASE (encryption_test)
{
boost::filesystem::remove_all ("build/test/signer");
diff --git a/test/exception_test.cc b/test/exception_test.cc
index 740154dd..dd9608ee 100644
--- a/test/exception_test.cc
+++ b/test/exception_test.cc
@@ -22,6 +22,7 @@
using std::string;
+/** Test exception classes */
BOOST_AUTO_TEST_CASE (exception_test)
{
BOOST_CHECK_EQUAL (string (dcp::FileError ("foo", "bar", 42).what()), "foo (bar) (error 42)");
diff --git a/test/fraction_test.cc b/test/fraction_test.cc
index 445805d1..efdba664 100644
--- a/test/fraction_test.cc
+++ b/test/fraction_test.cc
@@ -21,6 +21,7 @@
#include "exceptions.h"
#include <boost/test/unit_test.hpp>
+/** Test dcp::Fraction */
BOOST_AUTO_TEST_CASE (fraction_test)
{
dcp::Fraction f (42, 26);
diff --git a/test/interop_load_font_test.cc b/test/interop_load_font_test.cc
index 9940c5e0..04520080 100644
--- a/test/interop_load_font_test.cc
+++ b/test/interop_load_font_test.cc
@@ -22,6 +22,7 @@
#include <libxml++/libxml++.h>
#include <boost/test/unit_test.hpp>
+/** Test dcp::InteropLoadFont's simple constructor */
BOOST_AUTO_TEST_CASE (interop_load_font_test1)
{
dcp::InteropLoadFontNode lf ("my-great-id", "my-great-uri");
@@ -29,6 +30,7 @@ BOOST_AUTO_TEST_CASE (interop_load_font_test1)
BOOST_CHECK_EQUAL (lf.uri, "my-great-uri");
}
+/** Test dcp::InteropLoadFont's XML constructor */
BOOST_AUTO_TEST_CASE (interop_load_font_test2)
{
xmlpp::Document doc;
diff --git a/test/kdm_test.cc b/test/kdm_test.cc
index c2d40b3b..4051a44a 100644
--- a/test/kdm_test.cc
+++ b/test/kdm_test.cc
@@ -27,6 +27,7 @@ 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 (
@@ -49,7 +50,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 */
+/** 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 (
diff --git a/test/read_dcp_test.cc b/test/read_dcp_test.cc
index 6aed62a4..097d0aa9 100644
--- a/test/read_dcp_test.cc
+++ b/test/read_dcp_test.cc
@@ -24,7 +24,7 @@
using std::list;
using boost::shared_ptr;
-/* Read DCP that is in git and make sure that basic stuff is read in correctly */
+/** Read DCP that is in git and make sure that basic stuff is read in correctly */
BOOST_AUTO_TEST_CASE (read_dcp)
{
dcp::DCP d ("test/ref/DCP/dcp_test1");
diff --git a/test/read_subtitle_test.cc b/test/read_subtitle_test.cc
index c49ddfdf..4b2046a1 100644
--- a/test/read_subtitle_test.cc
+++ b/test/read_subtitle_test.cc
@@ -18,20 +18,32 @@
*/
#include "interop_subtitle_asset.h"
+#include "interop_load_font_node.h"
#include "subtitle_string.h"
#include <boost/test/unit_test.hpp>
using std::list;
using std::string;
using boost::shared_ptr;
+using boost::dynamic_pointer_cast;
-/* Load some subtitle content from XML and check that it is read correctly */
+/** Load some subtitle content from Interop XML and check that it is read correctly */
BOOST_AUTO_TEST_CASE (read_subtitle_test1)
{
dcp::InteropSubtitleAsset subs ("test/data/subs1.xml");
+ BOOST_CHECK_EQUAL (subs.id(), "cab5c268-222b-41d2-88ae-6d6999441b17");
+ BOOST_CHECK_EQUAL (subs.movie_title(), "Movie Title");
+ BOOST_CHECK_EQUAL (subs.reel_number(), "1");
BOOST_CHECK_EQUAL (subs.language(), "French");
+ list<shared_ptr<dcp::LoadFontNode> > lfn = subs.load_font_nodes ();
+ BOOST_REQUIRE_EQUAL (lfn.size(), 1);
+ shared_ptr<dcp::InteropLoadFontNode> interop_lfn = dynamic_pointer_cast<dcp::InteropLoadFontNode> (lfn.front ());
+ BOOST_REQUIRE (interop_lfn);
+ BOOST_CHECK_EQUAL (interop_lfn->id, "theFontId");
+ BOOST_CHECK_EQUAL (interop_lfn->uri, "arial.ttf");
+
list<dcp::SubtitleString> s = subs.subtitles_during (dcp::Time (0, 0, 6, 1, 250), dcp::Time (0, 0, 6, 2, 250));
BOOST_REQUIRE_EQUAL (s.size(), 1);
BOOST_CHECK_EQUAL (s.front(), dcp::SubtitleString (
diff --git a/test/recovery_test.cc b/test/recovery_test.cc
index 257c512d..754a49e2 100644
--- a/test/recovery_test.cc
+++ b/test/recovery_test.cc
@@ -26,7 +26,7 @@
using std::string;
using boost::shared_ptr;
-/* Check that recovery from a partially-written MXF works */
+/** Check that recovery from a partially-written MXF works */
BOOST_AUTO_TEST_CASE (recovery)
{
Kumu::libdcp_test = true;
diff --git a/test/rewrite_subs.cc b/test/rewrite_subs.cc
index 5bfe126f..6aa259a9 100644
--- a/test/rewrite_subs.cc
+++ b/test/rewrite_subs.cc
@@ -32,6 +32,7 @@ using std::string;
using boost::shared_ptr;
using namespace dcp;
+/** Load a DCP then re-write its subtitle XML or MXF in-place */
int
main (int argc, char* argv[])
{
diff --git a/test/round_trip_test.cc b/test/round_trip_test.cc
index a719ff45..39db697b 100644
--- a/test/round_trip_test.cc
+++ b/test/round_trip_test.cc
@@ -43,7 +43,7 @@ using std::list;
using boost::shared_ptr;
using boost::scoped_array;
-/* Build an encrypted picture asset and a KDM for it and check that the KDM can be decrypted */
+/** Build an encrypted picture asset and a KDM for it and check that the KDM can be decrypted */
BOOST_AUTO_TEST_CASE (round_trip_test)
{
shared_ptr<dcp::Signer> signer (new dcp::Signer ("openssl"));
diff --git a/test/smpte_load_font_test.cc b/test/smpte_load_font_test.cc
index 77020b98..da52ed97 100644
--- a/test/smpte_load_font_test.cc
+++ b/test/smpte_load_font_test.cc
@@ -22,6 +22,7 @@
#include <libxml++/libxml++.h>
#include <boost/test/unit_test.hpp>
+/** Test dcp::SMPTELoadFontNode */
BOOST_AUTO_TEST_CASE (smpte_load_font_test1)
{
xmlpp::Document doc;