summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-05-28 16:12:44 +0100
committerCarl Hetherington <cth@carlh.net>2013-05-28 16:12:44 +0100
commit706201707778567317c0d023b04be9836fbf77bf (patch)
tree8afa5ba0364bcb6dd7c1e80b6e7d13d8e0d3bbb9 /test
parentd35fa85babb471650e3f5fa7c11b2149c1db91c1 (diff)
Remove DCP-specialism from Container and add tests for it.
Diffstat (limited to 'test')
-rw-r--r--test/container_test.cc73
-rw-r--r--test/test.cc1
2 files changed, 74 insertions, 0 deletions
diff --git a/test/container_test.cc b/test/container_test.cc
new file mode 100644
index 000000000..825a8cdc4
--- /dev/null
+++ b/test/container_test.cc
@@ -0,0 +1,73 @@
+/*
+ Copyright (C) 2012 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.
+
+*/
+
+using std::ostream;
+
+namespace libdcp {
+
+ostream&
+operator<< (ostream& s, libdcp::Size const & t)
+{
+ s << t.width << "x" << t.height;
+ return s;
+}
+
+}
+
+BOOST_AUTO_TEST_CASE (container_test)
+{
+ Container::setup_containers ();
+
+ Container const * c = Container::from_id ("119");
+ BOOST_CHECK (c);
+ BOOST_CHECK_EQUAL (c->size(libdcp::Size (2048, 1080)), libdcp::Size (1285, 1080));
+
+ c = Container::from_id ("133");
+ BOOST_CHECK (c);
+ BOOST_CHECK_EQUAL (c->size(libdcp::Size (2048, 1080)), libdcp::Size (1436, 1080));
+
+ c = Container::from_id ("137");
+ BOOST_CHECK (c);
+ BOOST_CHECK_EQUAL (c->size(libdcp::Size (2048, 1080)), libdcp::Size (1480, 1080));
+
+ c = Container::from_id ("138");
+ BOOST_CHECK (c);
+ BOOST_CHECK_EQUAL (c->size(libdcp::Size (2048, 1080)), libdcp::Size (1485, 1080));
+
+ c = Container::from_id ("166");
+ BOOST_CHECK (c);
+ BOOST_CHECK_EQUAL (c->size(libdcp::Size (2048, 1080)), libdcp::Size (1793, 1080));
+
+ c = Container::from_id ("178");
+ BOOST_CHECK (c);
+ BOOST_CHECK_EQUAL (c->size(libdcp::Size (2048, 1080)), libdcp::Size (1920, 1080));
+
+ c = Container::from_id ("185");
+ BOOST_CHECK (c);
+ BOOST_CHECK_EQUAL (c->size(libdcp::Size (2048, 1080)), libdcp::Size (1998, 1080));
+
+ c = Container::from_id ("239");
+ BOOST_CHECK (c);
+ BOOST_CHECK_EQUAL (c->size(libdcp::Size (2048, 1080)), libdcp::Size (2048, 858));
+
+ c = Container::from_id ("full-frame");
+ BOOST_CHECK (c);
+ BOOST_CHECK_EQUAL (c->size(libdcp::Size (2048, 1080)), libdcp::Size (2048, 1080));
+}
+
diff --git a/test/test.cc b/test/test.cc
index 7e2715a02..f7e2b2e82 100644
--- a/test/test.cc
+++ b/test/test.cc
@@ -93,6 +93,7 @@ new_test_film (string name)
return f;
}
+#include "container_test.cc"
#include "pixel_formats_test.cc"
#include "make_black_test.cc"
#include "film_metadata_test.cc"