Changed tests to better show the interaction between character encodings
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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
diff --git a/test/FTCharmap-Test.cpp b/test/FTCharmap-Test.cpp
index 19e1c91..06b9c8b 100755
--- a/test/FTCharmap-Test.cpp
+++ b/test/FTCharmap-Test.cpp
@@ -63,24 +63,31 @@ class FTCharmapTest : public CppUnit::TestCase
void testGetGlyphListIndex()
{
- charmap->CharMap( ft_encoding_unicode);
+ charmap->CharMap( ft_encoding_johab);
- CPPUNIT_ASSERT( charmap->Error() == 0);
+ CPPUNIT_ASSERT( charmap->Error() == 0x06); // invalid argument
CPPUNIT_ASSERT( charmap->GlyphListIndex( CHARACTER_CODE_A) == 0);
CPPUNIT_ASSERT( charmap->GlyphListIndex( BIG_CHARACTER_CODE) == 0);
CPPUNIT_ASSERT( charmap->GlyphListIndex( NULL_CHARACTER_CODE) == 0);
+
+ charmap->CharMap( ft_encoding_unicode);
- charmap->CharMap( ft_encoding_johab);
-
- CPPUNIT_ASSERT( charmap->Error() == 0x06); // invalid argument
+ CPPUNIT_ASSERT( charmap->Error() == 0);
CPPUNIT_ASSERT( charmap->GlyphListIndex( CHARACTER_CODE_A) == 0);
CPPUNIT_ASSERT( charmap->GlyphListIndex( BIG_CHARACTER_CODE) == 0);
CPPUNIT_ASSERT( charmap->GlyphListIndex( NULL_CHARACTER_CODE) == 0);
+
}
void testGetFontIndex()
{
+ charmap->CharMap( ft_encoding_johab);
+
+ CPPUNIT_ASSERT( charmap->Error() == 0x06); // invalid argument
+ CPPUNIT_ASSERT( charmap->FontIndex( CHARACTER_CODE_A) == FONT_INDEX_OF_A);
+ CPPUNIT_ASSERT( charmap->FontIndex( BIG_CHARACTER_CODE) == BIG_FONT_INDEX);
+ CPPUNIT_ASSERT( charmap->FontIndex( NULL_CHARACTER_CODE) == NULL_FONT_INDEX);
charmap->CharMap( ft_encoding_unicode);
CPPUNIT_ASSERT( charmap->Error() == 0);
@@ -88,6 +95,7 @@ class FTCharmapTest : public CppUnit::TestCase
CPPUNIT_ASSERT( charmap->FontIndex( CHARACTER_CODE_A) == FONT_INDEX_OF_A);
CPPUNIT_ASSERT( charmap->FontIndex( BIG_CHARACTER_CODE) == BIG_FONT_INDEX);
CPPUNIT_ASSERT( charmap->FontIndex( NULL_CHARACTER_CODE) == NULL_FONT_INDEX);
+
}