- // Test that getting the height only doesn't crash.
- int y;
- obj.GetTextExtent("H", NULL, &y);
-
- CPPUNIT_ASSERT( y > 1 );
+ // Constructor runs a couple of simple tests for GetTextExtent().
+ GetTextExtentTester(const T& obj)
+ {
+ // Test that getting the height only doesn't crash.
+ int y;
+ obj.GetTextExtent("H", NULL, &y);
+
+ CPPUNIT_ASSERT( y > 1 );
+
+ wxSize size = obj.GetTextExtent("Hello");
+ CPPUNIT_ASSERT( size.x > 1 );
+ CPPUNIT_ASSERT_EQUAL( y, size.y );
+ }
+};