Added to test_gui in case peripheral graphics context usage complicates things
https://github.com/wxWidgets/wxWidgets/pull/27022
(8 files)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
@vadz commented on this pull request.
Thanks for the tests but please use CATCH matchers to make them more useful in case of failure. TIA!
In tests/graphics/svgfiledc.cpp:
> +
+} // namespace
+
+TEST_CASE("wxSVGFileDC::Ctor", "[svg][dcsvg]")
+{
+ wxSVGFileDC dc(wxString{}, 320, 240);
+
+ CHECK( dc.IsOk() );
+
+ wxSize size = dc.GetSize();
+ CHECK( size.GetWidth() == 320 );
+ CHECK( size.GetHeight() == 240 );
+
+ const wxString svg = dc.GetSVGDocument();
+ CHECK( svg.StartsWith("<?xml") );
+ CHECK( svg.Contains("<svg ") );
Please use
⬇️ Suggested change- CHECK( svg.Contains("<svg ") );
+CHECK_THAT( svg, Catch::Contains("<svg") );
for the same reason.
Also below.
In tests/graphics/svgfiledc.cpp:
> +}
+
+} // namespace
+
+TEST_CASE("wxSVGFileDC::Ctor", "[svg][dcsvg]")
+{
+ wxSVGFileDC dc(wxString{}, 320, 240);
+
+ CHECK( dc.IsOk() );
+
+ wxSize size = dc.GetSize();
+ CHECK( size.GetWidth() == 320 );
+ CHECK( size.GetHeight() == 240 );
+
+ const wxString svg = dc.GetSVGDocument();
+ CHECK( svg.StartsWith("<?xml") );
The problem with this check is that there is no information if the check fails — we don't know if the string is empty or there is some extra stuff before <?xml or something else. If you use
- CHECK( svg.StartsWith("<?xml") );
+ CHECK_THAT( svg, Catch::StartsWith("<?xml") );
CATCH would print the contents of svg if the check fails.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
@Blake-Madden pushed 1 commit.
—
View it on GitHub or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
@Blake-Madden commented on this pull request.
In tests/graphics/svgfiledc.cpp:
> +
+} // namespace
+
+TEST_CASE("wxSVGFileDC::Ctor", "[svg][dcsvg]")
+{
+ wxSVGFileDC dc(wxString{}, 320, 240);
+
+ CHECK( dc.IsOk() );
+
+ wxSize size = dc.GetSize();
+ CHECK( size.GetWidth() == 320 );
+ CHECK( size.GetHeight() == 240 );
+
+ const wxString svg = dc.GetSVGDocument();
+ CHECK( svg.StartsWith("<?xml") );
+ CHECK( svg.Contains("<svg ") );
done
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
@Blake-Madden commented on this pull request.
In tests/graphics/svgfiledc.cpp:
> +}
+
+} // namespace
+
+TEST_CASE("wxSVGFileDC::Ctor", "[svg][dcsvg]")
+{
+ wxSVGFileDC dc(wxString{}, 320, 240);
+
+ CHECK( dc.IsOk() );
+
+ wxSize size = dc.GetSize();
+ CHECK( size.GetWidth() == 320 );
+ CHECK( size.GetHeight() == 240 );
+
+ const wxString svg = dc.GetSVGDocument();
+ CHECK( svg.StartsWith("<?xml") );
done
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()