From a0d1379a57dd9af3de08bdaedc4ed2fa149cb8e8 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 29 Mar 2022 13:43:21 +0100 Subject: [PATCH] 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. --- tests/graphics/measuring.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/graphics/measuring.cpp b/tests/graphics/measuring.cpp index 28320d7c28..f65f5fad00 100644 --- a/tests/graphics/measuring.cpp +++ b/tests/graphics/measuring.cpp @@ -79,9 +79,11 @@ TEST_CASE("wxDC::GetTextExtent", "[dc][text-extent]") // And even empty strings count like one line. CHECK( dc.GetMultiLineTextExtent(wxString()) == wxSize(0, sz.y) ); +} - // Test the functions with some other DC kinds also. #if wxUSE_PRINTING_ARCHITECTURE && wxUSE_POSTSCRIPT +TEST_CASE("wxPostScriptDC::GetTextExtent", "[psdc][text-extent]") +{ 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 @@ -89,13 +91,16 @@ TEST_CASE("wxDC::GetTextExtent", "[dc][text-extent]") // around it. psdc.SetFont(*wxNORMAL_FONT); GetTextExtentTester testPS(psdc); -#endif +} +#endif // wxUSE_POSTSCRIPT #if wxUSE_ENH_METAFILE +TEST_CASE("wxEnhMetaFileDC::GetTextExtent", "[emfdc][text-extent]") +{ wxEnhMetaFileDC metadc; GetTextExtentTester testMF(metadc); -#endif } +#endif // wxUSE_ENH_METAFILE TEST_CASE("wxDC::LeadingAndDescent", "[dc][text-extent]") {