Browse Source

Test: adapted for the upcoming asserting CORRADE_GRACEFUL_ASSERT.

mousecapture
Vladimír Vondruš 6 years ago
parent
commit
61af7672d1
  1. 42
      src/Magnum/GL/Test/PixelFormatTest.cpp
  2. 2
      src/Magnum/SceneGraph/Test/ObjectTest.cpp
  3. 24
      src/Magnum/Vk/Test/EnumsTest.cpp

42
src/Magnum/GL/Test/PixelFormatTest.cpp

@ -139,27 +139,39 @@ void PixelFormatTest::mapFormatTypeTextureFormat() {
++nextHandled; \
continue;
#define _n(format, expectedFormat, expectedType) \
case Magnum::PixelFormat::format: \
case Magnum::PixelFormat::format: { \
CORRADE_COMPARE(nextHandled, i); \
CORRADE_COMPARE(firstUnhandled, 0xffff); \
CORRADE_VERIFY(hasPixelFormat(Magnum::PixelFormat::format)); \
CORRADE_COMPARE(pixelFormat(Magnum::PixelFormat::format), Magnum::GL::PixelFormat::expectedFormat); \
CORRADE_COMPARE(pixelType(Magnum::PixelFormat::format), Magnum::GL::PixelType::expectedType); \
CORRADE_VERIFY(!hasTextureFormat(Magnum::PixelFormat::format)); \
textureFormat(Magnum::PixelFormat::format); \
std::ostringstream out; \
{ /* Redirected otherwise graceful assert would abort */ \
Error redirectError{&out}; \
textureFormat(Magnum::PixelFormat::format); \
} \
Debug{Debug::Flag::NoNewlineAtTheEnd} << out.str(); \
++nextHandled; \
continue;
continue; \
}
#define _s(format) \
case Magnum::PixelFormat::format: \
case Magnum::PixelFormat::format: { \
CORRADE_COMPARE(nextHandled, i); \
CORRADE_COMPARE(firstUnhandled, 0xffff); \
CORRADE_VERIFY(!hasPixelFormat(Magnum::PixelFormat::format)); \
CORRADE_VERIFY(!hasTextureFormat(Magnum::PixelFormat::format)); \
pixelFormat(Magnum::PixelFormat::format); \
pixelType(Magnum::PixelFormat::format); \
textureFormat(Magnum::PixelFormat::format); \
std::ostringstream out; \
{ /* Redirected otherwise graceful assert would abort */ \
Error redirectError{&out}; \
pixelFormat(Magnum::PixelFormat::format); \
pixelType(Magnum::PixelFormat::format); \
textureFormat(Magnum::PixelFormat::format); \
} \
Debug{Debug::Flag::NoNewlineAtTheEnd} << out.str(); \
++nextHandled; \
continue;
continue; \
}
#include "Magnum/GL/Implementation/pixelFormatMapping.hpp"
#undef _s
#undef _n
@ -348,15 +360,21 @@ void PixelFormatTest::mapCompressedFormatTextureFormat() {
++nextHandled; \
continue;
#define _s(format) \
case Magnum::CompressedPixelFormat::format: \
case Magnum::CompressedPixelFormat::format: { \
CORRADE_COMPARE(nextHandled, i); \
CORRADE_COMPARE(firstUnhandled, 0xffff); \
CORRADE_VERIFY(!hasCompressedPixelFormat(Magnum::CompressedPixelFormat::format)); \
CORRADE_VERIFY(!hasTextureFormat(Magnum::CompressedPixelFormat::format)); \
compressedPixelFormat(Magnum::CompressedPixelFormat::format); \
textureFormat(Magnum::CompressedPixelFormat::format); \
std::ostringstream out; \
{ /* Redirected otherwise graceful assert would abort */ \
Error redirectError{&out}; \
compressedPixelFormat(Magnum::CompressedPixelFormat::format); \
textureFormat(Magnum::CompressedPixelFormat::format); \
} \
Debug{Debug::Flag::NoNewlineAtTheEnd} << out.str(); \
++nextHandled; \
continue;
continue; \
}
#include "Magnum/GL/Implementation/compressedPixelFormatMapping.hpp"
#undef _s
#undef _c

2
src/Magnum/SceneGraph/Test/ObjectTest.cpp

@ -254,7 +254,7 @@ void ObjectTest::transformations() {
}
void ObjectTest::transformationsRelative() {
CORRADE_EXPECT_FAIL("Transformations not relative to scene are not yet implemented.");
CORRADE_SKIP("Transformations not relative to scene are not implemented yet.");
Scene3D s;
Object3D first(&s);

24
src/Magnum/Vk/Test/EnumsTest.cpp

@ -204,13 +204,19 @@ void EnumsTest::mapVkFormat() {
++nextHandled; \
continue;
#define _s(format) \
case Magnum::PixelFormat::format: \
case Magnum::PixelFormat::format: { \
CORRADE_COMPARE(nextHandled, i); \
CORRADE_COMPARE(firstUnhandled, 0xffff); \
CORRADE_VERIFY(!hasVkFormat(Magnum::PixelFormat::format)); \
vkFormat(Magnum::PixelFormat::format); \
std::ostringstream out; \
{ /* Redirected otherwise graceful assert would abort */ \
Error redirectError{&out}; \
vkFormat(Magnum::PixelFormat::format); \
} \
Debug{Debug::Flag::NoNewlineAtTheEnd} << out.str(); \
++nextHandled; \
continue;
continue; \
}
#include "Magnum/Vk/Implementation/formatMapping.hpp"
#undef _s
#undef _c
@ -292,13 +298,19 @@ void EnumsTest::mapVkFormatCompressed() {
++nextHandled; \
continue;
#define _s(format) \
case Magnum::CompressedPixelFormat::format: \
case Magnum::CompressedPixelFormat::format: { \
CORRADE_COMPARE(nextHandled, i); \
CORRADE_COMPARE(firstUnhandled, 0xffff); \
CORRADE_VERIFY(!hasVkFormat(Magnum::CompressedPixelFormat::format)); \
vkFormat(Magnum::CompressedPixelFormat::format); \
std::ostringstream out; \
{ /* Redirected otherwise graceful assert would abort */ \
Error redirectError{&out}; \
vkFormat(Magnum::CompressedPixelFormat::format); \
} \
Debug{Debug::Flag::NoNewlineAtTheEnd} << out.str(); \
++nextHandled; \
continue;
continue; \
}
#include "Magnum/Vk/Implementation/compressedFormatMapping.hpp"
#undef _s
#undef _c

Loading…
Cancel
Save