Remove warning messages from clipping box unit tests

There is nothing that can be done about the warnings saying that using
transform matrix is not supported for the given DC kind and it's not
going to change any time soon (i.e. implementing support for transform
matrix for wxSVGFileDC is not planned), but in the meanwhile it results
in a lot of useless output in the CI logs when running the tests, making
it difficult to find real problems in the test.

This commit is best viewed ignoring whitespace-only changes.
This commit is contained in:
Vadim Zeitlin
2021-08-25 23:57:12 +02:00
parent b057fd4a40
commit 2c4b627cff

View File

@@ -351,10 +351,7 @@ static void InitialStateWithTransformedDC(wxDC& dc, const wxBitmap& bmp, bool ch
{ {
#if wxUSE_DC_TRANSFORM_MATRIX #if wxUSE_DC_TRANSFORM_MATRIX
if ( useTransformMatrix & !dc.CanUseTransformMatrix() ) if ( useTransformMatrix & !dc.CanUseTransformMatrix() )
{
WARN("Skipping test because transform matrix is not supported.");
return; return;
}
#endif // wxUSE_DC_TRANSFORM_MATRIX #endif // wxUSE_DC_TRANSFORM_MATRIX
// Initial clipping box with transformed DC. // Initial clipping box with transformed DC.
@@ -398,8 +395,9 @@ static void InitialStateWithRotatedDC(wxDC& dc, const wxBitmap& bmp)
{ {
// Initial clipping box with rotated DC. // Initial clipping box with rotated DC.
#if wxUSE_DC_TRANSFORM_MATRIX #if wxUSE_DC_TRANSFORM_MATRIX
if ( dc.CanUseTransformMatrix() ) if ( !dc.CanUseTransformMatrix() )
{ return;
// Apply rotation to DC. // Apply rotation to DC.
wxAffineMatrix2D m = dc.GetTransformMatrix(); wxAffineMatrix2D m = dc.GetTransformMatrix();
m.Rotate(wxDegToRad(6)); m.Rotate(wxDegToRad(6));
@@ -452,11 +450,6 @@ static void InitialStateWithRotatedDC(wxDC& dc, const wxBitmap& bmp)
CheckClipBox(dc, bmp, CheckClipBox(dc, bmp,
clipX, clipY, clipW, clipH, clipX, clipY, clipW, clipH,
0, 0, s_dcSize.GetWidth(), s_dcSize.GetHeight()); 0, 0, s_dcSize.GetWidth(), s_dcSize.GetHeight());
}
else
{
WARN("Skipping test because transform matrix is not supported.");
}
#endif // wxUSE_DC_TRANSFORM_MATRIX #endif // wxUSE_DC_TRANSFORM_MATRIX
} }
@@ -465,8 +458,9 @@ static void SameRegionRepeatRotatedDC(wxDC& dc)
// While setting the same clipping region several times // While setting the same clipping region several times
// the same clipping box should be should be returned. // the same clipping box should be should be returned.
#if wxUSE_DC_TRANSFORM_MATRIX #if wxUSE_DC_TRANSFORM_MATRIX
if ( dc.CanUseTransformMatrix() ) if ( !dc.CanUseTransformMatrix() )
{ return;
// Apply rotation to DC. // Apply rotation to DC.
wxAffineMatrix2D m = dc.GetTransformMatrix(); wxAffineMatrix2D m = dc.GetTransformMatrix();
m.Rotate(wxDegToRad(6)); m.Rotate(wxDegToRad(6));
@@ -521,11 +515,6 @@ static void SameRegionRepeatRotatedDC(wxDC& dc)
CheckClipPos(dc, clipX, clipY, clipW, clipH, 1); CheckClipPos(dc, clipX, clipY, clipW, clipH, 1);
dc.SetClippingRegion(clipX, clipY, clipW, clipH); dc.SetClippingRegion(clipX, clipY, clipW, clipH);
CheckClipPos(dc, clipX, clipY, clipW, clipH, 1); CheckClipPos(dc, clipX, clipY, clipW, clipH, 1);
}
else
{
WARN("Skipping test because transform matrix is not supported.");
}
#endif // wxUSE_DC_TRANSFORM_MATRIX #endif // wxUSE_DC_TRANSFORM_MATRIX
} }
@@ -623,10 +612,7 @@ static void OneRegionOverTransformedDC(wxDC& dc, const wxBitmap& bmp, bool check
{ {
#if wxUSE_DC_TRANSFORM_MATRIX #if wxUSE_DC_TRANSFORM_MATRIX
if ( useTransformMatrix & !dc.CanUseTransformMatrix() ) if ( useTransformMatrix & !dc.CanUseTransformMatrix() )
{
WARN("Skipping test because transform matrix is not supported.");
return; return;
}
#endif // wxUSE_DC_TRANSFORM_MATRIX #endif // wxUSE_DC_TRANSFORM_MATRIX
// Setting one clipping region inside DC area // Setting one clipping region inside DC area
@@ -694,8 +680,9 @@ static void OneRegionOverRotatedDC(wxDC& dc)
// Setting one clipping region inside DC area // Setting one clipping region inside DC area
// with applied rotation transformation. // with applied rotation transformation.
#if wxUSE_DC_TRANSFORM_MATRIX #if wxUSE_DC_TRANSFORM_MATRIX
if ( dc.CanUseTransformMatrix() ) if ( !dc.CanUseTransformMatrix() )
{ return;
// Setting one clipping region inside DC area. // Setting one clipping region inside DC area.
const int x = 0; const int x = 0;
const int y = 0; const int y = 0;
@@ -775,11 +762,6 @@ static void OneRegionOverRotatedDC(wxDC& dc)
int clipW = wxRound(x2) - wxRound(x1); int clipW = wxRound(x2) - wxRound(x1);
int clipH = wxRound(y2) - wxRound(y1); int clipH = wxRound(y2) - wxRound(y1);
CheckClipPos(dc, clipX, clipY, clipW, clipH, 1); CheckClipPos(dc, clipX, clipY, clipW, clipH, 1);
}
else
{
WARN("Skipping test because transform matrix is not supported.");
}
#endif // wxUSE_DC_TRANSFORM_MATRIX #endif // wxUSE_DC_TRANSFORM_MATRIX
} }
@@ -787,10 +769,7 @@ static void OneRegionAndDCTransformation(wxDC& dc, const wxBitmap& bmp, bool che
{ {
#if wxUSE_DC_TRANSFORM_MATRIX #if wxUSE_DC_TRANSFORM_MATRIX
if ( useTransformMatrix & !dc.CanUseTransformMatrix() ) if ( useTransformMatrix & !dc.CanUseTransformMatrix() )
{
WARN("Skipping test because transform matrix is not supported.");
return; return;
}
#endif // wxUSE_DC_TRANSFORM_MATRIX #endif // wxUSE_DC_TRANSFORM_MATRIX
// Setting one clipping region inside DC area // Setting one clipping region inside DC area
@@ -958,10 +937,7 @@ static void OneDevRegion(wxDC& dc, const wxBitmap& bmp, bool checkExtCoords, boo
{ {
#if wxUSE_DC_TRANSFORM_MATRIX #if wxUSE_DC_TRANSFORM_MATRIX
if ( useTransformMatrix & !dc.CanUseTransformMatrix() ) if ( useTransformMatrix & !dc.CanUseTransformMatrix() )
{
WARN("Skipping test because transform matrix is not supported.");
return; return;
}
#endif // wxUSE_DC_TRANSFORM_MATRIX #endif // wxUSE_DC_TRANSFORM_MATRIX
// Setting one clipping region in device coordinates // Setting one clipping region in device coordinates
@@ -1014,10 +990,7 @@ static void OneLargeDevRegion(wxDC& dc, const wxBitmap& bmp, bool checkExtCoords
{ {
#if wxUSE_DC_TRANSFORM_MATRIX #if wxUSE_DC_TRANSFORM_MATRIX
if ( useTransformMatrix & !dc.CanUseTransformMatrix() ) if ( useTransformMatrix & !dc.CanUseTransformMatrix() )
{
WARN("Skipping test because transform matrix is not supported.");
return; return;
}
#endif // wxUSE_DC_TRANSFORM_MATRIX #endif // wxUSE_DC_TRANSFORM_MATRIX
// Setting one clipping region in device coordinates larger // Setting one clipping region in device coordinates larger
@@ -1067,10 +1040,7 @@ static void OneOuterDevRegion(wxDC& dc, const wxBitmap& bmp, bool useTransformMa
{ {
#if wxUSE_DC_TRANSFORM_MATRIX #if wxUSE_DC_TRANSFORM_MATRIX
if ( useTransformMatrix & !dc.CanUseTransformMatrix() ) if ( useTransformMatrix & !dc.CanUseTransformMatrix() )
{
WARN("Skipping test because transform matrix is not supported.");
return; return;
}
#endif // wxUSE_DC_TRANSFORM_MATRIX #endif // wxUSE_DC_TRANSFORM_MATRIX
// Setting one clipping region in device coordinates // Setting one clipping region in device coordinates
@@ -1105,10 +1075,7 @@ static void OneDevRegionNegDim(wxDC& dc, const wxBitmap& bmp, bool checkExtCoord
{ {
#if wxUSE_DC_TRANSFORM_MATRIX #if wxUSE_DC_TRANSFORM_MATRIX
if ( useTransformMatrix & !dc.CanUseTransformMatrix() ) if ( useTransformMatrix & !dc.CanUseTransformMatrix() )
{
WARN("Skipping test because transform matrix is not supported.");
return; return;
}
#endif // wxUSE_DC_TRANSFORM_MATRIX #endif // wxUSE_DC_TRANSFORM_MATRIX
// Setting one clipping region in device coordinates // Setting one clipping region in device coordinates
@@ -1175,10 +1142,7 @@ static void OneDevRegionNonRect(wxDC& dc, const wxBitmap& bmp, bool checkExtCoor
{ {
#if wxUSE_DC_TRANSFORM_MATRIX #if wxUSE_DC_TRANSFORM_MATRIX
if ( useTransformMatrix & !dc.CanUseTransformMatrix() ) if ( useTransformMatrix & !dc.CanUseTransformMatrix() )
{
WARN("Skipping test because transform matrix is not supported.");
return; return;
}
#endif // wxUSE_DC_TRANSFORM_MATRIX #endif // wxUSE_DC_TRANSFORM_MATRIX
// Setting one triangular clipping region in device coordinates. // Setting one triangular clipping region in device coordinates.
@@ -1263,10 +1227,7 @@ static void OneDevRegionAndReset(wxDC& dc, const wxBitmap& bmp, bool checkExtCoo
{ {
#if wxUSE_DC_TRANSFORM_MATRIX #if wxUSE_DC_TRANSFORM_MATRIX
if ( useTransformMatrix & !dc.CanUseTransformMatrix() ) if ( useTransformMatrix & !dc.CanUseTransformMatrix() )
{
WARN("Skipping test because transform matrix is not supported.");
return; return;
}
#endif // wxUSE_DC_TRANSFORM_MATRIX #endif // wxUSE_DC_TRANSFORM_MATRIX
// Setting one clipping region in device coordinates // Setting one clipping region in device coordinates
@@ -1316,10 +1277,7 @@ static void OneDevRegionAndEmpty(wxDC& dc, const wxBitmap& bmp, bool useTransfor
{ {
#if wxUSE_DC_TRANSFORM_MATRIX #if wxUSE_DC_TRANSFORM_MATRIX
if ( useTransformMatrix & !dc.CanUseTransformMatrix() ) if ( useTransformMatrix & !dc.CanUseTransformMatrix() )
{
WARN("Skipping test because transform matrix is not supported.");
return; return;
}
#endif // wxUSE_DC_TRANSFORM_MATRIX #endif // wxUSE_DC_TRANSFORM_MATRIX
// Setting one clipping region in device coordinates // Setting one clipping region in device coordinates
@@ -1356,10 +1314,7 @@ static void OneDevRegionOverTransformedDC(wxDC& dc, const wxBitmap& bmp, bool ch
{ {
#if wxUSE_DC_TRANSFORM_MATRIX #if wxUSE_DC_TRANSFORM_MATRIX
if ( useTransformMatrix & !dc.CanUseTransformMatrix() ) if ( useTransformMatrix & !dc.CanUseTransformMatrix() )
{
WARN("Skipping test because transform matrix is not supported.");
return; return;
}
#endif // wxUSE_DC_TRANSFORM_MATRIX #endif // wxUSE_DC_TRANSFORM_MATRIX
// Set one clipping region in device coordinates inside // Set one clipping region in device coordinates inside
@@ -1415,8 +1370,9 @@ static void OneDevRegionOverRotatedDC(wxDC& dc)
// Set one clipping region in device coordinates inside // Set one clipping region in device coordinates inside
// DC area with applied rotation transformation. // DC area with applied rotation transformation.
#if wxUSE_DC_TRANSFORM_MATRIX #if wxUSE_DC_TRANSFORM_MATRIX
if ( dc.CanUseTransformMatrix() ) if ( !dc.CanUseTransformMatrix() )
{ return;
// Setting one clipping region inside DC area. // Setting one clipping region inside DC area.
const int x = 8; const int x = 8;
const int y = 15; const int y = 15;
@@ -1476,11 +1432,6 @@ static void OneDevRegionOverRotatedDC(wxDC& dc)
int clipW = wxRound(x2) - wxRound(x1); int clipW = wxRound(x2) - wxRound(x1);
int clipH = wxRound(y2) - wxRound(y1); int clipH = wxRound(y2) - wxRound(y1);
CheckClipPos(dc, clipX, clipY, clipW, clipH, 1); CheckClipPos(dc, clipX, clipY, clipW, clipH, 1);
}
else
{
WARN("Skipping test because transform matrix is not supported.");
}
#endif // wxUSE_DC_TRANSFORM_MATRIX #endif // wxUSE_DC_TRANSFORM_MATRIX
} }
@@ -1488,10 +1439,7 @@ static void OneDevRegionAndDCTransformation(wxDC& dc, const wxBitmap& bmp, bool
{ {
#if wxUSE_DC_TRANSFORM_MATRIX #if wxUSE_DC_TRANSFORM_MATRIX
if ( useTransformMatrix & !dc.CanUseTransformMatrix() ) if ( useTransformMatrix & !dc.CanUseTransformMatrix() )
{
WARN("Skipping test because transform matrix is not supported.");
return; return;
}
#endif // wxUSE_DC_TRANSFORM_MATRIX #endif // wxUSE_DC_TRANSFORM_MATRIX
// Set one clipping region in device coordinates inside // Set one clipping region in device coordinates inside
@@ -1568,10 +1516,7 @@ static void TwoDevRegionsOverlapping(wxDC& dc, const wxBitmap& bmp, bool checkEx
{ {
#if wxUSE_DC_TRANSFORM_MATRIX #if wxUSE_DC_TRANSFORM_MATRIX
if ( useTransformMatrix & !dc.CanUseTransformMatrix() ) if ( useTransformMatrix & !dc.CanUseTransformMatrix() )
{
WARN("Skipping test because transform matrix is not supported.");
return; return;
}
#endif // wxUSE_DC_TRANSFORM_MATRIX #endif // wxUSE_DC_TRANSFORM_MATRIX
// Setting one clipping region in device coordinates // Setting one clipping region in device coordinates
@@ -1627,10 +1572,7 @@ static void TwoDevRegionsOverlappingNegDim(wxDC& dc, const wxBitmap& bmp, bool c
{ {
#if wxUSE_DC_TRANSFORM_MATRIX #if wxUSE_DC_TRANSFORM_MATRIX
if ( useTransformMatrix & !dc.CanUseTransformMatrix() ) if ( useTransformMatrix & !dc.CanUseTransformMatrix() )
{
WARN("Skipping test because transform matrix is not supported.");
return; return;
}
#endif // wxUSE_DC_TRANSFORM_MATRIX #endif // wxUSE_DC_TRANSFORM_MATRIX
// Setting one clipping region in device coordinates with negative size values // Setting one clipping region in device coordinates with negative size values
@@ -1696,10 +1638,7 @@ static void TwoDevRegionsNonOverlapping(wxDC& dc, const wxBitmap& bmp, bool useT
{ {
#if wxUSE_DC_TRANSFORM_MATRIX #if wxUSE_DC_TRANSFORM_MATRIX
if ( useTransformMatrix & !dc.CanUseTransformMatrix() ) if ( useTransformMatrix & !dc.CanUseTransformMatrix() )
{
WARN("Skipping test because transform matrix is not supported.");
return; return;
}
#endif // wxUSE_DC_TRANSFORM_MATRIX #endif // wxUSE_DC_TRANSFORM_MATRIX
// Setting one clipping region in device coordinates // Setting one clipping region in device coordinates
@@ -1740,10 +1679,7 @@ static void TwoDevRegionsNonOverlappingNegDim(wxDC& dc, const wxBitmap& bmp, boo
{ {
#if wxUSE_DC_TRANSFORM_MATRIX #if wxUSE_DC_TRANSFORM_MATRIX
if ( useTransformMatrix & !dc.CanUseTransformMatrix() ) if ( useTransformMatrix & !dc.CanUseTransformMatrix() )
{
WARN("Skipping test because transform matrix is not supported.");
return; return;
}
#endif // wxUSE_DC_TRANSFORM_MATRIX #endif // wxUSE_DC_TRANSFORM_MATRIX
// Setting one clipping region in device coordinates with negative size values // Setting one clipping region in device coordinates with negative size values