summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-03-16 18:02:35 +0100
committerCarl Hetherington <cth@carlh.net>2024-03-16 18:02:40 +0100
commit6c11fdfda7a0f306f894b15b56b72d3c4898013d (patch)
tree54ef2103adc52a512a642b22deb3b2402d9fc1c1 /test
parentb395d79069cf64fd3a552fb843a31affa57662de (diff)
Allow SMPTE timecodes with 3 digits in the editable units field.
It seems that these should only be present if the timecode rate is 101 or above, and in that case all timecodes should have 3 editable rate digits, but someone sent a DCP from what seems to be EasyDCP Creator and it has one timecode of 00:05:01:000.
Diffstat (limited to 'test')
-rw-r--r--test/dcp_time_test.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/dcp_time_test.cc b/test/dcp_time_test.cc
index 4b529be6..3e0050b4 100644
--- a/test/dcp_time_test.cc
+++ b/test/dcp_time_test.cc
@@ -131,6 +131,11 @@ BOOST_AUTO_TEST_CASE (dcp_time)
/* SMPTE */
a = dcp::Time ("01:23:45:12", 250);
BOOST_CHECK_EQUAL (a, dcp::Time (1, 23, 45, 12, 250));
+ /* The editable units field can be any length (depending on the timecode rate)
+ * but in practice I think 3 is enough.
+ */
+ a = dcp::Time("00:05:01:519", 250);
+ BOOST_CHECK_EQUAL(a, dcp::Time(0, 5, 1, 519, 250));
/* Check some disallowed constructions from string */
BOOST_CHECK_THROW (dcp::Time ("01:23:45:1234", optional<int>()), dcp::ReadError);
@@ -145,7 +150,6 @@ BOOST_AUTO_TEST_CASE (dcp_time)
BOOST_CHECK_THROW (dcp::Time ("01:23:.123", optional<int>()), dcp::ReadError);
BOOST_CHECK_THROW (dcp::Time ("01::45.123", optional<int>()), dcp::ReadError);
BOOST_CHECK_THROW (dcp::Time (":23:45.123", optional<int>()), dcp::ReadError);
- BOOST_CHECK_THROW (dcp::Time ("01:23:45:123", 250), dcp::ReadError);
BOOST_CHECK_THROW (dcp::Time ("01:23:45:123:66", 250), dcp::ReadError);
BOOST_CHECK_THROW (dcp::Time ("01:23:45:", 250), dcp::ReadError);
BOOST_CHECK_THROW (dcp::Time ("01:23::123", 250), dcp::ReadError);