X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Ffilm_test.cc;h=e8f04dc93453a537e2479c88bd30755c19ced165;hb=HEAD;hp=02dfa05531b562f42bd10ecbb27934753ce72a9a;hpb=5f0f0de782100a5cb558f30c7768c8af0c19bcb7;p=dcpomatic.git diff --git a/test/film_test.cc b/test/film_test.cc index 02dfa0553..e8f04dc93 100644 --- a/test/film_test.cc +++ b/test/film_test.cc @@ -1,30 +1,46 @@ /* - Copyright (C) 2012 Carl Hetherington + Copyright (C) 2023 Carl Hetherington - 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 . */ -BOOST_AUTO_TEST_CASE (paths_test) + +#include "lib/content_factory.h" +#include "lib/film.h" +#include "test.h" +#include + + +BOOST_AUTO_TEST_CASE(film_contains_atmos_content_test) { - shared_ptr 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()); }