Browse Source

DebugTools: adapt tests to buffer[Sub]Data() deprecation.

gltestlib-symbol-duplication
Vladimír Vondruš 4 years ago
parent
commit
500e41e4a8
  1. 12
      src/Magnum/DebugTools/Test/BufferDataGLTest.cpp
  2. 12
      src/Magnum/DebugTools/Test/TextureImageGLTest.cpp

12
src/Magnum/DebugTools/Test/BufferDataGLTest.cpp

@ -59,9 +59,11 @@ void BufferDataGLTest::data() {
GL::Buffer buffer; GL::Buffer buffer;
buffer.setData(Data, GL::BufferUsage::StaticDraw); buffer.setData(Data, GL::BufferUsage::StaticDraw);
const Containers::Array<Int> contents = bufferData<Int>(buffer); Containers::Array<char> contents = bufferData(buffer);
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
CORRADE_COMPARE_AS(contents, Containers::arrayView(Data), CORRADE_COMPARE_AS(
Containers::arrayCast<Int>(contents),
Containers::arrayView(Data),
TestSuite::Compare::Container); TestSuite::Compare::Container);
} }
@ -76,9 +78,11 @@ void BufferDataGLTest::subData() {
GL::Buffer buffer; GL::Buffer buffer;
buffer.setData(Data, GL::BufferUsage::StaticDraw); buffer.setData(Data, GL::BufferUsage::StaticDraw);
const Containers::Array<Int> contents = bufferSubData<Int>(buffer, 4, 3); Containers::Array<char> contents = bufferSubData(buffer, 4, 12);
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
CORRADE_COMPARE_AS(contents, Containers::arrayView(Data).slice(1, 4), CORRADE_COMPARE_AS(
Containers::arrayCast<Int>(contents),
Containers::arrayView(Data).slice(1, 4),
TestSuite::Compare::Container); TestSuite::Compare::Container);
} }

12
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}); 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); GL::BufferImage2D image = textureSubImage(texture, 0, {{}, Vector2i{2}}, {GL::PixelFormat::RGBA, GL::PixelType::UnsignedByte}, GL::BufferUsage::StaticRead);
Containers::Array<UnsignedByte> data = bufferData<UnsignedByte>(image.buffer()); Containers::Array<char> data = bufferData(image.buffer());
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
CORRADE_COMPARE(image.size(), Vector2i{2}); CORRADE_COMPARE(image.size(), Vector2i{2});
CORRADE_COMPARE(image.format(), GL::PixelFormat::RGBA); CORRADE_COMPARE(image.format(), GL::PixelFormat::RGBA);
CORRADE_COMPARE(image.type(), GL::PixelType::UnsignedByte); CORRADE_COMPARE(image.type(), GL::PixelType::UnsignedByte);
CORRADE_COMPARE(image.pixelSize(), 4); CORRADE_COMPARE(image.pixelSize(), 4);
CORRADE_COMPARE_AS(data, Containers::arrayView(Data2D), CORRADE_COMPARE_AS(
Containers::arrayCast<UnsignedByte>(data),
Containers::arrayView(Data2D),
TestSuite::Compare::Container); TestSuite::Compare::Container);
} }
#endif #endif
@ -188,13 +190,15 @@ void TextureImageGLTest::subImageCubeBuffer() {
.setImage(GL::CubeMapCoordinate::NegativeZ, 0, GL::TextureFormat::RGBA8, view); .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); GL::BufferImage2D image = textureSubImage(texture, GL::CubeMapCoordinate::PositiveX, 0, {{}, Vector2i{2}}, {GL::PixelFormat::RGBA, GL::PixelType::UnsignedByte}, GL::BufferUsage::StaticRead);
Containers::Array<UnsignedByte> data = bufferData<UnsignedByte>(image.buffer()); Containers::Array<char> data = bufferData(image.buffer());
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
CORRADE_COMPARE(image.size(), Vector2i{2}); CORRADE_COMPARE(image.size(), Vector2i{2});
CORRADE_COMPARE(image.format(), GL::PixelFormat::RGBA); CORRADE_COMPARE(image.format(), GL::PixelFormat::RGBA);
CORRADE_COMPARE(image.type(), GL::PixelType::UnsignedByte); CORRADE_COMPARE(image.type(), GL::PixelType::UnsignedByte);
CORRADE_COMPARE(image.pixelSize(), 4); CORRADE_COMPARE(image.pixelSize(), 4);
CORRADE_COMPARE_AS(data, Containers::arrayView(Data2D), CORRADE_COMPARE_AS(
Containers::arrayCast<UnsignedByte>(data),
Containers::arrayView(Data2D),
TestSuite::Compare::Container); TestSuite::Compare::Container);
} }
#endif #endif

Loading…
Cancel
Save