Merge master.
authorCarl Hetherington <cth@carlh.net>
Wed, 16 Jul 2014 14:30:32 +0000 (15:30 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 16 Jul 2014 14:30:32 +0000 (15:30 +0100)
1  2 
ChangeLog
src/lib/util.cc
test/util_test.cc

diff --cc ChangeLog
index 561bbce1c06f1ce981512e41413408902d952f8a,40797c7b37f328cd376e2bad87e16009b98a7724..5265423fc06ef30e6e858a922562412046982c30
+++ b/ChangeLog
@@@ -1,19 -1,11 +1,25 @@@
 +2014-07-15  Carl Hetherington  <cth@carlh.net>
 +
 +      * A variety of changes were made on the 2.0 branch
 +      but not documented in the ChangeLog.  Most sigificantly:
 +
 +      - DCP import
 +      - Creation of DCPs with proper XML subtitles
 +      - Import of .srt and .xml subtitles
 +      - Audio processing framework (with some basic processors).
 +
 +2014-03-07  Carl Hetherington  <cth@carlh.net>
 +
 +      * Add subtitle view.
 +
  2014-07-16  Carl Hetherington  <cth@carlh.net>
  
+       * Version 1.72.3 released.
+ 2014-07-16  Carl Hetherington  <cth@carlh.net>
+       * Improve approximate time reports a bit.
        * Make KDM email subject configurable.
  
        * Updates to de_DE from Carsten Kurz.
diff --cc src/lib/util.cc
Simple merge
index 39cc0e6bf7df07956b56191e88af6465ee92db71,40a2835f1515f68a47ba5b9981a812778ad10295..f5bf94c011464265754e59aeddde65dc44e09dc9
@@@ -89,8 -67,15 +89,21 @@@ BOOST_AUTO_TEST_CASE (divide_with_round
        BOOST_CHECK_EQUAL (divide_with_round (1000, 500), 2);
  }
  
 +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");
+ }