Supporters update.
[dcpomatic.git] / test / film_test.cc
index 02dfa05531b562f42bd10ecbb27934753ce72a9a..e8f04dc93453a537e2479c88bd30755c19ced165 100644 (file)
@@ -1,30 +1,46 @@
 /*
-    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2023 Carl Hetherington <cth@carlh.net>
 
-    This program is free software; you can redistribute it and/or modify
+    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.
 
-    This program is distributed in the hope that it will be useful,
+    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 this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
 
 */
 
-BOOST_AUTO_TEST_CASE (paths_test)
+
+#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)
 {
-       shared_ptr<Film> f = new_test_film ("paths_test");
-       f->set_directory ("build/test/a/b/c/d/e");
+       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());
 
-       f->_content = "/foo/bar/baz";
-       BOOST_CHECK_EQUAL (f->content_path(), "/foo/bar/baz");
-       f->_content = "foo/bar/baz";
-       BOOST_CHECK_EQUAL (f->content_path(), "build/test/a/b/c/d/e/foo/bar/baz");
+       auto film4 = new_test_film2("film_contains_atmos_content_test4", { image, sound });
+       BOOST_CHECK(!film4->contains_atmos_content());
 }