diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-07-10 16:15:13 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-07-10 16:15:13 +0100 |
| commit | 8c6e4c8e4f37450f44cb4ca9918406a6f2cc6055 (patch) | |
| tree | 3b77e87348a5048713520b65e306b25f040494c0 /test/dcp_subtitle_test.cc | |
| parent | 38164bf6e8095f8a8f852bd21877cfb90d204868 (diff) | |
Various fixes for DCP subtitles, and a test or two.
Diffstat (limited to 'test/dcp_subtitle_test.cc')
| -rw-r--r-- | test/dcp_subtitle_test.cc | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/test/dcp_subtitle_test.cc b/test/dcp_subtitle_test.cc new file mode 100644 index 000000000..95fa7d1ec --- /dev/null +++ b/test/dcp_subtitle_test.cc @@ -0,0 +1,46 @@ +/* + Copyright (C) 2014 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. + +*/ + +/** @file test/dcp_subtitle_test.cc + * @brief Test DCP subtitle content in various ways. + */ + +#include <boost/test/unit_test.hpp> +#include "lib/film.h" +#include "lib/dcp_subtitle_content.h" +#include "lib/ratio.h" +#include "lib/dcp_content_type.h" +#include "test.h" + +using std::cout; +using boost::shared_ptr; + +/** Test load of very simple DCP subtitle file */ +BOOST_AUTO_TEST_CASE (dcp_subtitle_test) +{ + shared_ptr<Film> film = new_test_film ("dcp_subtitle_test"); + film->set_container (Ratio::from_id ("185")); + film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); + film->set_name ("frobozz"); + shared_ptr<DCPSubtitleContent> content (new DCPSubtitleContent (film, "test/data/dcp_sub.xml")); + film->examine_and_add_content (content); + wait_for_jobs (); + + BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (2)); +} |
