+void MeasuringTextTestCase::DCGetTextExtent()
+{
+ wxClientDC dc(wxTheApp->GetTopWindow());
+
+ GetTextExtentTester<wxClientDC> testDC(dc);
+
+ int w;
+ dc.GetMultiLineTextExtent("Good\nbye", &w, NULL);
+ const wxSize sz = dc.GetTextExtent("Good");
+ CPPUNIT_ASSERT_EQUAL( sz.x, w );
+
+ CPPUNIT_ASSERT( dc.GetMultiLineTextExtent("Good\nbye").y >= 2*sz.y );
+
+ // Test the functions with some other DC kinds also.
+#if wxUSE_PRINTING_ARCHITECTURE && wxUSE_POSTSCRIPT
+ wxPostScriptDC psdc;
+ // wxPostScriptDC doesn't have any font set by default but its
+ // GetTextExtent() requires one to be set. This is probably a bug and we
+ // should set the default font in it implicitly but for now just work
+ // around it.
+ psdc.SetFont(*wxNORMAL_FONT);
+ GetTextExtentTester<wxPostScriptDC> testPS(psdc);
+#endif
+
+#if wxUSE_ENH_METAFILE
+ wxEnhMetaFileDC metadc;
+ GetTextExtentTester<wxEnhMetaFileDC> testMF(metadc);
+#endif
+}
+
+void MeasuringTextTestCase::WindowGetTextExtent()
+{
+ wxWindow* const win = wxTheApp->GetTopWindow();
+
+ GetTextExtentTester<wxWindow> testWin(*win);
+}
+
+void MeasuringTextTestCase::GetPartialTextExtent()
+{
+ wxClientDC dc(wxTheApp->GetTopWindow());
+
+ wxArrayInt widths;
+ CPPUNIT_ASSERT( dc.GetPartialTextExtents("Hello", widths) );
+ CPPUNIT_ASSERT_EQUAL( 5, widths.size() );
+ CPPUNIT_ASSERT_EQUAL( widths[0], dc.GetTextExtent("H").x );
+ CPPUNIT_ASSERT_EQUAL( widths[4], dc.GetTextExtent("Hello").x );
+}
+
+#ifdef TEST_GC
+
+void MeasuringTextTestCase::GraphicsGetTextExtent()