diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-03-03 12:38:30 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-03-03 12:38:30 +0000 |
| commit | a2e3a20a441e604550f0036ca198d5d2122e16a7 (patch) | |
| tree | c0da2b4ace57020b9973f20108e8bbf11ed4e444 /test | |
| parent | c93389b617d2b1a4f5b36025e3097a9f03a7c9cf (diff) | |
Fix rounding of timecodes in at least some cases (#323).
Reported-by: Gérald Maruccia
Diffstat (limited to 'test')
| -rw-r--r-- | test/util_test.cc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/test/util_test.cc b/test/util_test.cc index 4dccb49c6..750023d9f 100644 --- a/test/util_test.cc +++ b/test/util_test.cc @@ -25,7 +25,7 @@ using std::string; using std::vector; using boost::shared_ptr; -BOOST_AUTO_TEST_CASE (util_test) +BOOST_AUTO_TEST_CASE (split_at_spaces_considering_quotes_test) { string t = "Hello this is a string \"with quotes\" and indeed without them"; vector<string> b = split_at_spaces_considering_quotes (t); @@ -53,3 +53,16 @@ BOOST_AUTO_TEST_CASE (md5_digest_test) p.push_back ("foobar"); BOOST_CHECK_THROW (md5_digest (p, shared_ptr<Job> ()), std::runtime_error); } + +BOOST_AUTO_TEST_CASE (divide_with_round_test) +{ + BOOST_CHECK_EQUAL (divide_with_round (0, 4), 0); + BOOST_CHECK_EQUAL (divide_with_round (1, 4), 0); + BOOST_CHECK_EQUAL (divide_with_round (2, 4), 1); + BOOST_CHECK_EQUAL (divide_with_round (3, 4), 1); + BOOST_CHECK_EQUAL (divide_with_round (4, 4), 1); + BOOST_CHECK_EQUAL (divide_with_round (5, 4), 1); + BOOST_CHECK_EQUAL (divide_with_round (6, 4), 2); + + BOOST_CHECK_EQUAL (divide_with_round (1000, 500), 2); +} |
