diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-03-03 12:54:07 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-03-03 12:54:07 +0000 |
| commit | 1629bd7df2150156109afbc7a16677cb29e82adf (patch) | |
| tree | f8d42b82976bf999eafd1abd499027a5ea5be02e /test/util_test.cc | |
| parent | cc3900735839ff4b0da0c046b5c606c440ba917a (diff) | |
| parent | f0738a22fc7555c306d49bcd1c356ce210e2c0e2 (diff) | |
Merge master.
Diffstat (limited to 'test/util_test.cc')
| -rw-r--r-- | test/util_test.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/test/util_test.cc b/test/util_test.cc index 5733c7d03..37dee00c9 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); @@ -67,3 +67,17 @@ BOOST_AUTO_TEST_CASE (time_round_up_test) BOOST_CHECK_EQUAL (time_round_up (42, 42), 42); BOOST_CHECK_EQUAL (time_round_up (43, 42), 84); } + + +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); +} |
