summaryrefslogtreecommitdiff
path: root/test/font_comparator_test.cc
blob: dad058a741d9f073dc2cfdc07ee75032a4ad9000 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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());
}