Commit 1bf337d2e8965898cc87485ef41eb53567d16e45

henry 2003-10-04T04:58:35

Initial test before refactoring

diff --git a/test/FTFTCharToGlyphIndexMap-Test.cpp b/test/FTFTCharToGlyphIndexMap-Test.cpp
new file mode 100755
index 0000000..ad03999
--- /dev/null
+++ b/test/FTFTCharToGlyphIndexMap-Test.cpp
@@ -0,0 +1,64 @@
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/TestCaller.h>
+#include <cppunit/TestCase.h>
+#include <cppunit/TestSuite.h>
+
+#include "FTCharToGlyphIndexMap.h"
+
+
+class FTCharToGlyphIndexMapTest : public CppUnit::TestCase
+{
+    CPPUNIT_TEST_SUITE( FTCharToGlyphIndexMapTest);
+        CPPUNIT_TEST( testConstructor);
+        CPPUNIT_TEST( testInsert);
+        CPPUNIT_TEST( testClear);
+    CPPUNIT_TEST_SUITE_END();
+        
+    public:
+        FTCharToGlyphIndexMapTest() : CppUnit::TestCase( "FTCharToGlyphIndexMap Test")
+        {}
+        
+        FTCharToGlyphIndexMapTest( const std::string& name) : CppUnit::TestCase(name) {}
+
+        void testConstructor()
+        {
+            FTCharToGlyphIndexMap testMap;
+            
+            CPPUNIT_ASSERT( testMap.find( 2) == NULL);
+            CPPUNIT_ASSERT( testMap.find( 5) == NULL);
+        }
+        
+        void testInsert()
+        {
+            FTCharToGlyphIndexMap testMap;
+            
+            testMap.insert( 2, 37);
+            
+            CPPUNIT_ASSERT( *(testMap.find( 2)) == 37);
+            CPPUNIT_ASSERT( testMap.find( 5) == NULL);
+        }
+        
+        void testClear()
+        {
+            FTCharToGlyphIndexMap testMap;
+            
+            testMap.insert( 2, 37);
+            testMap.clear();
+            
+            CPPUNIT_ASSERT( testMap.find( 2) == NULL);
+            CPPUNIT_ASSERT( testMap.find( 5) == NULL);
+        }
+        
+        
+        void setUp() 
+        {}
+        
+        
+        void tearDown() 
+        {}
+        
+    private:
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION( FTCharToGlyphIndexMapTest);
+