Commit cffb0645f43ae236041797ad2aac7cd4d94f2768

henry 2004-09-28T02:19:15

New tests.

diff --git a/test/FTExtrdGlyph-Test.cpp b/test/FTExtrdGlyph-Test.cpp
new file mode 100644
index 0000000..0e8c490
--- /dev/null
+++ b/test/FTExtrdGlyph-Test.cpp
@@ -0,0 +1,64 @@
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/TestCaller.h>
+#include <cppunit/TestCase.h>
+#include <cppunit/TestSuite.h>
+#include <assert.h>
+
+#include "Fontdefs.h"
+#include "FTExtrdGlyph.h"
+
+extern void buildGLContext();
+
+class FTExtrdGlyphTest : public CppUnit::TestCase
+{
+    CPPUNIT_TEST_SUITE( FTExtrdGlyphTest);
+        CPPUNIT_TEST( testConstructor);
+    CPPUNIT_TEST_SUITE_END();
+        
+    public:
+        FTExtrdGlyphTest() : CppUnit::TestCase( "FTExtrdGlyph Test")
+        {
+        }
+        
+        FTExtrdGlyphTest( const std::string& name) : CppUnit::TestCase(name) {}
+        
+        ~FTExtrdGlyphTest()
+        {
+        }
+        
+        void testConstructor()
+        {
+            FT_Library   library;
+            FT_Face      face;
+            
+            FT_Error error = FT_Init_FreeType( &library);
+            assert(!error);
+            error = FT_New_Face( library, FONT_FILE, 0, &face);
+            assert(!error);
+            
+            FT_Set_Char_Size( face, 0L, FONT_POINT_SIZE * 64, RESOLUTION, RESOLUTION);
+            
+            error = FT_Load_Char( face, CHARACTER_CODE_A, FT_LOAD_DEFAULT);
+            assert( !error);
+            
+            buildGLContext();
+        
+            FTExtrdGlyph* extrudedGlyph = new FTExtrdGlyph( face->glyph, 0.0f);            
+            CPPUNIT_ASSERT( extrudedGlyph->Error() == 0);
+        
+            FT_Done_Face( face);
+            FT_Done_FreeType( library);
+            
+        }
+
+        void setUp() 
+        {}
+        
+        void tearDown() 
+        {}
+                    
+    private:
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION( FTExtrdGlyphTest);
+
diff --git a/test/FTOutlineGlyph-Test.cpp b/test/FTOutlineGlyph-Test.cpp
new file mode 100644
index 0000000..a5d878a
--- /dev/null
+++ b/test/FTOutlineGlyph-Test.cpp
@@ -0,0 +1,64 @@
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/TestCaller.h>
+#include <cppunit/TestCase.h>
+#include <cppunit/TestSuite.h>
+#include <assert.h>
+
+#include "Fontdefs.h"
+#include "FTOutlineGlyph.h"
+
+extern void buildGLContext();
+
+class FTOutlineGlyphTest : public CppUnit::TestCase
+{
+    CPPUNIT_TEST_SUITE( FTOutlineGlyphTest);
+        CPPUNIT_TEST( testConstructor);
+    CPPUNIT_TEST_SUITE_END();
+        
+    public:
+        FTOutlineGlyphTest() : CppUnit::TestCase( "FTOutlineGlyph Test")
+        {
+        }
+        
+        FTOutlineGlyphTest( const std::string& name) : CppUnit::TestCase(name) {}
+        
+        ~FTOutlineGlyphTest()
+        {
+        }
+        
+        void testConstructor()
+        {
+            FT_Library   library;
+            FT_Face      face;
+            
+            FT_Error error = FT_Init_FreeType( &library);
+            assert(!error);
+            error = FT_New_Face( library, FONT_FILE, 0, &face);
+            assert(!error);
+            
+            FT_Set_Char_Size( face, 0L, FONT_POINT_SIZE * 64, RESOLUTION, RESOLUTION);
+            
+            error = FT_Load_Char( face, CHARACTER_CODE_A, FT_LOAD_DEFAULT);
+            assert( !error);
+            
+            buildGLContext();
+        
+            FTOutlineGlyph* outlineGlyph = new FTOutlineGlyph( face->glyph);            
+            CPPUNIT_ASSERT( outlineGlyph->Error() == 0);
+        
+            FT_Done_Face( face);
+            FT_Done_FreeType( library);
+            
+        }
+
+        void setUp() 
+        {}
+        
+        void tearDown() 
+        {}
+                    
+    private:
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION( FTOutlineGlyphTest);
+
diff --git a/test/FTPixmapGlyph-Test.cpp b/test/FTPixmapGlyph-Test.cpp
new file mode 100644
index 0000000..0ba213e
--- /dev/null
+++ b/test/FTPixmapGlyph-Test.cpp
@@ -0,0 +1,64 @@
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/TestCaller.h>
+#include <cppunit/TestCase.h>
+#include <cppunit/TestSuite.h>
+#include <assert.h>
+
+#include "Fontdefs.h"
+#include "FTPixmapGlyph.h"
+
+extern void buildGLContext();
+
+class FTPixmapGlyphTest : public CppUnit::TestCase
+{
+    CPPUNIT_TEST_SUITE( FTPixmapGlyphTest);
+        CPPUNIT_TEST( testConstructor);
+    CPPUNIT_TEST_SUITE_END();
+        
+    public:
+        FTPixmapGlyphTest() : CppUnit::TestCase( "FTPixmapGlyph Test")
+        {
+        }
+        
+        FTPixmapGlyphTest( const std::string& name) : CppUnit::TestCase(name) {}
+        
+        ~FTPixmapGlyphTest()
+        {
+        }
+        
+        void testConstructor()
+        {
+            FT_Library   library;
+            FT_Face      face;
+            
+            FT_Error error = FT_Init_FreeType( &library);
+            assert(!error);
+            error = FT_New_Face( library, FONT_FILE, 0, &face);
+            assert(!error);
+            
+            FT_Set_Char_Size( face, 0L, FONT_POINT_SIZE * 64, RESOLUTION, RESOLUTION);
+            
+            error = FT_Load_Char( face, CHARACTER_CODE_A, FT_LOAD_DEFAULT);
+            assert( !error);
+            
+            buildGLContext();
+        
+            FTPixmapGlyph* PixmapGlyph = new FTPixmapGlyph( face->glyph);            
+            CPPUNIT_ASSERT( PixmapGlyph->Error() == 0);
+        
+            FT_Done_Face( face);
+            FT_Done_FreeType( library);
+            
+        }
+
+        void setUp() 
+        {}
+        
+        void tearDown() 
+        {}
+                    
+    private:
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION( FTPixmapGlyphTest);
+
diff --git a/test/FTPolyGlyph-Test.cpp b/test/FTPolyGlyph-Test.cpp
new file mode 100644
index 0000000..7fdead3
--- /dev/null
+++ b/test/FTPolyGlyph-Test.cpp
@@ -0,0 +1,64 @@
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/TestCaller.h>
+#include <cppunit/TestCase.h>
+#include <cppunit/TestSuite.h>
+#include <assert.h>
+
+#include "Fontdefs.h"
+#include "FTPolyGlyph.h"
+
+extern void buildGLContext();
+
+class FTPolyGlyphTest : public CppUnit::TestCase
+{
+    CPPUNIT_TEST_SUITE( FTPolyGlyphTest);
+        CPPUNIT_TEST( testConstructor);
+    CPPUNIT_TEST_SUITE_END();
+        
+    public:
+        FTPolyGlyphTest() : CppUnit::TestCase( "FTPolyGlyph Test")
+        {
+        }
+        
+        FTPolyGlyphTest( const std::string& name) : CppUnit::TestCase(name) {}
+        
+        ~FTPolyGlyphTest()
+        {
+        }
+        
+        void testConstructor()
+        {
+            FT_Library   library;
+            FT_Face      face;
+            
+            FT_Error error = FT_Init_FreeType( &library);
+            assert(!error);
+            error = FT_New_Face( library, FONT_FILE, 0, &face);
+            assert(!error);
+            
+            FT_Set_Char_Size( face, 0L, FONT_POINT_SIZE * 64, RESOLUTION, RESOLUTION);
+            
+            error = FT_Load_Char( face, CHARACTER_CODE_A, FT_LOAD_DEFAULT);
+            assert( !error);
+            
+            buildGLContext();
+        
+            FTPolyGlyph* polyGlyph = new FTPolyGlyph( face->glyph);            
+            CPPUNIT_ASSERT( polyGlyph->Error() == 0);
+        
+            FT_Done_Face( face);
+            FT_Done_FreeType( library);
+            
+        }
+
+        void setUp() 
+        {}
+        
+        void tearDown() 
+        {}
+                    
+    private:
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION( FTPolyGlyphTest);
+
diff --git a/test/FTTextureGlyph-Test.cpp b/test/FTTextureGlyph-Test.cpp
new file mode 100644
index 0000000..d974c8e
--- /dev/null
+++ b/test/FTTextureGlyph-Test.cpp
@@ -0,0 +1,65 @@
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/TestCaller.h>
+#include <cppunit/TestCase.h>
+#include <cppunit/TestSuite.h>
+#include <assert.h>
+
+#include "Fontdefs.h"
+#include "FTTextureGlyph.h"
+
+extern void buildGLContext();
+
+class FTTextureGlyphTest : public CppUnit::TestCase
+{
+    CPPUNIT_TEST_SUITE( FTTextureGlyphTest);
+        CPPUNIT_TEST( testConstructor);
+    CPPUNIT_TEST_SUITE_END();
+        
+    public:
+        FTTextureGlyphTest() : CppUnit::TestCase( "FTTextureGlyph Test")
+        {
+        }
+        
+        FTTextureGlyphTest( const std::string& name) : CppUnit::TestCase(name) {}
+        
+        ~FTTextureGlyphTest()
+        {
+        }
+        
+        void testConstructor()
+        {
+            FT_Library   library;
+            FT_Face      face;
+            
+            FT_Error error = FT_Init_FreeType( &library);
+            assert(!error);
+            error = FT_New_Face( library, FONT_FILE, 0, &face);
+            assert(!error);
+            
+            FT_Set_Char_Size( face, 0L, FONT_POINT_SIZE * 64, RESOLUTION, RESOLUTION);
+            
+            error = FT_Load_Char( face, CHARACTER_CODE_A, FT_LOAD_DEFAULT);
+            assert( !error);
+            
+            buildGLContext();
+        
+            FTTextureGlyph* textureGlyph = new FTTextureGlyph( face->glyph, 0, 0, 0, 0, 0);
+         
+            CPPUNIT_ASSERT( textureGlyph->Error() == 0);
+        
+            FT_Done_Face( face);
+            FT_Done_FreeType( library);
+            
+        }
+
+        void setUp() 
+        {}
+        
+        void tearDown() 
+        {}
+                    
+    private:
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION( FTTextureGlyphTest);
+