Browse Source

Vk: shorten PixelFormat test cases.

I feel like I pushed too soon.
pull/494/head
Vladimír Vondruš 5 years ago
parent
commit
b46b59ebef
  1. 48
      src/Magnum/Vk/Test/PixelFormatTest.cpp

48
src/Magnum/Vk/Test/PixelFormatTest.cpp

@ -35,34 +35,34 @@ namespace Magnum { namespace Vk { namespace Test { namespace {
struct PixelFormatTest: TestSuite::Tester { struct PixelFormatTest: TestSuite::Tester {
explicit PixelFormatTest(); explicit PixelFormatTest();
void mapPixelFormat(); void map();
void mapPixelFormatImplementationSpecific(); void mapImplementationSpecific();
void mapPixelFormatUnsupported(); void mapUnsupported();
void mapPixelFormatInvalid(); void mapInvalid();
void mapCompressedPixelFormat(); void mapCompressed();
void mapCompressedPixelFormatImplementationSpecific(); void mapCompressedImplementationSpecific();
void mapCompressedPixelFormatUnsupported(); void mapCompressedUnsupported();
void mapCompressedPixelFormatInvalid(); void mapCompressedInvalid();
void debug(); void debug();
}; };
PixelFormatTest::PixelFormatTest() { PixelFormatTest::PixelFormatTest() {
addTests({&PixelFormatTest::mapPixelFormat, addTests({&PixelFormatTest::map,
&PixelFormatTest::mapPixelFormatImplementationSpecific, &PixelFormatTest::mapImplementationSpecific,
&PixelFormatTest::mapPixelFormatUnsupported, &PixelFormatTest::mapUnsupported,
&PixelFormatTest::mapPixelFormatInvalid, &PixelFormatTest::mapInvalid,
&PixelFormatTest::mapCompressedPixelFormat, &PixelFormatTest::mapCompressed,
&PixelFormatTest::mapCompressedPixelFormatImplementationSpecific, &PixelFormatTest::mapCompressedImplementationSpecific,
&PixelFormatTest::mapCompressedPixelFormatUnsupported, &PixelFormatTest::mapCompressedUnsupported,
&PixelFormatTest::mapCompressedPixelFormatInvalid, &PixelFormatTest::mapCompressedInvalid,
&PixelFormatTest::debug}); &PixelFormatTest::debug});
} }
void PixelFormatTest::mapPixelFormat() { void PixelFormatTest::map() {
/* Touchstone verification. Using Vulkan enums directly to sidestep /* Touchstone verification. Using Vulkan enums directly to sidestep
potential problems in enum mapping as well. */ potential problems in enum mapping as well. */
CORRADE_VERIFY(hasPixelFormat(Magnum::PixelFormat::RGBA8Unorm)); CORRADE_VERIFY(hasPixelFormat(Magnum::PixelFormat::RGBA8Unorm));
@ -123,13 +123,13 @@ void PixelFormatTest::mapPixelFormat() {
CORRADE_COMPARE(firstUnhandled, 0xffff); CORRADE_COMPARE(firstUnhandled, 0xffff);
} }
void PixelFormatTest::mapPixelFormatImplementationSpecific() { void PixelFormatTest::mapImplementationSpecific() {
CORRADE_VERIFY(hasPixelFormat(Magnum::pixelFormatWrap(VK_FORMAT_A8B8G8R8_SINT_PACK32))); CORRADE_VERIFY(hasPixelFormat(Magnum::pixelFormatWrap(VK_FORMAT_A8B8G8R8_SINT_PACK32)));
CORRADE_COMPARE(pixelFormat(Magnum::pixelFormatWrap(VK_FORMAT_A8B8G8R8_SINT_PACK32)), CORRADE_COMPARE(pixelFormat(Magnum::pixelFormatWrap(VK_FORMAT_A8B8G8R8_SINT_PACK32)),
PixelFormat(VK_FORMAT_A8B8G8R8_SINT_PACK32)); PixelFormat(VK_FORMAT_A8B8G8R8_SINT_PACK32));
} }
void PixelFormatTest::mapPixelFormatUnsupported() { void PixelFormatTest::mapUnsupported() {
#ifdef CORRADE_NO_ASSERT #ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif #endif
@ -145,7 +145,7 @@ void PixelFormatTest::mapPixelFormatUnsupported() {
#endif #endif
} }
void PixelFormatTest::mapPixelFormatInvalid() { void PixelFormatTest::mapInvalid() {
#ifdef CORRADE_NO_ASSERT #ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif #endif
@ -164,7 +164,7 @@ void PixelFormatTest::mapPixelFormatInvalid() {
"Vk::pixelFormat(): invalid format PixelFormat(0x123)\n"); "Vk::pixelFormat(): invalid format PixelFormat(0x123)\n");
} }
void PixelFormatTest::mapCompressedPixelFormat() { void PixelFormatTest::mapCompressed() {
/* Touchstone verification. Using Vulkan enums directly to sidestep /* Touchstone verification. Using Vulkan enums directly to sidestep
potential problems in enum mapping as well. */ potential problems in enum mapping as well. */
CORRADE_VERIFY(hasPixelFormat(Magnum::CompressedPixelFormat::Bc1RGBAUnorm)); CORRADE_VERIFY(hasPixelFormat(Magnum::CompressedPixelFormat::Bc1RGBAUnorm));
@ -225,13 +225,13 @@ void PixelFormatTest::mapCompressedPixelFormat() {
CORRADE_COMPARE(firstUnhandled, 0xffff); CORRADE_COMPARE(firstUnhandled, 0xffff);
} }
void PixelFormatTest::mapCompressedPixelFormatImplementationSpecific() { void PixelFormatTest::mapCompressedImplementationSpecific() {
CORRADE_VERIFY(hasPixelFormat(Magnum::compressedPixelFormatWrap(VK_FORMAT_ASTC_10x6_UNORM_BLOCK))); CORRADE_VERIFY(hasPixelFormat(Magnum::compressedPixelFormatWrap(VK_FORMAT_ASTC_10x6_UNORM_BLOCK)));
CORRADE_COMPARE(pixelFormat(Magnum::compressedPixelFormatWrap(VK_FORMAT_ASTC_10x6_UNORM_BLOCK)), CORRADE_COMPARE(pixelFormat(Magnum::compressedPixelFormatWrap(VK_FORMAT_ASTC_10x6_UNORM_BLOCK)),
PixelFormat(VK_FORMAT_ASTC_10x6_UNORM_BLOCK)); PixelFormat(VK_FORMAT_ASTC_10x6_UNORM_BLOCK));
} }
void PixelFormatTest::mapCompressedPixelFormatUnsupported() { void PixelFormatTest::mapCompressedUnsupported() {
#ifdef CORRADE_NO_ASSERT #ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif #endif
@ -244,7 +244,7 @@ void PixelFormatTest::mapCompressedPixelFormatUnsupported() {
CORRADE_COMPARE(out.str(), "Vk::pixelFormat(): unsupported format CompressedPixelFormat::Astc3x3x3RGBAUnorm\n"); CORRADE_COMPARE(out.str(), "Vk::pixelFormat(): unsupported format CompressedPixelFormat::Astc3x3x3RGBAUnorm\n");
} }
void PixelFormatTest::mapCompressedPixelFormatInvalid() { void PixelFormatTest::mapCompressedInvalid() {
#ifdef CORRADE_NO_ASSERT #ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif #endif

Loading…
Cancel
Save