From 2ed09754ce80e30bb5e44766752e354543d7418a Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 14 Jan 2014 22:29:42 +0000 Subject: Add test for bad ScreenAspectRatio tags in Interop. --- test/cpl_sar.cc | 40 ++++++++++++++++++++++++++++++++++++++++ test/wscript | 1 + 2 files changed, 41 insertions(+) create mode 100644 test/cpl_sar.cc diff --git a/test/cpl_sar.cc b/test/cpl_sar.cc new file mode 100644 index 00000000..064d9510 --- /dev/null +++ b/test/cpl_sar.cc @@ -0,0 +1,40 @@ +/* + Copyright (C) 2014 Carl Hetherington + + 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 +#include +#include "cpl.h" +#include "mono_picture_asset.h" + +using boost::shared_ptr; + +/* Test for a reported bug where in Interop files uses + excessive decimal places and (sometimes) the wrong decimal point character. +*/ +BOOST_AUTO_TEST_CASE (cpl_sar) +{ + shared_ptr mp (new libdcp::MonoPictureAsset ("build/test/foo", "video.mxf")); + mp->set_size (libdcp::Size (1998, 1080)); + xmlpp::Document doc; + xmlpp::Element* el = doc.create_root_node ("Test"); + mp->write_to_cpl (el, true); + + cxml::Node node (el); + BOOST_CHECK_EQUAL (node.node_child("MainPicture")->string_child ("ScreenAspectRatio"), "1.85"); +} diff --git a/test/wscript b/test/wscript index 23469203..7bb68252 100644 --- a/test/wscript +++ b/test/wscript @@ -23,6 +23,7 @@ def build(bld): obj.source = """ certificates_test.cc color_test.cc + cpl_sar.cc dcp_test.cc dcp_time_test.cc decryption_test.cc -- cgit v1.2.3