DCPTime t = DCPTime::from_seconds (2 * 60 * 60 + 4 * 60 + 31) + DCPTime::from_frames (19, 24);
BOOST_CHECK_EQUAL (t.timecode (24), "02:04:31:19");
}
+
+BOOST_AUTO_TEST_CASE (seconds_to_approximate_hms_test)
+{
+ BOOST_CHECK_EQUAL (seconds_to_approximate_hms (1), "1s");
+ BOOST_CHECK_EQUAL (seconds_to_approximate_hms (2), "2s");
+ BOOST_CHECK_EQUAL (seconds_to_approximate_hms (60), "1m");
+ BOOST_CHECK_EQUAL (seconds_to_approximate_hms (1.5 * 60), "1m 30s");
+ BOOST_CHECK_EQUAL (seconds_to_approximate_hms (2 * 60), "2m");
+ BOOST_CHECK_EQUAL (seconds_to_approximate_hms (17 * 60 + 20), "17m");
+ BOOST_CHECK_EQUAL (seconds_to_approximate_hms (1 * 3600), "1h");
+ BOOST_CHECK_EQUAL (seconds_to_approximate_hms (3600 + 40 * 60), "1h 40m");
+ BOOST_CHECK_EQUAL (seconds_to_approximate_hms (13 * 3600 + 40 * 60), "14h");
+}