diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-07-16 15:30:32 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-07-16 15:30:32 +0100 |
| commit | fc56dc97103d00437843a31e1ef0c4915900ad1a (patch) | |
| tree | 958c909b14b3c9c2f2ec08dd30e5b06e214db1b5 /test/util_test.cc | |
| parent | 94201bd2a5a4cb391b7f2bdeba56b928fed7cfe1 (diff) | |
| parent | 4861afbaab9c3710152d80f15c7a239c26deb74b (diff) | |
Merge master.
Diffstat (limited to 'test/util_test.cc')
| -rw-r--r-- | test/util_test.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/util_test.cc b/test/util_test.cc index 39cc0e6bf..f5bf94c01 100644 --- a/test/util_test.cc +++ b/test/util_test.cc @@ -94,3 +94,16 @@ BOOST_AUTO_TEST_CASE (timecode_test) 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), "1 second"); + BOOST_CHECK_EQUAL (seconds_to_approximate_hms (2), "2 seconds"); + BOOST_CHECK_EQUAL (seconds_to_approximate_hms (60), "1 minute"); + BOOST_CHECK_EQUAL (seconds_to_approximate_hms (1.5 * 60), "1 minute 30 seconds"); + BOOST_CHECK_EQUAL (seconds_to_approximate_hms (2 * 60), "2 minutes"); + BOOST_CHECK_EQUAL (seconds_to_approximate_hms (17 * 60 + 20), "17 minutes"); + BOOST_CHECK_EQUAL (seconds_to_approximate_hms (1 * 3600), "1 hour"); + BOOST_CHECK_EQUAL (seconds_to_approximate_hms (3600 + 40 * 60), "1 hour 40 minutes"); + BOOST_CHECK_EQUAL (seconds_to_approximate_hms (13 * 3600 + 40 * 60), "14 hours"); +} |
