Debian Codegraph @

test/FTCharToGlyphIndexMap-Test.cpp

raw
1 #include <cppunit/extensions/HelperMacros.h>
2 #include <cppunit/TestCaller.h>
3 #include <cppunit/TestCase.h>
4 #include <cppunit/TestSuite.h>
5
6 #include "FTCharToGlyphIndexMap.h"
7
8
9 class FTCharToGlyphIndexMapTest : public CppUnit::TestCase
10 {
11 CPPUNIT_TEST_SUITE(FTCharToGlyphIndexMapTest);
12 CPPUNIT_TEST(testConstructor);
13 CPPUNIT_TEST(testInsert);
14 CPPUNIT_TEST(testClear);
15 CPPUNIT_TEST_SUITE_END();
16
17 public:
18 FTCharToGlyphIndexMapTest() : CppUnit::TestCase("FTCharToGlyphIndexMap Test")
19 {}
20
21 FTCharToGlyphIndexMapTest(const std::string& name) : CppUnit::TestCase(name) {}
22
23 void testConstructor()
24 {
25 FTCharToGlyphIndexMap testMap;
26
27 CPPUNIT_ASSERT(testMap.find(2) == 0);
28 CPPUNIT_ASSERT(testMap.find(5) == 0);
29 }
30
31 void testInsert()
32 {
33 FTCharToGlyphIndexMap testMap;
34
35 testMap.insert(2, 37);
36
37 CPPUNIT_ASSERT(testMap.find(2) == 37);
38 CPPUNIT_ASSERT(testMap.find(5) == 0);
39 }
40
41 void testClear()
42 {
43 FTCharToGlyphIndexMap testMap;
44
45 testMap.insert(2, 37);
46 testMap.clear();
47
48 CPPUNIT_ASSERT(testMap.find(2) == 0);
49 CPPUNIT_ASSERT(testMap.find(5) == 0);
50 }
51
52
53 void setUp()
54 {}
55
56
57 void tearDown()
58 {}
59
60 private:
61 };
62
63 CPPUNIT_TEST_SUITE_REGISTRATION(FTCharToGlyphIndexMapTest);
64