summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-08-08 15:16:35 +0200
committerCarl Hetherington <cth@carlh.net>2023-08-09 00:42:59 +0200
commit5b11c3b09a0fae96d047c4621e67a89c44f7c25a (patch)
treed9129497fb8fc3c8c187b7d78dd9ee510da07ffd
parent862524f04f5ac9e776fd08fb89b3c435d6fb6246 (diff)
Add a test.
-rw-r--r--test/film_test.cc47
-rw-r--r--test/wscript1
2 files changed, 48 insertions, 0 deletions
diff --git a/test/film_test.cc b/test/film_test.cc
new file mode 100644
index 000000000..475fb6d8b
--- /dev/null
+++ b/test/film_test.cc
@@ -0,0 +1,47 @@
+/*
+ Copyright (C) 2023 Carl Hetherington <cth@carlh.net>
+
+ This file is part of DCP-o-matic.
+
+ DCP-o-matic 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.
+
+ DCP-o-matic 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 DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+
+#include "lib/content_factory.h"
+#include "lib/film.h"
+#include "test.h"
+#include <boost/test/unit_test.hpp>
+
+
+BOOST_AUTO_TEST_CASE(film_contains_atmos_content_test)
+{
+ auto atmos = content_factory("test/data/atmos_0.mxf")[0];
+ auto image = content_factory("test/data/flat_red.png")[0];
+ auto sound = content_factory("test/data/white.wav")[0];
+
+ auto film1 = new_test_film2("film_contains_atmos_content_test1", { atmos, image, sound });
+ BOOST_CHECK(film1->contains_atmos_content());
+
+ auto film2 = new_test_film2("film_contains_atmos_content_test2", { sound, atmos, image });
+ BOOST_CHECK(film2->contains_atmos_content());
+
+ auto film3 = new_test_film2("film_contains_atmos_content_test3", { image, sound, atmos });
+ BOOST_CHECK(film3->contains_atmos_content());
+
+ auto film4 = new_test_film2("film_contains_atmos_content_test4", { image, sound });
+ BOOST_CHECK(!film4->contains_atmos_content());
+
+}
+
diff --git a/test/wscript b/test/wscript
index e1c12f89d..ccace40e7 100644
--- a/test/wscript
+++ b/test/wscript
@@ -94,6 +94,7 @@ def build(bld):
file_group_test.cc
file_log_test.cc
file_naming_test.cc
+ film_test.cc
film_metadata_test.cc
find_missing_test.cc
font_comparator_test.cc