Browse Source

Text: don't reuse the same pixel values in a test.

Could make bugs harder to discover this way.
pull/674/head
Vladimír Vondruš 1 year ago
parent
commit
aeedd681b2
  1. 20
      src/Magnum/Text/Test/GlyphCacheGLTest.cpp

20
src/Magnum/Text/Test/GlyphCacheGLTest.cpp

@ -243,8 +243,8 @@ void GlyphCacheGLTest::constructMove() {
const UnsignedByte InputData[]{ const UnsignedByte InputData[]{
0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff,
0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x00, 0xff, 0x11, 0xee, 0x22, 0xdd, 0x33, 0xcc,
0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x44, 0xbb, 0x55, 0xaa, 0x66, 0x99, 0x77, 0x88
}; };
const UnsignedByte ExpectedData[]{ const UnsignedByte ExpectedData[]{
@ -254,8 +254,8 @@ const UnsignedByte ExpectedData[]{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0, 0, 0, 0, 0, 0, 0, 0, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
0, 0, 0, 0, 0, 0, 0, 0, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff,
0, 0, 0, 0, 0, 0, 0, 0, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0, 0, 0, 0, 0, 0, 0, 0, 0x00, 0xff, 0x11, 0xee, 0x22, 0xdd, 0x33, 0xcc,
0, 0, 0, 0, 0, 0, 0, 0, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0x44, 0xbb, 0x55, 0xaa, 0x66, 0x99, 0x77, 0x88
}; };
void GlyphCacheGLTest::setImage() { void GlyphCacheGLTest::setImage() {
@ -280,14 +280,14 @@ void GlyphCacheGLTest::setImage() {
cache.flushImage(Range2Di::fromSize({8, 4}, {8, 4})); cache.flushImage(Range2Di::fromSize({8, 4}, {8, 4}));
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
MutableImageView3D actual3 = cache.image(); ImageView3D actual = cache.image();
/** @todo ugh have slicing on images directly already */
MutableImageView2D actual{actual3.format(), actual3.size().xy(), actual3.data()};
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
/* The CPU-side image is zero-initialized, what was set above in the /* The CPU-side image is zero-initialized, what was set above in the
texture isn't present there */ texture isn't present there */
CORRADE_COMPARE_AS(actual, /** @todo ugh have slicing on images directly already, and 3D image
comparison */
CORRADE_COMPARE_AS((ImageView2D{actual.format(), actual.size().xy(), actual.data()}),
(ImageView2D{PixelFormat::R8Unorm, {16, 8}, ExpectedData}), (ImageView2D{PixelFormat::R8Unorm, {16, 8}, ExpectedData}),
DebugTools::CompareImage); DebugTools::CompareImage);
@ -318,9 +318,9 @@ void GlyphCacheGLTest::setImage() {
0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0,
0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff,
0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0,
0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x00, 0xff, 0x11, 0xee, 0x22, 0xdd, 0x33, 0xcc,
0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0,
0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x44, 0xbb, 0x55, 0xaa, 0x66, 0x99, 0x77, 0x88
}; };
CORRADE_COMPARE_AS(image, CORRADE_COMPARE_AS(image,
(ImageView2D{PixelFormat::R8Unorm, {16, 8}, expectedTextureData}), (ImageView2D{PixelFormat::R8Unorm, {16, 8}, expectedTextureData}),

Loading…
Cancel
Save