From 8a0329009d890e547735d0e864d47a79176b0daf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 20 Jan 2025 17:54:24 +0100 Subject: [PATCH] Test: add an XFAIL for 1D image data size calculation. Instead of trying to hide the problem by crafting a specific alignment (that shouldn't be used for 1D at all). --- src/Magnum/Test/PixelStorageTest.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Magnum/Test/PixelStorageTest.cpp b/src/Magnum/Test/PixelStorageTest.cpp index 2658fe7c9..c4207eca8 100644 --- a/src/Magnum/Test/PixelStorageTest.cpp +++ b/src/Magnum/Test/PixelStorageTest.cpp @@ -178,11 +178,14 @@ void PixelStorageTest::dataPropertiesImageHeight() { void PixelStorageTest::dataSize1D() { const Image1D image{ - PixelStorage{}.setAlignment(2).setSkip({2, 0, 0}), + PixelStorage{}.setSkip({2, 0, 0}), PixelFormat::RGB8Unorm}; - CORRADE_COMPARE(Implementation::imageDataSizeFor(image, Math::Vector<1, Int>{3}), - 16); + { + CORRADE_EXPECT_FAIL("Data size in 1D takes alignment into account even though it shouldn't."); + CORRADE_COMPARE(Implementation::imageDataSizeFor<1>(image, 3), 15); + } + CORRADE_COMPARE(Implementation::imageDataSizeFor<1>(image, 3), 18); } void PixelStorageTest::dataSize2D() {