From 500e41e4a87ae4cecb08afb089e5aea3fbcd887d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 23 May 2022 14:05:00 +0200 Subject: [PATCH] DebugTools: adapt tests to buffer[Sub]Data() deprecation. --- src/Magnum/DebugTools/Test/BufferDataGLTest.cpp | 12 ++++++++---- src/Magnum/DebugTools/Test/TextureImageGLTest.cpp | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/Magnum/DebugTools/Test/BufferDataGLTest.cpp b/src/Magnum/DebugTools/Test/BufferDataGLTest.cpp index 05a5ae878..27a15ec76 100644 --- a/src/Magnum/DebugTools/Test/BufferDataGLTest.cpp +++ b/src/Magnum/DebugTools/Test/BufferDataGLTest.cpp @@ -59,9 +59,11 @@ void BufferDataGLTest::data() { GL::Buffer buffer; buffer.setData(Data, GL::BufferUsage::StaticDraw); - const Containers::Array contents = bufferData(buffer); + Containers::Array contents = bufferData(buffer); MAGNUM_VERIFY_NO_GL_ERROR(); - CORRADE_COMPARE_AS(contents, Containers::arrayView(Data), + CORRADE_COMPARE_AS( + Containers::arrayCast(contents), + Containers::arrayView(Data), TestSuite::Compare::Container); } @@ -76,9 +78,11 @@ void BufferDataGLTest::subData() { GL::Buffer buffer; buffer.setData(Data, GL::BufferUsage::StaticDraw); - const Containers::Array contents = bufferSubData(buffer, 4, 3); + Containers::Array contents = bufferSubData(buffer, 4, 12); MAGNUM_VERIFY_NO_GL_ERROR(); - CORRADE_COMPARE_AS(contents, Containers::arrayView(Data).slice(1, 4), + CORRADE_COMPARE_AS( + Containers::arrayCast(contents), + Containers::arrayView(Data).slice(1, 4), TestSuite::Compare::Container); } diff --git a/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp b/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp index 22458586d..7bfc0b3b3 100644 --- a/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp +++ b/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp @@ -117,13 +117,15 @@ void TextureImageGLTest::subImage2DBuffer() { texture.setImage(0, GL::TextureFormat::RGBA8, ImageView2D{GL::PixelFormat::RGBA, GL::PixelType::UnsignedByte, Vector2i{2}, Data2D}); GL::BufferImage2D image = textureSubImage(texture, 0, {{}, Vector2i{2}}, {GL::PixelFormat::RGBA, GL::PixelType::UnsignedByte}, GL::BufferUsage::StaticRead); - Containers::Array data = bufferData(image.buffer()); + Containers::Array data = bufferData(image.buffer()); MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{2}); CORRADE_COMPARE(image.format(), GL::PixelFormat::RGBA); CORRADE_COMPARE(image.type(), GL::PixelType::UnsignedByte); CORRADE_COMPARE(image.pixelSize(), 4); - CORRADE_COMPARE_AS(data, Containers::arrayView(Data2D), + CORRADE_COMPARE_AS( + Containers::arrayCast(data), + Containers::arrayView(Data2D), TestSuite::Compare::Container); } #endif @@ -188,13 +190,15 @@ void TextureImageGLTest::subImageCubeBuffer() { .setImage(GL::CubeMapCoordinate::NegativeZ, 0, GL::TextureFormat::RGBA8, view); GL::BufferImage2D image = textureSubImage(texture, GL::CubeMapCoordinate::PositiveX, 0, {{}, Vector2i{2}}, {GL::PixelFormat::RGBA, GL::PixelType::UnsignedByte}, GL::BufferUsage::StaticRead); - Containers::Array data = bufferData(image.buffer()); + Containers::Array data = bufferData(image.buffer()); MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{2}); CORRADE_COMPARE(image.format(), GL::PixelFormat::RGBA); CORRADE_COMPARE(image.type(), GL::PixelType::UnsignedByte); CORRADE_COMPARE(image.pixelSize(), 4); - CORRADE_COMPARE_AS(data, Containers::arrayView(Data2D), + CORRADE_COMPARE_AS( + Containers::arrayCast(data), + Containers::arrayView(Data2D), TestSuite::Compare::Container); } #endif