Commit 875d4b487865ab7d5f56a0d2573853ae732c17c7

henry 2004-09-28T05:35:53

Trying to track down a crashing bug when calling render before FaceSize();

diff --git a/test/FTFont-Test.cpp b/test/FTFont-Test.cpp
index 1ebd4d2..03859bc 100755
--- a/test/FTFont-Test.cpp
+++ b/test/FTFont-Test.cpp
@@ -60,6 +60,7 @@ class FTFontTest : public CppUnit::TestCase
         CPPUNIT_TEST( testGetCharmapList);
         CPPUNIT_TEST( testBoundingBox);
         CPPUNIT_TEST( testAdvance);
+        CPPUNIT_TEST( testRender);
     CPPUNIT_TEST_SUITE_END();
 
     public:
@@ -105,6 +106,7 @@ class FTFontTest : public CppUnit::TestCase
         {
             CPPUNIT_ASSERT_DOUBLES_EQUAL( 0, testFont->Ascender(), 0.01);
             CPPUNIT_ASSERT_DOUBLES_EQUAL( 0, testFont->Descender(), 0.01);
+            CPPUNIT_ASSERT_DOUBLES_EQUAL( 0, testFont->LineHeight(), 0.01);
 
             float advance = testFont->Advance( GOOD_UNICODE_TEST_STRING);
             CPPUNIT_ASSERT( advance == 0);
@@ -116,6 +118,7 @@ class FTFontTest : public CppUnit::TestCase
             
             CPPUNIT_ASSERT_DOUBLES_EQUAL(  52, testFont->Ascender(), 0.01);
             CPPUNIT_ASSERT_DOUBLES_EQUAL( -15, testFont->Descender(), 0.01);
+            CPPUNIT_ASSERT_DOUBLES_EQUAL(  81.86, testFont->LineHeight(), 0.01);
         
             CPPUNIT_ASSERT( testFont->FaceSize( FONT_POINT_SIZE * 2));
             CPPUNIT_ASSERT( testFont->Error() == 0);
@@ -124,6 +127,7 @@ class FTFontTest : public CppUnit::TestCase
         
             CPPUNIT_ASSERT_DOUBLES_EQUAL( 104, testFont->Ascender(), 0.01);
             CPPUNIT_ASSERT_DOUBLES_EQUAL( -29, testFont->Descender(), 0.01);
+            CPPUNIT_ASSERT_DOUBLES_EQUAL( 163.72, testFont->LineHeight(), 0.01);
         }
         
         
@@ -219,6 +223,12 @@ class FTFontTest : public CppUnit::TestCase
             CPPUNIT_ASSERT_DOUBLES_EQUAL( 0, advance, 0.01);
         }
         
+        void testRender()
+        {
+            testFont->Render(GOOD_ASCII_TEST_STRING);
+            CPPUNIT_ASSERT( testFont->Error() == 0);    
+        }
+        
         
         void setUp() 
         {
diff --git a/test/FTGLPixmapFont-Test.cpp b/test/FTGLPixmapFont-Test.cpp
index f73670c..5904145 100644
--- a/test/FTGLPixmapFont-Test.cpp
+++ b/test/FTGLPixmapFont-Test.cpp
@@ -13,6 +13,7 @@ class FTGLPixmapFontTest : public CppUnit::TestCase
 {
     CPPUNIT_TEST_SUITE( FTGLPixmapFontTest);
         CPPUNIT_TEST( testConstructor);
+        CPPUNIT_TEST( testRender);
     CPPUNIT_TEST_SUITE_END();
         
     public:
@@ -36,6 +37,18 @@ class FTGLPixmapFontTest : public CppUnit::TestCase
             CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);        
         }
 
+        void testRender()
+        {
+            buildGLContext();
+        
+            FTGLPixmapFont* pixmapFont = new FTGLPixmapFont( FONT_FILE);            
+            pixmapFont->FaceSize(18);
+            pixmapFont->Render(GOOD_ASCII_TEST_STRING);
+
+            CPPUNIT_ASSERT( pixmapFont->Error() == 0);        
+            CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);        
+        }
+
         void setUp() 
         {}