From 4feb98715ef3364d4009c597fa5a2f6f6c12e25c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 17 Oct 2023 18:31:53 +0200 Subject: [PATCH] TextureTools: expand DistanceField size assert tests. --- .../TextureTools/Test/DistanceFieldGLTest.cpp | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp b/src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp index 15e99a343..b3b8c4415 100644 --- a/src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp +++ b/src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp @@ -529,7 +529,34 @@ void DistanceFieldGLTest::sizeRatioNotMultipleOfTwo() { , Vector2i{23*14} #endif ); - CORRADE_COMPARE(out.str(), "TextureTools::DistanceField: expected input and output size ratio to be a multiple of 2, got {322, 322} and {46, 46}\n"); + /* Verify also just one axis wrong */ + distanceField(input, output, {{}, {23*2, 23}} + #ifdef MAGNUM_TARGET_GLES + , Vector2i{23*14} + #endif + ); + distanceField(input, output, {{}, {23, 23*2}} + #ifdef MAGNUM_TARGET_GLES + , Vector2i{23*14} + #endif + ); + /* Almost correct except that it's not an integer multiply */ + distanceField(input, output, {{}, {22, 23}} + #ifdef MAGNUM_TARGET_GLES + , Vector2i{23*14} + #endif + ); + distanceField(input, output, {{}, {23, 22}} + #ifdef MAGNUM_TARGET_GLES + , Vector2i{23*14} + #endif + ); + CORRADE_COMPARE(out.str(), + "TextureTools::DistanceField: expected input and output size ratio to be a multiple of 2, got {322, 322} and {46, 46}\n" + "TextureTools::DistanceField: expected input and output size ratio to be a multiple of 2, got {322, 322} and {46, 23}\n" + "TextureTools::DistanceField: expected input and output size ratio to be a multiple of 2, got {322, 322} and {23, 46}\n" + "TextureTools::DistanceField: expected input and output size ratio to be a multiple of 2, got {322, 322} and {22, 23}\n" + "TextureTools::DistanceField: expected input and output size ratio to be a multiple of 2, got {322, 322} and {23, 22}\n"); } #ifndef MAGNUM_TARGET_WEBGL