summaryrefslogtreecommitdiff
path: root/test/open_caption_test.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-01-10 22:17:00 +0100
committerCarl Hetherington <cth@carlh.net>2025-01-12 02:05:06 +0100
commit5d9b8579950a4440b43a649c27fa36082144773d (patch)
tree97d30c04417b9b3e901c5cfc8fffed9d3bce8443 /test/open_caption_test.cc
parent08e5e4e27d9ac58050f9ebe77a5679157c0ee891 (diff)
Put open captions into subtitles and closed subtitles into captions.
We could write them separately (libdcp supports this, AFAIK) but the Deluxe guidelines suggest not to use ClosedSubtitle or MainCaption.
Diffstat (limited to 'test/open_caption_test.cc')
-rw-r--r--test/open_caption_test.cc46
1 files changed, 46 insertions, 0 deletions
diff --git a/test/open_caption_test.cc b/test/open_caption_test.cc
new file mode 100644
index 000000000..06b08c151
--- /dev/null
+++ b/test/open_caption_test.cc
@@ -0,0 +1,46 @@
+/*
+ Copyright (C) 2025 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/text_content.h"
+#include "test.h"
+#include <boost/test/unit_test.hpp>
+
+
+BOOST_AUTO_TEST_CASE(basic_open_caption_test)
+{
+ auto content = content_factory("test/data/15s.srt")[0];
+ auto film = new_test_film("basic_open_caption_test", { content });
+
+ content->text[0]->set_type(TextType::OPEN_CAPTION);
+
+ make_and_verify_dcp(
+ film,
+ {
+ dcp::VerificationNote::Code::MISSING_CPL_METADATA,
+ dcp::VerificationNote::Code::INVALID_SUBTITLE_FIRST_TEXT_TIME,
+ dcp::VerificationNote::Code::MISSING_SUBTITLE_LANGUAGE
+ }
+ );
+
+}
+