diff options
| author | Carl Hetherington <cth@carlh.net> | 2019-12-15 22:58:21 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2019-12-22 01:21:00 +0100 |
| commit | dd0db15b82a0b40b1271bad122c874d458c0fef4 (patch) | |
| tree | 201b4efac6915353e9635f230b3a08297be87dd7 /test | |
| parent | 82c72bf1a25891d5053b7b4fb1f7d2bab9d7fd13 (diff) | |
Add fix_empty_font_ids() to replace empty Font ids with a dummy string.
Diffstat (limited to 'test')
| -rw-r--r-- | test/util_test.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/util_test.cc b/test/util_test.cc index d85b9b56..24aa5e72 100644 --- a/test/util_test.cc +++ b/test/util_test.cc @@ -38,6 +38,7 @@ using std::ifstream; using std::string; +using std::list; /** Test dcp::base64_decode */ BOOST_AUTO_TEST_CASE (base64_decode_test) @@ -341,3 +342,14 @@ BOOST_AUTO_TEST_CASE (day_greater_than_or_equal_test) BOOST_CHECK (day_greater_than_or_equal(a, b)); } } + +BOOST_AUTO_TEST_CASE (unique_string_test) +{ + list<string> existing; + for (int i = 0; i < 16; i++) { + string s; + BOOST_CHECK_NO_THROW (s = dcp::unique_string(existing, "foo")); + BOOST_CHECK (find(existing.begin(), existing.end(), s) == existing.end()); + existing.push_back (s); + } +} |
