From 214c3093f7e985cde610457fae9e1f97068efde5 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 11 Dec 2022 22:27:34 +0100 Subject: Be explicit about the version of SMPTE 428-7 that is used for subtitles, and default to writing the 2014 namespace. --- test/data/2007.mxf | Bin 0 -> 17297 bytes test/data/2010.mxf | Bin 0 -> 17297 bytes test/data/2014.mxf | Bin 0 -> 17297 bytes test/smpte_subtitle_test.cc | 40 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 40 insertions(+) create mode 100644 test/data/2007.mxf create mode 100644 test/data/2010.mxf create mode 100644 test/data/2014.mxf (limited to 'test') diff --git a/test/data/2007.mxf b/test/data/2007.mxf new file mode 100644 index 00000000..3cdf4861 Binary files /dev/null and b/test/data/2007.mxf differ diff --git a/test/data/2010.mxf b/test/data/2010.mxf new file mode 100644 index 00000000..1d1b8554 Binary files /dev/null and b/test/data/2010.mxf differ diff --git a/test/data/2014.mxf b/test/data/2014.mxf new file mode 100644 index 00000000..63622640 Binary files /dev/null and b/test/data/2014.mxf differ diff --git a/test/smpte_subtitle_test.cc b/test/smpte_subtitle_test.cc index f8412daa..a23a7c45 100644 --- a/test/smpte_subtitle_test.cc +++ b/test/smpte_subtitle_test.cc @@ -708,3 +708,43 @@ BOOST_AUTO_TEST_CASE (write_subtitles_in_vertical_order_with_bottom_alignment) ); } + +BOOST_AUTO_TEST_CASE(smpte_subtitle_standard_written_correctly) +{ + RNGFixer fixer; + + boost::filesystem::path const ref = "test/data"; + boost::filesystem::path const out = "build/test/smpte_subtitle_standard_written_correctly"; + + boost::filesystem::remove_all(out); + boost::filesystem::create_directories(out); + + dcp::SMPTESubtitleAsset test_2014; + test_2014.set_issue_date(dcp::LocalTime("2020-01-01T14:00:00")); + test_2014.write(out / "2014.mxf"); + check_file(ref / "2014.mxf", out / "2014.mxf"); + + dcp::SMPTESubtitleAsset test_2010(dcp::SubtitleStandard::SMPTE_2010); + test_2010.set_issue_date(dcp::LocalTime("2020-01-01T14:00:00")); + test_2010.write(out / "2010.mxf"); + check_file(ref / "2010.mxf", out / "2010.mxf"); + + dcp::SMPTESubtitleAsset test_2007(dcp::SubtitleStandard::SMPTE_2007); + test_2007.set_issue_date(dcp::LocalTime("2020-01-01T14:00:00")); + test_2007.write(out / "2007.mxf"); + check_file(ref / "2007.mxf", out / "2007.mxf"); +} + + +BOOST_AUTO_TEST_CASE(smpte_subtitle_standard_read_correctly) +{ + dcp::SMPTESubtitleAsset test_2007("test/data/2007.mxf"); + BOOST_CHECK(test_2007.subtitle_standard() == dcp::SubtitleStandard::SMPTE_2007); + + dcp::SMPTESubtitleAsset test_2010("test/data/2010.mxf"); + BOOST_CHECK(test_2010.subtitle_standard() == dcp::SubtitleStandard::SMPTE_2010); + + dcp::SMPTESubtitleAsset test_2014("test/data/2014.mxf"); + BOOST_CHECK(test_2014.subtitle_standard() == dcp::SubtitleStandard::SMPTE_2014); +} + -- cgit v1.2.3