summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-07-31 00:15:14 +0100
committerCarl Hetherington <cth@carlh.net>2012-07-31 00:15:14 +0100
commitb3ae1623ed44ade680236b4af283543083bceea3 (patch)
tree355c832b0517932f5db0f98a6b77746bfd692f45
parentd8c9cbec9d87f28da338350880b7618b94f4da81 (diff)
Basic test.
-rw-r--r--src/dcp.h16
-rw-r--r--test/tests.cc12
2 files changed, 28 insertions, 0 deletions
diff --git a/src/dcp.h b/src/dcp.h
index 8c13c505..900a5665 100644
--- a/src/dcp.h
+++ b/src/dcp.h
@@ -90,6 +90,22 @@ public:
*/
void write_xml () const;
+ std::string name () const {
+ return _name;
+ }
+
+ ContentKind content_kind () const {
+ return _content_kind;
+ }
+
+ int frames_per_second () const {
+ return _fps;
+ }
+
+ int length () const {
+ return _length;
+ }
+
/** Emitted with a parameter between 0 and 1 to indicate progress
* for long jobs.
*/
diff --git a/test/tests.cc b/test/tests.cc
index 7e470f3e..39528c62 100644
--- a/test/tests.cc
+++ b/test/tests.cc
@@ -74,3 +74,15 @@ BOOST_AUTO_TEST_CASE (error_test)
BOOST_CHECK_THROW (d.add_picture_asset (p, 32, 32), libdcp::FileError);
BOOST_CHECK_THROW (d.add_sound_asset (p), libdcp::FileError);
}
+
+BOOST_AUTO_TEST_CASE (read_dcp)
+{
+ libdcp::DCP d ("test/ref/DCP");
+
+ BOOST_CHECK_EQUAL (d.name(), "A Test DCP");
+ BOOST_CHECK_EQUAL (d.content_kind(), libdcp::FEATURE);
+ BOOST_CHECK_EQUAL (d.frames_per_second(), 24);
+ BOOST_CHECK_EQUAL (d.length(), 24);
+}
+
+