diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-04-14 01:00:05 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-04-14 01:00:05 +0200 |
| commit | 274dd30f2b11fe8ea563a2ac7436c9d463865b0b (patch) | |
| tree | 199e7447606339d461f6f87d16095376d8f809b3 /test/cpl_sar_test.cc | |
| parent | 4bd57fbbac67ac04ec47a9765b9f278aa1691851 (diff) | |
Fix/hide some warnings.
Diffstat (limited to 'test/cpl_sar_test.cc')
| -rw-r--r-- | test/cpl_sar_test.cc | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/test/cpl_sar_test.cc b/test/cpl_sar_test.cc index 65f01900..1bf53686 100644 --- a/test/cpl_sar_test.cc +++ b/test/cpl_sar_test.cc @@ -31,13 +31,18 @@ files in the program, then also delete it here. */ + #include "cpl.h" -#include "reel_mono_picture_asset.h" #include "mono_picture_asset.h" +#include "reel_mono_picture_asset.h" +#include "warnings.h" #include <libcxml/cxml.h> +LIBDCP_DISABLE_WARNINGS #include <libxml++/libxml++.h> +LIBDCP_ENABLE_WARNINGS #include <boost/test/unit_test.hpp> + using std::string; using std::shared_ptr; using std::make_shared; @@ -47,13 +52,14 @@ check (shared_ptr<dcp::ReelMonoPictureAsset> pa, dcp::Fraction far, string sar) { pa->set_screen_aspect_ratio (far); xmlpp::Document doc; - xmlpp::Element* el = doc.create_root_node ("Test"); + auto el = doc.create_root_node ("Test"); pa->write_to_cpl (el, dcp::Standard::INTEROP); cxml::Node node (el); BOOST_CHECK_EQUAL (node.node_child("MainPicture")->string_child ("ScreenAspectRatio"), sar); } + /** Test for a reported bug where <ScreenAspectRatio> in Interop files uses * excessive decimal places and (sometimes) the wrong decimal point character. * Also check that we correctly use one of the allowed <ScreenAspectRatio> @@ -66,38 +72,38 @@ BOOST_AUTO_TEST_CASE (cpl_sar) ); /* Easy ones */ - check (pa, dcp::Fraction (1998, 1080), "1.85"); - check (pa, dcp::Fraction (2048, 858), "2.39"); + check (pa, dcp::Fraction(1998, 1080), "1.85"); + check (pa, dcp::Fraction(2048, 858), "2.39"); /* Check the use of the allowed values */ /* Just less then, equal to and just more than 1.33 */ - check (pa, dcp::Fraction (1200, 1000), "1.33"); - check (pa, dcp::Fraction (1330, 1000), "1.33"); - check (pa, dcp::Fraction (1430, 1000), "1.33"); + check (pa, dcp::Fraction(1200, 1000), "1.33"); + check (pa, dcp::Fraction(1330, 1000), "1.33"); + check (pa, dcp::Fraction(1430, 1000), "1.33"); /* Same for 1.66 */ - check (pa, dcp::Fraction (1600, 1000), "1.66"); - check (pa, dcp::Fraction (1660, 1000), "1.66"); - check (pa, dcp::Fraction (1670, 1000), "1.66"); + check (pa, dcp::Fraction(1600, 1000), "1.66"); + check (pa, dcp::Fraction(1660, 1000), "1.66"); + check (pa, dcp::Fraction(1670, 1000), "1.66"); /* 1.77 */ - check (pa, dcp::Fraction (1750, 1000), "1.77"); - check (pa, dcp::Fraction (1770, 1000), "1.77"); - check (pa, dcp::Fraction (1800, 1000), "1.77"); + check (pa, dcp::Fraction(1750, 1000), "1.77"); + check (pa, dcp::Fraction(1770, 1000), "1.77"); + check (pa, dcp::Fraction(1800, 1000), "1.77"); /* 1.85 */ - check (pa, dcp::Fraction (1820, 1000), "1.85"); - check (pa, dcp::Fraction (1850, 1000), "1.85"); - check (pa, dcp::Fraction (1910, 1000), "1.85"); + check (pa, dcp::Fraction(1820, 1000), "1.85"); + check (pa, dcp::Fraction(1850, 1000), "1.85"); + check (pa, dcp::Fraction(1910, 1000), "1.85"); /* 2.00 */ - check (pa, dcp::Fraction (1999, 1000), "2.00"); - check (pa, dcp::Fraction (2000, 1000), "2.00"); - check (pa, dcp::Fraction (2001, 1000), "2.00"); + check (pa, dcp::Fraction(1999, 1000), "2.00"); + check (pa, dcp::Fraction(2000, 1000), "2.00"); + check (pa, dcp::Fraction(2001, 1000), "2.00"); /* 2.39 */ - check (pa, dcp::Fraction (2350, 1000), "2.39"); - check (pa, dcp::Fraction (2390, 1000), "2.39"); - check (pa, dcp::Fraction (2500, 1000), "2.39"); + check (pa, dcp::Fraction(2350, 1000), "2.39"); + check (pa, dcp::Fraction(2390, 1000), "2.39"); + check (pa, dcp::Fraction(2500, 1000), "2.39"); } |
