Commit 4bda5c4564eb80143b3b16864f31e67fa44adfb0

henry 2004-09-29T23:46:24

Changed tests to better show the interaction between character encodings

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);
+
         }