Basic test.
authorCarl Hetherington <cth@carlh.net>
Mon, 30 Jul 2012 23:15:14 +0000 (00:15 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 30 Jul 2012 23:15:14 +0000 (00:15 +0100)
src/dcp.h
test/tests.cc

index 8c13c50502cde71d4fbc4e80f4095add858a3cce..900a5665a52554ab659f7ec15c0d49da03153543 100644 (file)
--- 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.
         */
index 7e470f3e3c5b3d40a955e1828de5cf5dcc03581a..39528c6257f2f7a86b690bda127424b8d3f5e580 100644 (file)
@@ -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);
+}
+       
+