Split wxDC::GetTextExtent() test case in 3 pieces

No real changes, just don't test all the different wxDC kinds in one
test, when they are completely separate.
This commit is contained in:
Vadim Zeitlin 2022-03-29 13:43:21 +01:00
parent ffdaec88ee
commit a0d1379a57

View File

@ -79,9 +79,11 @@ TEST_CASE("wxDC::GetTextExtent", "[dc][text-extent]")
// And even empty strings count like one line. // And even empty strings count like one line.
CHECK( dc.GetMultiLineTextExtent(wxString()) == wxSize(0, sz.y) ); CHECK( dc.GetMultiLineTextExtent(wxString()) == wxSize(0, sz.y) );
}
// Test the functions with some other DC kinds also.
#if wxUSE_PRINTING_ARCHITECTURE && wxUSE_POSTSCRIPT #if wxUSE_PRINTING_ARCHITECTURE && wxUSE_POSTSCRIPT
TEST_CASE("wxPostScriptDC::GetTextExtent", "[psdc][text-extent]")
{
wxPostScriptDC psdc; wxPostScriptDC psdc;
// wxPostScriptDC doesn't have any font set by default but its // wxPostScriptDC doesn't have any font set by default but its
// GetTextExtent() requires one to be set. This is probably a bug and we // GetTextExtent() requires one to be set. This is probably a bug and we
@ -89,13 +91,16 @@ TEST_CASE("wxDC::GetTextExtent", "[dc][text-extent]")
// around it. // around it.
psdc.SetFont(*wxNORMAL_FONT); psdc.SetFont(*wxNORMAL_FONT);
GetTextExtentTester<wxPostScriptDC> testPS(psdc); GetTextExtentTester<wxPostScriptDC> testPS(psdc);
#endif }
#endif // wxUSE_POSTSCRIPT
#if wxUSE_ENH_METAFILE #if wxUSE_ENH_METAFILE
TEST_CASE("wxEnhMetaFileDC::GetTextExtent", "[emfdc][text-extent]")
{
wxEnhMetaFileDC metadc; wxEnhMetaFileDC metadc;
GetTextExtentTester<wxEnhMetaFileDC> testMF(metadc); GetTextExtentTester<wxEnhMetaFileDC> testMF(metadc);
#endif
} }
#endif // wxUSE_ENH_METAFILE
TEST_CASE("wxDC::LeadingAndDescent", "[dc][text-extent]") TEST_CASE("wxDC::LeadingAndDescent", "[dc][text-extent]")
{ {