summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-12-04 20:11:29 +0000
committerCarl Hetherington <cth@carlh.net>2015-12-04 20:11:29 +0000
commit689d56339857b0a82156641f28392b8d2f11beea (patch)
tree9cb15585f2122c79d8b4a0a44fae830cee3eaa32 /test
parentfa2900fedac1030141c56b691c7f6e0f7e629424 (diff)
Fix incorrect reading of ScreenAspectRatio.
Diffstat (limited to 'test')
-rw-r--r--test/reel_asset_test.cc47
-rw-r--r--test/wscript1
2 files changed, 48 insertions, 0 deletions
diff --git a/test/reel_asset_test.cc b/test/reel_asset_test.cc
new file mode 100644
index 00000000..bdbd68ea
--- /dev/null
+++ b/test/reel_asset_test.cc
@@ -0,0 +1,47 @@
+/*
+ Copyright (C) 2015 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
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include "reel_mono_picture_asset.h"
+#include <libcxml/cxml.h>
+#include <boost/test/unit_test.hpp>
+
+using boost::shared_ptr;
+
+/** Test the XML constructor of ReelPictureAsset */
+BOOST_AUTO_TEST_CASE (reel_picture_asset_test)
+{
+ shared_ptr<cxml::Document> doc (new cxml::Document ("MainPicture"));
+
+ doc->read_string (
+ "<MainPicture>"
+ "<Id>urn:uuid:06ac1ca7-9c46-4107-8864-a6448e24b04b</Id>"
+ "<AnnotationText></AnnotationText>"
+ "<EditRate>24 1</EditRate>"
+ "<IntrinsicDuration>187048</IntrinsicDuration>"
+ "<EntryPoint>0</EntryPoint>"
+ "<Duration>187048</Duration>"
+ "<Hash>6EQX4NjG8vxIWhLUtHhrGSyLgOY=</Hash>"
+ "<FrameRate>24 1</FrameRate>"
+ "<ScreenAspectRatio>2048 858</ScreenAspectRatio>"
+ "</MainPicture>"
+ );
+
+ dcp::ReelMonoPictureAsset pa (doc);
+ BOOST_CHECK_EQUAL (pa.screen_aspect_ratio(), dcp::Fraction (2048, 858));
+}
diff --git a/test/wscript b/test/wscript
index 7e6e48ed..e10bef9d 100644
--- a/test/wscript
+++ b/test/wscript
@@ -48,6 +48,7 @@ def build(bld):
read_dcp_test.cc
read_interop_subtitle_test.cc
read_smpte_subtitle_test.cc
+ reel_asset_test.cc
recovery_test.cc
rgb_xyz_test.cc
round_trip_test.cc