Fixing render tests. Must set size before rendering.
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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
diff --git a/test/FTGLBitmapFont-Test.cpp b/test/FTGLBitmapFont-Test.cpp
index a807298..a74cd70 100644
--- a/test/FTGLBitmapFont-Test.cpp
+++ b/test/FTGLBitmapFont-Test.cpp
@@ -9,20 +9,21 @@
extern void buildGLContext();
-class FTGLPolygonFontTest : public CppUnit::TestCase
+class FTGLBitmapFontTest : public CppUnit::TestCase
{
- CPPUNIT_TEST_SUITE( FTGLPolygonFontTest);
+ CPPUNIT_TEST_SUITE( FTGLBitmapFontTest);
CPPUNIT_TEST( testConstructor);
+ CPPUNIT_TEST( testRender);
CPPUNIT_TEST_SUITE_END();
public:
- FTGLPolygonFontTest() : CppUnit::TestCase( "FTGLPolygonFont Test")
+ FTGLBitmapFontTest() : CppUnit::TestCase( "FTGLBitmapFont Test")
{
}
- FTGLPolygonFontTest( const std::string& name) : CppUnit::TestCase(name) {}
+ FTGLBitmapFontTest( const std::string& name) : CppUnit::TestCase(name) {}
- ~FTGLPolygonFontTest()
+ ~FTGLBitmapFontTest()
{
}
@@ -36,6 +37,23 @@ class FTGLPolygonFontTest : public CppUnit::TestCase
CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
}
+ void testRender()
+ {
+ buildGLContext();
+
+ FTGLBitmapFont* bitmapFont = new FTGLBitmapFont( FONT_FILE);
+ bitmapFont->Render(GOOD_ASCII_TEST_STRING);
+
+ CPPUNIT_ASSERT( bitmapFont->Error() == 0);
+ CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+
+ bitmapFont->FaceSize(18);
+ bitmapFont->Render(GOOD_ASCII_TEST_STRING);
+
+ CPPUNIT_ASSERT( bitmapFont->Error() == 0);
+ CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+ }
+
void setUp()
{}
@@ -45,5 +63,5 @@ class FTGLPolygonFontTest : public CppUnit::TestCase
private:
};
-CPPUNIT_TEST_SUITE_REGISTRATION( FTGLPolygonFontTest);
+CPPUNIT_TEST_SUITE_REGISTRATION( FTGLBitmapFontTest);
diff --git a/test/FTGLExtrdFont.cpp-Test.cpp b/test/FTGLExtrdFont.cpp-Test.cpp
index 71b8cec..85f1aca 100644
--- a/test/FTGLExtrdFont.cpp-Test.cpp
+++ b/test/FTGLExtrdFont.cpp-Test.cpp
@@ -13,6 +13,7 @@ class FTGLExtrdFontTest : public CppUnit::TestCase
{
CPPUNIT_TEST_SUITE( FTGLExtrdFontTest);
CPPUNIT_TEST( testConstructor);
+ CPPUNIT_TEST( testRender);
CPPUNIT_TEST_SUITE_END();
public:
@@ -36,6 +37,23 @@ class FTGLExtrdFontTest : public CppUnit::TestCase
CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
}
+ void testRender()
+ {
+ buildGLContext();
+
+ FTGLExtrdFont* extrudedFont = new FTGLExtrdFont( FONT_FILE);
+ extrudedFont->Render(GOOD_ASCII_TEST_STRING);
+
+ CPPUNIT_ASSERT( extrudedFont->Error() == 0x97); // Invalid pixels per em
+ CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+
+ extrudedFont->FaceSize(18);
+ extrudedFont->Render(GOOD_ASCII_TEST_STRING);
+
+ CPPUNIT_ASSERT( extrudedFont->Error() == 0);
+ CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+ }
+
void setUp()
{}
diff --git a/test/FTGLOutlineFont-Test.cpp b/test/FTGLOutlineFont-Test.cpp
index 46f2d81..636238b 100644
--- a/test/FTGLOutlineFont-Test.cpp
+++ b/test/FTGLOutlineFont-Test.cpp
@@ -13,6 +13,7 @@ class FTGLOutlineFontTest : public CppUnit::TestCase
{
CPPUNIT_TEST_SUITE( FTGLOutlineFontTest);
CPPUNIT_TEST( testConstructor);
+ CPPUNIT_TEST( testRender);
CPPUNIT_TEST_SUITE_END();
public:
@@ -35,6 +36,23 @@ class FTGLOutlineFontTest : public CppUnit::TestCase
CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
}
+
+ void testRender()
+ {
+ buildGLContext();
+
+ FTGLOutlineFont* outlineFont = new FTGLOutlineFont( FONT_FILE);
+ outlineFont->Render(GOOD_ASCII_TEST_STRING);
+
+ CPPUNIT_ASSERT( outlineFont->Error() == 0x97); // Invalid pixels per em
+ CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+
+ outlineFont->FaceSize(18);
+ outlineFont->Render(GOOD_ASCII_TEST_STRING);
+
+ CPPUNIT_ASSERT( outlineFont->Error() == 0);
+ CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+ }
void setUp()
{}
diff --git a/test/FTGLPixmapFont-Test.cpp b/test/FTGLPixmapFont-Test.cpp
index 5904145..70c2bf8 100644
--- a/test/FTGLPixmapFont-Test.cpp
+++ b/test/FTGLPixmapFont-Test.cpp
@@ -42,6 +42,11 @@ class FTGLPixmapFontTest : public CppUnit::TestCase
buildGLContext();
FTGLPixmapFont* pixmapFont = new FTGLPixmapFont( FONT_FILE);
+
+ pixmapFont->Render(GOOD_ASCII_TEST_STRING);
+ CPPUNIT_ASSERT( pixmapFont->Error() == 0x97); // Invalid pixels per em
+ CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+
pixmapFont->FaceSize(18);
pixmapFont->Render(GOOD_ASCII_TEST_STRING);
diff --git a/test/FTGLPolygonFont-Test.cpp b/test/FTGLPolygonFont-Test.cpp
index eb8eec1..0d7a96e 100644
--- a/test/FTGLPolygonFont-Test.cpp
+++ b/test/FTGLPolygonFont-Test.cpp
@@ -13,6 +13,7 @@ class FTGLPolygonFontTest : public CppUnit::TestCase
{
CPPUNIT_TEST_SUITE( FTGLPolygonFontTest);
CPPUNIT_TEST( testConstructor);
+ CPPUNIT_TEST( testRender);
CPPUNIT_TEST_SUITE_END();
public:
@@ -36,6 +37,24 @@ class FTGLPolygonFontTest : public CppUnit::TestCase
CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
}
+ void testRender()
+ {
+ buildGLContext();
+
+ FTGLPolygonFont* polygonFont = new FTGLPolygonFont( FONT_FILE);
+
+ polygonFont->Render(GOOD_ASCII_TEST_STRING);
+
+ CPPUNIT_ASSERT( polygonFont->Error() == 0x97); // Invalid pixels per em
+ CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+
+ polygonFont->FaceSize(18);
+ polygonFont->Render(GOOD_ASCII_TEST_STRING);
+
+ CPPUNIT_ASSERT( polygonFont->Error() == 0);
+ CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+ }
+
void setUp()
{}
diff --git a/test/FTGLTextureFont-Test.cpp b/test/FTGLTextureFont-Test.cpp
index 52a9c8f..0d85316 100644
--- a/test/FTGLTextureFont-Test.cpp
+++ b/test/FTGLTextureFont-Test.cpp
@@ -14,6 +14,7 @@ class FTGLTextureFontTest : public CppUnit::TestCase
CPPUNIT_TEST_SUITE( FTGLTextureFontTest);
CPPUNIT_TEST( testConstructor);
CPPUNIT_TEST( testResizeBug);
+ CPPUNIT_TEST( testRender);
CPPUNIT_TEST_SUITE_END();
public:
@@ -52,6 +53,23 @@ class FTGLTextureFontTest : public CppUnit::TestCase
CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
}
+ void testRender()
+ {
+ buildGLContext();
+
+ FTGLTextureFont* textureFont = new FTGLTextureFont( FONT_FILE);
+
+ textureFont->Render(GOOD_ASCII_TEST_STRING);
+ CPPUNIT_ASSERT( textureFont->Error() == 0x97); // Invalid pixels per em
+ CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+
+ textureFont->FaceSize(18);
+ textureFont->Render(GOOD_ASCII_TEST_STRING);
+
+ CPPUNIT_ASSERT( textureFont->Error() == 0);
+ CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+ }
+
void setUp()
{}