Fix seconds_to_approximate_hms sometimes saying things like 1h60m (#1314).
[dcpomatic.git] / test / util_test.cc
index e0e70f902c4d0b8bbc7edbbdc39490d8521ea45c..4b3e20ae308580c847a38b26f5c4dc926d48a04b 100644 (file)
@@ -68,6 +68,8 @@ BOOST_AUTO_TEST_CASE (seconds_to_approximate_hms_test)
        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 (2 * 3600), "2h");
+       BOOST_CHECK_EQUAL (seconds_to_approximate_hms (2 * 3600 - 1), "2h");
        BOOST_CHECK_EQUAL (seconds_to_approximate_hms (13 * 3600 + 40 * 60), "14h");
 }