diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/font_comparator_test.cc | 27 | ||||
| -rw-r--r-- | test/wscript | 1 |
2 files changed, 28 insertions, 0 deletions
diff --git a/test/font_comparator_test.cc b/test/font_comparator_test.cc new file mode 100644 index 000000000..dad058a74 --- /dev/null +++ b/test/font_comparator_test.cc @@ -0,0 +1,27 @@ +#include "lib/font.h" +#include "lib/font_comparator.h" +#include <boost/test/unit_test.hpp> +#include <iostream> + + +using std::make_shared; +using std::map; +using std::shared_ptr; +using std::string; + + +BOOST_AUTO_TEST_CASE(font_comparator_test) +{ + map<dcpomatic::Font::Content, string, FontComparator> cache; + + auto font = make_shared<dcpomatic::Font>("foo"); + + BOOST_CHECK(cache.find(font->content()) == cache.end()); + cache[font->content()] = "foo"; + BOOST_CHECK(cache.find(font->content()) != cache.end()); + + font->set_file("test/data/Inconsolata-VF.ttf"); + BOOST_CHECK(cache.find(font->content()) == cache.end()); +} + + diff --git a/test/wscript b/test/wscript index 9917e7802..827a3feb8 100644 --- a/test/wscript +++ b/test/wscript @@ -94,6 +94,7 @@ def build(bld): file_naming_test.cc film_metadata_test.cc find_missing_test.cc + font_comparator_test.cc frame_interval_checker_test.cc frame_rate_test.cc guess_crop_test.cc |
