diff --git a/src/Magnum/Attribute.cpp b/src/Magnum/Attribute.cpp index 901aa2c53..f3177be70 100644 --- a/src/Magnum/Attribute.cpp +++ b/src/Magnum/Attribute.cpp @@ -147,7 +147,7 @@ Debug& operator<<(Debug& debug, SizedAttribute<1, 1>::Components value) { /* LCOV_EXCL_STOP */ } - return debug << "Attribute::Components::(invalid)"; + return debug << "Attribute::Components(" << Debug::nospace << reinterpret_cast(GLint(value)) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, SizedAttribute<1, 2>::Components value) { @@ -160,7 +160,7 @@ Debug& operator<<(Debug& debug, SizedAttribute<1, 2>::Components value) { /* LCOV_EXCL_STOP */ } - return debug << "Attribute::Components::(invalid)"; + return debug << "Attribute::Components(" << Debug::nospace << reinterpret_cast(GLint(value)) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, SizedAttribute<1, 3>::Components value) { @@ -175,7 +175,7 @@ Debug& operator<<(Debug& debug, SizedAttribute<1, 3>::Components value) { /* LCOV_EXCL_STOP */ } - return debug << "Attribute::Components::(invalid)"; + return debug << "Attribute::Components(" << Debug::nospace << reinterpret_cast(GLint(value)) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, SizedAttribute<1, 4>::Components value) { @@ -192,7 +192,7 @@ Debug& operator<<(Debug& debug, SizedAttribute<1, 4>::Components value) { /* LCOV_EXCL_STOP */ } - return debug << "Attribute::Components::(invalid)"; + return debug << "Attribute::Components(" << Debug::nospace << reinterpret_cast(GLint(value)) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, SizedMatrixAttribute<2>::Components value) { @@ -203,7 +203,7 @@ Debug& operator<<(Debug& debug, SizedMatrixAttribute<2>::Components value) { /* LCOV_EXCL_STOP */ } - return debug << "Attribute::Components::(invalid)"; + return debug << "Attribute::Components(" << Debug::nospace << reinterpret_cast(GLint(value)) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, SizedMatrixAttribute<3>::Components value) { @@ -214,7 +214,7 @@ Debug& operator<<(Debug& debug, SizedMatrixAttribute<3>::Components value) { /* LCOV_EXCL_STOP */ } - return debug << "Attribute::Components::(invalid)"; + return debug << "Attribute::Components(" << Debug::nospace << reinterpret_cast(GLint(value)) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, SizedMatrixAttribute<4>::Components value) { @@ -225,7 +225,7 @@ Debug& operator<<(Debug& debug, SizedMatrixAttribute<4>::Components value) { /* LCOV_EXCL_STOP */ } - return debug << "Attribute::Components::(invalid)"; + return debug << "Attribute::Components(" << Debug::nospace << reinterpret_cast(GLint(value)) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, Attribute>::Components value) { @@ -246,7 +246,7 @@ Debug& operator<<(Debug& debug, Attribute>::Components va /* LCOV_EXCL_STOP */ } - return debug << "Attribute::Components::(invalid)"; + return debug << "Attribute::Components(" << Debug::nospace << reinterpret_cast(GLint(value)) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, FloatAttribute::DataType value) { @@ -268,7 +268,7 @@ Debug& operator<<(Debug& debug, FloatAttribute::DataType value) { /* LCOV_EXCL_STOP */ } - return debug << "Attribute::DataType::(invalid)"; + return debug << "Attribute::DataType(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; } #ifndef MAGNUM_TARGET_GLES2 @@ -286,7 +286,7 @@ Debug& operator<<(Debug& debug, IntAttribute::DataType value) { /* LCOV_EXCL_STOP */ } - return debug << "Attribute::DataType::(invalid)"; + return debug << "Attribute::DataType(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; } #endif @@ -300,7 +300,7 @@ Debug& operator<<(Debug& debug, DoubleAttribute::DataType value) { /* LCOV_EXCL_STOP */ } - return debug << "Attribute::DataType::(invalid)"; + return debug << "Attribute::DataType(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; } #endif @@ -324,7 +324,7 @@ Debug& operator<<(Debug& debug, Attribute>::DataType valu /* LCOV_EXCL_STOP */ } - return debug << "Attribute::DataType::(invalid)"; + return debug << "Attribute::DataType(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, Attribute>::DataType value) { @@ -350,7 +350,7 @@ Debug& operator<<(Debug& debug, Attribute>::DataType valu /* LCOV_EXCL_STOP */ } - return debug << "Attribute::DataType::(invalid)"; + return debug << "Attribute::DataType(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; } }} diff --git a/src/Magnum/Audio/Buffer.cpp b/src/Magnum/Audio/Buffer.cpp index 8b0990d73..2ca64a6d0 100644 --- a/src/Magnum/Audio/Buffer.cpp +++ b/src/Magnum/Audio/Buffer.cpp @@ -46,7 +46,7 @@ Debug& operator<<(Debug& debug, const Buffer::Format value) { /* LCOV_EXCL_STOP */ } - return debug << "Audio::Buffer::Format::(invalid)"; + return debug << "Audio::Buffer::Format(" << Debug::nospace << reinterpret_cast(ALenum(value)) << Debug::nospace << ")"; } }} diff --git a/src/Magnum/Audio/Context.cpp b/src/Magnum/Audio/Context.cpp index 44855aac5..7ccb27479 100644 --- a/src/Magnum/Audio/Context.cpp +++ b/src/Magnum/Audio/Context.cpp @@ -67,7 +67,7 @@ Debug& operator<<(Debug& debug, const Context::HrtfStatus value) { /* LCOV_EXCL_STOP */ } - return debug << "Audio::Context::HrtfStatus::(invalid)"; + return debug << "Audio::Context::HrtfStatus(" << Debug::nospace << reinterpret_cast(ALenum(value)) << Debug::nospace << ")"; } Context* Context::_current = nullptr; diff --git a/src/Magnum/Audio/Renderer.cpp b/src/Magnum/Audio/Renderer.cpp index afe320893..69e7be426 100644 --- a/src/Magnum/Audio/Renderer.cpp +++ b/src/Magnum/Audio/Renderer.cpp @@ -43,7 +43,7 @@ Debug& operator<<(Debug& debug, const Renderer::Error value) { /* LCOV_EXCL_STOP */ } - return debug << "Audio::Renderer::Error::(invalid)"; + return debug << "Audio::Renderer::Error(" << Debug::nospace << reinterpret_cast(ALenum(value)) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const Renderer::DistanceModel value) { @@ -61,7 +61,7 @@ Debug& operator<<(Debug& debug, const Renderer::DistanceModel value) { /* LCOV_EXCL_STOP */ } - return debug << "Audio::Renderer::DistanceModel::(invalid)"; + return debug << "Audio::Renderer::DistanceModel(" << Debug::nospace << reinterpret_cast(ALenum(value)) << Debug::nospace << ")"; } }} diff --git a/src/Magnum/Audio/Source.cpp b/src/Magnum/Audio/Source.cpp index c659d6ab5..7c3554b15 100644 --- a/src/Magnum/Audio/Source.cpp +++ b/src/Magnum/Audio/Source.cpp @@ -108,7 +108,7 @@ Debug& operator<<(Debug& debug, const Source::State value) { /* LCOV_EXCL_STOP */ } - return debug << "Audio::Source::State::(invalid)"; + return debug << "Audio::Source::State(" << Debug::nospace << reinterpret_cast(ALint(value)) << Debug::nospace << ")"; } }} diff --git a/src/Magnum/Audio/Test/BufferTest.cpp b/src/Magnum/Audio/Test/BufferTest.cpp index 8de56d8b9..1522d1558 100644 --- a/src/Magnum/Audio/Test/BufferTest.cpp +++ b/src/Magnum/Audio/Test/BufferTest.cpp @@ -52,8 +52,8 @@ void BufferTest::construct() { void BufferTest::debugFormat() { std::ostringstream out; - Debug(&out) << Buffer::Format::Stereo16; - CORRADE_COMPARE(out.str(), "Audio::Buffer::Format::Stereo16\n"); + Debug(&out) << Buffer::Format::Stereo16 << Buffer::Format(0xdead); + CORRADE_COMPARE(out.str(), "Audio::Buffer::Format::Stereo16 Audio::Buffer::Format(0xdead)\n"); } }}} diff --git a/src/Magnum/Audio/Test/ContextTest.cpp b/src/Magnum/Audio/Test/ContextTest.cpp index bb15c2856..452ac51d8 100644 --- a/src/Magnum/Audio/Test/ContextTest.cpp +++ b/src/Magnum/Audio/Test/ContextTest.cpp @@ -37,8 +37,8 @@ struct ContextTest: TestSuite::Tester { void extensionsString(); void isExtensionEnabled(); - void hrtfStatus(); - void hrtfs(); + + void debugHrtfStatus(); Context _context; }; @@ -46,7 +46,8 @@ struct ContextTest: TestSuite::Tester { ContextTest::ContextTest() { addTests({&ContextTest::extensionsString, &ContextTest::isExtensionEnabled, - &ContextTest::hrtfStatus}); + + &ContextTest::debugHrtfStatus}); } void ContextTest::extensionsString() { @@ -59,10 +60,10 @@ void ContextTest::isExtensionEnabled() { CORRADE_VERIFY(Context::current().isExtensionSupported()); } -void ContextTest::hrtfStatus() { +void ContextTest::debugHrtfStatus() { std::ostringstream out; - Debug(&out) << Context::HrtfStatus::Denied; - CORRADE_COMPARE(out.str(), "Audio::Context::HrtfStatus::Denied\n"); + Debug(&out) << Context::HrtfStatus::Denied << Context::HrtfStatus(0xdead); + CORRADE_COMPARE(out.str(), "Audio::Context::HrtfStatus::Denied Audio::Context::HrtfStatus(0xdead)\n"); } }}} diff --git a/src/Magnum/Audio/Test/RendererTest.cpp b/src/Magnum/Audio/Test/RendererTest.cpp index 634865b82..123e07371 100644 --- a/src/Magnum/Audio/Test/RendererTest.cpp +++ b/src/Magnum/Audio/Test/RendererTest.cpp @@ -34,9 +34,6 @@ namespace Magnum { namespace Audio { namespace Test { struct RendererTest: TestSuite::Tester { explicit RendererTest(); - - void debugError(); - void debugDistanceModel(); void listenerOrientation(); void listenerPosition(); void listenerVelocity(); @@ -45,31 +42,23 @@ struct RendererTest: TestSuite::Tester { void dopplerFactor(); void distanceModel(); + void debugError(); + void debugDistanceModel(); + Context _context; }; RendererTest::RendererTest() { - addTests({&RendererTest::debugError, - &RendererTest::debugDistanceModel, - &RendererTest::listenerOrientation, + addTests({&RendererTest::listenerOrientation, &RendererTest::listenerPosition, &RendererTest::listenerVelocity, &RendererTest::listenerGain, &RendererTest::speedOfSound, &RendererTest::dopplerFactor, - &RendererTest::distanceModel}); -} + &RendererTest::distanceModel, -void RendererTest::debugError() { - std::ostringstream out; - Debug(&out) << Renderer::Error::InvalidOperation; - CORRADE_COMPARE(out.str(), "Audio::Renderer::Error::InvalidOperation\n"); -} - -void RendererTest::debugDistanceModel() { - std::ostringstream out; - Debug(&out) << Renderer::DistanceModel::Inverse; - CORRADE_COMPARE(out.str(), "Audio::Renderer::DistanceModel::Inverse\n"); + &RendererTest::debugError, + &RendererTest::debugDistanceModel}); } void RendererTest::listenerOrientation() { @@ -123,6 +112,18 @@ void RendererTest::distanceModel() { CORRADE_COMPARE(Renderer::distanceModel(), model); } +void RendererTest::debugError() { + std::ostringstream out; + Debug(&out) << Renderer::Error::InvalidOperation << Renderer::Error(0xdead); + CORRADE_COMPARE(out.str(), "Audio::Renderer::Error::InvalidOperation Audio::Renderer::Error(0xdead)\n"); +} + +void RendererTest::debugDistanceModel() { + std::ostringstream out; + Debug(&out) << Renderer::DistanceModel::Inverse << Renderer::DistanceModel(0xdead); + CORRADE_COMPARE(out.str(), "Audio::Renderer::DistanceModel::Inverse Audio::Renderer::DistanceModel(0xdead)\n"); +} + }}} CORRADE_TEST_MAIN(Magnum::Audio::Test::RendererTest) diff --git a/src/Magnum/Audio/Test/SourceTest.cpp b/src/Magnum/Audio/Test/SourceTest.cpp index 563d66c52..7b8dbb033 100644 --- a/src/Magnum/Audio/Test/SourceTest.cpp +++ b/src/Magnum/Audio/Test/SourceTest.cpp @@ -34,7 +34,6 @@ namespace Magnum { namespace Audio { namespace Test { struct SourceTest: TestSuite::Tester { explicit SourceTest(); - void debugState(); void position(); void direction(); void velocity(); @@ -47,12 +46,13 @@ struct SourceTest: TestSuite::Tester { void coneAnglesAndGain(); void rolloffFactor(); + void debugState(); + Context _context; }; SourceTest::SourceTest() { - addTests({&SourceTest::debugState, - &SourceTest::position, + addTests({&SourceTest::position, &SourceTest::direction, &SourceTest::velocity, &SourceTest::gain, @@ -62,13 +62,9 @@ SourceTest::SourceTest() { &SourceTest::maxGain, &SourceTest::minGain, &SourceTest::coneAnglesAndGain, - &SourceTest::rolloffFactor}); -} + &SourceTest::rolloffFactor, -void SourceTest::debugState() { - std::ostringstream out; - Debug(&out) << Source::State::Playing; - CORRADE_COMPARE(out.str(), "Audio::Source::State::Playing\n"); + &SourceTest::debugState}); } void SourceTest::position() { @@ -168,6 +164,11 @@ void SourceTest::rolloffFactor() { CORRADE_COMPARE(source.rolloffFactor(), fact); } +void SourceTest::debugState() { + std::ostringstream out; + Debug(&out) << Source::State::Playing << Source::State(0xdead); + CORRADE_COMPARE(out.str(), "Audio::Source::State::Playing Audio::Source::State(0xdead)\n"); +} }}} diff --git a/src/Magnum/Buffer.cpp b/src/Magnum/Buffer.cpp index b111181af..d36748df0 100644 --- a/src/Magnum/Buffer.cpp +++ b/src/Magnum/Buffer.cpp @@ -657,7 +657,7 @@ Debug& operator<<(Debug& debug, Buffer::TargetHint value) { /* LCOV_EXCL_STOP */ } - return debug << "Buffer::TargetHint::(invalid)"; + return debug << "Buffer::TargetHint(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; } #endif @@ -700,7 +700,7 @@ Debug& operator<<(Debug& debug, Buffer::Target value) { #endif } - return debug << "Buffer::Target::(invalid)"; + return debug << "Buffer::Target(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; } #endif #endif diff --git a/src/Magnum/Context.cpp b/src/Magnum/Context.cpp index 4d6095d23..9a37c40fd 100644 --- a/src/Magnum/Context.cpp +++ b/src/Magnum/Context.cpp @@ -841,7 +841,7 @@ Debug& operator<<(Debug& debug, const Context::Flag value) { /* LCOV_EXCL_STOP */ } - return debug << "Context::Flag::(invalid)"; + return debug << "Context::Flag(" << Debug::nospace << reinterpret_cast(GLint(value)) << Debug::nospace << ")"; } #endif #endif diff --git a/src/Magnum/DebugOutput.cpp b/src/Magnum/DebugOutput.cpp index a9e69bc3b..f9013ded3 100644 --- a/src/Magnum/DebugOutput.cpp +++ b/src/Magnum/DebugOutput.cpp @@ -239,7 +239,7 @@ Debug& operator<<(Debug& debug, const DebugOutput::Source value) { /* LCOV_EXCL_STOP */ } - return debug << "DebugOutput::Source::(invalid)"; + return debug << "DebugOutput::Source(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const DebugOutput::Type value) { @@ -259,7 +259,7 @@ Debug& operator<<(Debug& debug, const DebugOutput::Type value) { /* LCOV_EXCL_STOP */ } - return debug << "DebugOutput::Type::(invalid)"; + return debug << "DebugOutput::Type(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const DebugOutput::Severity value) { @@ -272,7 +272,7 @@ Debug& operator<<(Debug& debug, const DebugOutput::Severity value) { #undef _c } - return debug << "DebugOutput::Severity::(invalid)"; + return debug << "DebugOutput::Severity(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; } #endif @@ -333,7 +333,7 @@ Debug& operator<<(Debug& debug, const DebugMessage::Source value) { /* LCOV_EXCL_STOP */ } - return debug << "DebugMessage::Source::(invalid)"; + return debug << "DebugMessage::Source(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const DebugMessage::Type value) { @@ -349,7 +349,7 @@ Debug& operator<<(Debug& debug, const DebugMessage::Type value) { #undef _c } - return debug << "DebugMessage::Type::(invalid)"; + return debug << "DebugMessage::Type(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; } #endif @@ -440,7 +440,7 @@ Debug& operator<<(Debug& debug, const DebugGroup::Source value) { /* LCOV_EXCL_STOP */ } - return debug << "DebugGroup::Source::(invalid)"; + return debug << "DebugGroup::Source(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; } #endif diff --git a/src/Magnum/DefaultFramebuffer.cpp b/src/Magnum/DefaultFramebuffer.cpp index 2f980fe47..5129efb6b 100644 --- a/src/Magnum/DefaultFramebuffer.cpp +++ b/src/Magnum/DefaultFramebuffer.cpp @@ -127,7 +127,7 @@ Debug& operator<<(Debug& debug, const DefaultFramebuffer::Status value) { /* LCOV_EXCL_STOP */ } - return debug << "DefaultFramebuffer::Status::(invalid)"; + return debug << "DefaultFramebuffer::Status(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; } #endif diff --git a/src/Magnum/Framebuffer.cpp b/src/Magnum/Framebuffer.cpp index 7bc67dea3..5d05524e9 100644 --- a/src/Magnum/Framebuffer.cpp +++ b/src/Magnum/Framebuffer.cpp @@ -428,7 +428,7 @@ Debug& operator<<(Debug& debug, const Framebuffer::Status value) { /* LCOV_EXCL_STOP */ } - return debug << "Framebuffer::Status::(invalid)"; + return debug << "Framebuffer::Status(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; } #endif diff --git a/src/Magnum/Mesh.cpp b/src/Magnum/Mesh.cpp index b6799676c..9dd2c8070 100644 --- a/src/Magnum/Mesh.cpp +++ b/src/Magnum/Mesh.cpp @@ -659,7 +659,7 @@ Debug& operator<<(Debug& debug, MeshPrimitive value) { /* LCOV_EXCL_STOP */ } - return debug << "MeshPrimitive::(invalid)"; + return debug << "MeshPrimitive(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, Mesh::IndexType value) { @@ -673,7 +673,7 @@ Debug& operator<<(Debug& debug, Mesh::IndexType value) { /* LCOV_EXCL_STOP */ } - return debug << "Mesh::IndexType::(invalid)"; + return debug << "Mesh::IndexType(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; } #endif diff --git a/src/Magnum/PixelFormat.cpp b/src/Magnum/PixelFormat.cpp index 4fe23e67a..caea62d40 100644 --- a/src/Magnum/PixelFormat.cpp +++ b/src/Magnum/PixelFormat.cpp @@ -81,7 +81,7 @@ Debug& operator<<(Debug& debug, const PixelFormat value) { /* LCOV_EXCL_STOP */ } - return debug << "PixelFormat::(invalid)"; + return debug << "PixelFormat(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const PixelType value) { @@ -138,7 +138,7 @@ Debug& operator<<(Debug& debug, const PixelType value) { /* LCOV_EXCL_STOP */ } - return debug << "PixelType::(invalid)"; + return debug << "PixelType(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const CompressedPixelFormat value) { @@ -209,7 +209,7 @@ Debug& operator<<(Debug& debug, const CompressedPixelFormat value) { /* LCOV_EXCL_STOP */ } - return debug << "CompressedPixelFormat::(invalid)"; + return debug << "CompressedPixelFormat(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; } #endif diff --git a/src/Magnum/Renderer.cpp b/src/Magnum/Renderer.cpp index 0b1a7de29..2be283e8f 100644 --- a/src/Magnum/Renderer.cpp +++ b/src/Magnum/Renderer.cpp @@ -257,7 +257,7 @@ Debug& operator<<(Debug& debug, const Renderer::Error value) { /* LCOV_EXCL_STOP */ } - return debug << "Renderer::Error::(invalid)"; + return debug << "Renderer::Error(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; } #ifndef MAGNUM_TARGET_WEBGL @@ -271,7 +271,7 @@ Debug& operator<<(Debug& debug, const Renderer::ResetNotificationStrategy value) /* LCOV_EXCL_STOP */ } - return debug << "Renderer::ResetNotificationStrategy::(invalid)"; + return debug << "Renderer::ResetNotificationStrategy(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const Renderer::GraphicsResetStatus value) { @@ -286,7 +286,7 @@ Debug& operator<<(Debug& debug, const Renderer::GraphicsResetStatus value) { /* LCOV_EXCL_STOP */ } - return debug << "Renderer::ResetNotificationStrategy::(invalid)"; + return debug << "Renderer::GraphicsResetStatus(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; } #endif #endif diff --git a/src/Magnum/Resource.cpp b/src/Magnum/Resource.cpp index 5aac6adab..678453048 100644 --- a/src/Magnum/Resource.cpp +++ b/src/Magnum/Resource.cpp @@ -44,7 +44,7 @@ Debug& operator<<(Debug& debug, const ResourceState value) { /* LCOV_EXCL_STOP */ } - return debug << "ResourceState::(invalid)"; + return debug << "ResourceState(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; } #endif diff --git a/src/Magnum/Sampler.cpp b/src/Magnum/Sampler.cpp index fbf9e4740..f4cb95804 100644 --- a/src/Magnum/Sampler.cpp +++ b/src/Magnum/Sampler.cpp @@ -71,7 +71,7 @@ Debug& operator<<(Debug& debug, const Sampler::Filter value) { /* LCOV_EXCL_STOP */ } - return debug << "Sampler::Filter::(invalid)"; + return debug << "Sampler::Filter(" << Debug::nospace << reinterpret_cast(GLint(value)) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const Sampler::Mipmap value) { @@ -85,7 +85,7 @@ Debug& operator<<(Debug& debug, const Sampler::Mipmap value) { /* LCOV_EXCL_STOP */ } - return debug << "Sampler::Mipmap::(invalid)"; + return debug << "Sampler::Mipmap(" << Debug::nospace << reinterpret_cast(GLint(value)) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const Sampler::Wrapping value) { @@ -105,7 +105,7 @@ Debug& operator<<(Debug& debug, const Sampler::Wrapping value) { /* LCOV_EXCL_STOP */ } - return debug << "Sampler::Wrapping::(invalid)"; + return debug << "Sampler::Wrapping(" << Debug::nospace << reinterpret_cast(GLint(value)) << Debug::nospace << ")"; } #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) @@ -119,7 +119,7 @@ Debug& operator<<(Debug& debug, const Sampler::CompareMode value) { /* LCOV_EXCL_STOP */ } - return debug << "Sampler::CompareFunction::(invalid)"; + return debug << "Sampler::CompareMode(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const Sampler::CompareFunction value) { @@ -138,7 +138,7 @@ Debug& operator<<(Debug& debug, const Sampler::CompareFunction value) { /* LCOV_EXCL_STOP */ } - return debug << "Sampler::CompareFunction::(invalid)"; + return debug << "Sampler::CompareFunction(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; } #endif @@ -153,7 +153,7 @@ Debug& operator<<(Debug& debug, const Sampler::DepthStencilMode value) { /* LCOV_EXCL_STOP */ } - return debug << "Sampler::DepthStencilMode::(invalid)"; + return debug << "Sampler::DepthStencilMode(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; } #endif #endif diff --git a/src/Magnum/SceneGraph/Animable.cpp b/src/Magnum/SceneGraph/Animable.cpp index 504f3079c..6bbcb843a 100644 --- a/src/Magnum/SceneGraph/Animable.cpp +++ b/src/Magnum/SceneGraph/Animable.cpp @@ -40,7 +40,7 @@ Debug& operator<<(Debug& debug, AnimationState value) { /* LCOV_EXCL_STOP */ } - return debug << "SceneGraph::AnimationState::(invalid)"; + return debug << "SceneGraph::AnimationState(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; } }} diff --git a/src/Magnum/SceneGraph/Test/AnimableTest.cpp b/src/Magnum/SceneGraph/Test/AnimableTest.cpp index 844cc2090..28911e177 100644 --- a/src/Magnum/SceneGraph/Test/AnimableTest.cpp +++ b/src/Magnum/SceneGraph/Test/AnimableTest.cpp @@ -353,8 +353,8 @@ void AnimableTest::pause() { void AnimableTest::debug() { std::ostringstream o; - Debug(&o) << AnimationState::Running; - CORRADE_COMPARE(o.str(), "SceneGraph::AnimationState::Running\n"); + Debug(&o) << AnimationState::Running << AnimationState(0xbe); + CORRADE_COMPARE(o.str(), "SceneGraph::AnimationState::Running SceneGraph::AnimationState(0xbe)\n"); } }}} diff --git a/src/Magnum/Shader.cpp b/src/Magnum/Shader.cpp index e1435b542..cbb4b2963 100644 --- a/src/Magnum/Shader.cpp +++ b/src/Magnum/Shader.cpp @@ -906,7 +906,7 @@ Debug& operator<<(Debug& debug, const Shader::Type value) { /* LCOV_EXCL_STOP */ } - return debug << "Shader::Type::(invalid)"; + return debug << "Shader::Type(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; } #endif diff --git a/src/Magnum/Shapes/Test/ShapeImplementationTest.cpp b/src/Magnum/Shapes/Test/ShapeImplementationTest.cpp index 6f7d9f16c..f2efaf7cd 100644 --- a/src/Magnum/Shapes/Test/ShapeImplementationTest.cpp +++ b/src/Magnum/Shapes/Test/ShapeImplementationTest.cpp @@ -42,12 +42,12 @@ ShapeImplementationTest::ShapeImplementationTest() { void ShapeImplementationTest::debug() { std::ostringstream o; - Debug(&o) << Implementation::ShapeDimensionTraits<2>::Type::Composition; - CORRADE_COMPARE(o.str(), "Shapes::Shape2D::Type::Composition\n"); + Debug(&o) << Implementation::ShapeDimensionTraits<2>::Type::Composition << Implementation::ShapeDimensionTraits<2>::Type(0xbe); + CORRADE_COMPARE(o.str(), "Shapes::Shape2D::Type::Composition Shapes::Shape2D::Type(0xbe)\n"); o.str({}); - Debug(&o) << Implementation::ShapeDimensionTraits<3>::Type::Plane; - CORRADE_COMPARE(o.str(), "Shapes::Shape3D::Type::Plane\n"); + Debug(&o) << Implementation::ShapeDimensionTraits<3>::Type::Plane << Implementation::ShapeDimensionTraits<3>::Type(0xbe); + CORRADE_COMPARE(o.str(), "Shapes::Shape3D::Type::Plane Shapes::Shape3D::Type(0xbe)\n"); } }}} diff --git a/src/Magnum/Shapes/shapeImplementation.cpp b/src/Magnum/Shapes/shapeImplementation.cpp index f48741e4d..704efcf1c 100644 --- a/src/Magnum/Shapes/shapeImplementation.cpp +++ b/src/Magnum/Shapes/shapeImplementation.cpp @@ -47,7 +47,7 @@ Debug& operator<<(Debug& debug, ShapeDimensionTraits<2>::Type value) { /* LCOV_EXCL_STOP */ } - return debug << "Shapes::Shape2D::Type::(unknown)"; + return debug << "Shapes::Shape2D::Type(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, ShapeDimensionTraits<3>::Type value) { @@ -69,7 +69,7 @@ Debug& operator<<(Debug& debug, ShapeDimensionTraits<3>::Type value) { /* LCOV_EXCL_STOP */ } - return debug << "Shapes::Shape3D::Type::(unknown)"; + return debug << "Shapes::Shape3D::Type(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; } template AbstractShape::~AbstractShape() = default; diff --git a/src/Magnum/Test/AbstractShaderProgramTest.cpp b/src/Magnum/Test/AttributeTest.cpp similarity index 57% rename from src/Magnum/Test/AbstractShaderProgramTest.cpp rename to src/Magnum/Test/AttributeTest.cpp index 089b0f573..7c2a5e709 100644 --- a/src/Magnum/Test/AbstractShaderProgramTest.cpp +++ b/src/Magnum/Test/AttributeTest.cpp @@ -23,14 +23,15 @@ DEALINGS IN THE SOFTWARE. */ +#include #include #include "Magnum/AbstractShaderProgram.h" namespace Magnum { namespace Test { -struct AbstractShaderProgramTest: TestSuite::Tester { - explicit AbstractShaderProgramTest(); +struct AttributeTest: TestSuite::Tester { + explicit AttributeTest(); void attributeScalar(); void attributeScalarInt(); @@ -50,30 +51,70 @@ struct AbstractShaderProgramTest: TestSuite::Tester { #endif void attributeMatrixNxNd(); void attributeMatrixMxNd(); + + void debugComponents1(); + void debugComponents2(); + void debugComponents3(); + #ifndef MAGNUM_TARGET_GLES2 + void debugComponents4(); + #endif + void debugComponentsMatrix2(); + void debugComponentsMatrix3(); + void debugComponentsMatrix4(); + void debugComponentsVector4(); + void debugDataTypeFloat(); + #ifndef MAGNUM_TARGET_GLES2 + void debugDataTypeInt(); + #endif + #ifndef MAGNUM_TARGET_GLES + void debugDataTypeDouble(); + #endif + void debugDataTypeVector3(); + void debugDataTypeVector4(); }; -AbstractShaderProgramTest::AbstractShaderProgramTest() { - addTests({&AbstractShaderProgramTest::attributeScalar, - &AbstractShaderProgramTest::attributeScalarInt, - &AbstractShaderProgramTest::attributeScalarUnsignedInt, - &AbstractShaderProgramTest::attributeScalarDouble, +AttributeTest::AttributeTest() { + addTests({&AttributeTest::attributeScalar, + &AttributeTest::attributeScalarInt, + &AttributeTest::attributeScalarUnsignedInt, + &AttributeTest::attributeScalarDouble, - &AbstractShaderProgramTest::attributeVector, - &AbstractShaderProgramTest::attributeVectorInt, - &AbstractShaderProgramTest::attributeVectorUnsignedInt, - &AbstractShaderProgramTest::attributeVectorDouble, - &AbstractShaderProgramTest::attributeVector4, - &AbstractShaderProgramTest::attributeVectorBGRA, + &AttributeTest::attributeVector, + &AttributeTest::attributeVectorInt, + &AttributeTest::attributeVectorUnsignedInt, + &AttributeTest::attributeVectorDouble, + &AttributeTest::attributeVector4, + &AttributeTest::attributeVectorBGRA, - &AbstractShaderProgramTest::attributeMatrixNxN, + &AttributeTest::attributeMatrixNxN, #ifndef MAGNUM_TARGET_GLES2 - &AbstractShaderProgramTest::attributeMatrixMxN, + &AttributeTest::attributeMatrixMxN, #endif - &AbstractShaderProgramTest::attributeMatrixNxNd, - &AbstractShaderProgramTest::attributeMatrixMxNd}); + &AttributeTest::attributeMatrixNxNd, + &AttributeTest::attributeMatrixMxNd, + + &AttributeTest::debugComponents1, + &AttributeTest::debugComponents2, + &AttributeTest::debugComponents3, + #ifndef MAGNUM_TARGET_GLES2 + &AttributeTest::debugComponents4, + #endif + &AttributeTest::debugComponentsMatrix2, + &AttributeTest::debugComponentsMatrix3, + &AttributeTest::debugComponentsMatrix4, + &AttributeTest::debugComponentsVector4, + &AttributeTest::debugDataTypeFloat, + #ifndef MAGNUM_TARGET_GLES + &AttributeTest::debugDataTypeInt, + #endif + #ifndef MAGNUM_TARGET_GLES + &AttributeTest::debugDataTypeDouble, + #endif + &AttributeTest::debugDataTypeVector3, + &AttributeTest::debugDataTypeVector4}); } -void AbstractShaderProgramTest::attributeScalar() { +void AttributeTest::attributeScalar() { typedef Attribute<3, Float> Attribute; CORRADE_VERIFY((std::is_same{})); CORRADE_COMPARE(Attribute::Location, 3); @@ -92,7 +133,7 @@ void AbstractShaderProgramTest::attributeScalar() { CORRADE_VERIFY(b.dataOptions() <= Attribute::DataOption::Normalized); } -void AbstractShaderProgramTest::attributeScalarInt() { +void AttributeTest::attributeScalarInt() { #ifndef MAGNUM_TARGET_GLES2 typedef Attribute<3, Int> Attribute; CORRADE_VERIFY((std::is_same{})); @@ -110,7 +151,7 @@ void AbstractShaderProgramTest::attributeScalarInt() { #endif } -void AbstractShaderProgramTest::attributeScalarUnsignedInt() { +void AttributeTest::attributeScalarUnsignedInt() { #ifndef MAGNUM_TARGET_GLES2 typedef Attribute<3, UnsignedInt> Attribute; CORRADE_VERIFY((std::is_same{})); @@ -128,7 +169,7 @@ void AbstractShaderProgramTest::attributeScalarUnsignedInt() { #endif } -void AbstractShaderProgramTest::attributeScalarDouble() { +void AttributeTest::attributeScalarDouble() { #ifndef MAGNUM_TARGET_GLES typedef Attribute<3, Double> Attribute; CORRADE_VERIFY((std::is_same{})); @@ -142,7 +183,7 @@ void AbstractShaderProgramTest::attributeScalarDouble() { #endif } -void AbstractShaderProgramTest::attributeVector() { +void AttributeTest::attributeVector() { typedef Attribute<3, Vector3> Attribute; CORRADE_VERIFY((std::is_same{})); CORRADE_COMPARE(Attribute::VectorCount, 1); @@ -165,7 +206,7 @@ void AbstractShaderProgramTest::attributeVector() { #endif } -void AbstractShaderProgramTest::attributeVectorInt() { +void AttributeTest::attributeVectorInt() { #ifndef MAGNUM_TARGET_GLES2 typedef Attribute<3, Vector2i> Attribute; CORRADE_VERIFY((std::is_same{})); @@ -185,7 +226,7 @@ void AbstractShaderProgramTest::attributeVectorInt() { #endif } -void AbstractShaderProgramTest::attributeVectorUnsignedInt() { +void AttributeTest::attributeVectorUnsignedInt() { #ifndef MAGNUM_TARGET_GLES2 typedef Attribute<3, Vector4ui> Attribute; CORRADE_VERIFY((std::is_same{})); @@ -205,7 +246,7 @@ void AbstractShaderProgramTest::attributeVectorUnsignedInt() { #endif } -void AbstractShaderProgramTest::attributeVectorDouble() { +void AttributeTest::attributeVectorDouble() { #ifndef MAGNUM_TARGET_GLES typedef Attribute<3, Vector2d> Attribute; CORRADE_VERIFY((std::is_same{})); @@ -225,7 +266,7 @@ void AbstractShaderProgramTest::attributeVectorDouble() { #endif } -void AbstractShaderProgramTest::attributeVector4() { +void AttributeTest::attributeVector4() { typedef Attribute<3, Vector4> Attribute; CORRADE_VERIFY((std::is_same{})); CORRADE_COMPARE(Attribute::VectorCount, 1); @@ -240,7 +281,7 @@ void AbstractShaderProgramTest::attributeVector4() { #endif } -void AbstractShaderProgramTest::attributeVectorBGRA() { +void AttributeTest::attributeVectorBGRA() { #ifndef MAGNUM_TARGET_GLES typedef Attribute<3, Vector4> Attribute; CORRADE_VERIFY((std::is_same{})); @@ -254,7 +295,7 @@ void AbstractShaderProgramTest::attributeVectorBGRA() { #endif } -void AbstractShaderProgramTest::attributeMatrixNxN() { +void AttributeTest::attributeMatrixNxN() { typedef Attribute<3, Matrix3> Attribute; CORRADE_VERIFY((std::is_same{})); CORRADE_COMPARE(Attribute::VectorCount, 3); @@ -267,7 +308,7 @@ void AbstractShaderProgramTest::attributeMatrixNxN() { } #ifndef MAGNUM_TARGET_GLES2 -void AbstractShaderProgramTest::attributeMatrixMxN() { +void AttributeTest::attributeMatrixMxN() { typedef Attribute<3, Matrix3x4> Attribute; CORRADE_VERIFY((std::is_same{})); CORRADE_COMPARE(Attribute::VectorCount, 3); @@ -280,7 +321,7 @@ void AbstractShaderProgramTest::attributeMatrixMxN() { } #endif -void AbstractShaderProgramTest::attributeMatrixNxNd() { +void AttributeTest::attributeMatrixNxNd() { #ifndef MAGNUM_TARGET_GLES typedef Attribute<3, Matrix4d> Attribute; CORRADE_VERIFY((std::is_same{})); @@ -296,7 +337,7 @@ void AbstractShaderProgramTest::attributeMatrixNxNd() { #endif } -void AbstractShaderProgramTest::attributeMatrixMxNd() { +void AttributeTest::attributeMatrixMxNd() { #ifndef MAGNUM_TARGET_GLES typedef Attribute<3, Matrix4x2d> Attribute; CORRADE_VERIFY((std::is_same{})); @@ -312,6 +353,116 @@ void AbstractShaderProgramTest::attributeMatrixMxNd() { #endif } +void AttributeTest::debugComponents1() { + typedef Attribute<3, Float> Attribute; + + std::ostringstream out; + Debug{&out} << Attribute::Components::One << Attribute::Components(0xdead); + CORRADE_COMPARE(out.str(), "Attribute::Components::One Attribute::Components(0xdead)\n"); +} + +void AttributeTest::debugComponents2() { + typedef Attribute<3, Vector2> Attribute; + + std::ostringstream out; + Debug{&out} << Attribute::Components::Two << Attribute::Components(0xdead); + CORRADE_COMPARE(out.str(), "Attribute::Components::Two Attribute::Components(0xdead)\n"); +} + +void AttributeTest::debugComponents3() { + typedef Attribute<3, Vector3> Attribute; + + std::ostringstream out; + Debug{&out} << Attribute::Components::Three << Attribute::Components(0xdead); + CORRADE_COMPARE(out.str(), "Attribute::Components::Three Attribute::Components(0xdead)\n"); +} + +#ifndef MAGNUM_TARGET_GLES2 +void AttributeTest::debugComponents4() { + typedef Attribute<3, Vector4i> Attribute; + + std::ostringstream out; + Debug{&out} << Attribute::Components::Four << Attribute::Components(0xdead); + CORRADE_COMPARE(out.str(), "Attribute::Components::Four Attribute::Components(0xdead)\n"); +} +#endif + +void AttributeTest::debugComponentsMatrix2() { + typedef Attribute<3, Matrix2x2> Attribute; + + std::ostringstream out; + Debug{&out} << Attribute::Components::Two << Attribute::Components(0xdead); + CORRADE_COMPARE(out.str(), "Attribute::Components::Two Attribute::Components(0xdead)\n"); +} + +void AttributeTest::debugComponentsMatrix3() { + typedef Attribute<3, Matrix3> Attribute; + + std::ostringstream out; + Debug{&out} << Attribute::Components::Three << Attribute::Components(0xdead); + CORRADE_COMPARE(out.str(), "Attribute::Components::Three Attribute::Components(0xdead)\n"); +} + +void AttributeTest::debugComponentsMatrix4() { + typedef Attribute<3, Matrix4> Attribute; + + std::ostringstream out; + Debug{&out} << Attribute::Components::Four << Attribute::Components(0xdead); + CORRADE_COMPARE(out.str(), "Attribute::Components::Four Attribute::Components(0xdead)\n"); +} + +void AttributeTest::debugComponentsVector4() { + typedef Attribute<3, Vector4> Attribute; + + std::ostringstream out; + Debug{&out} << Attribute::Components::Three << Attribute::Components(0xdead); + CORRADE_COMPARE(out.str(), "Attribute::Components::Three Attribute::Components(0xdead)\n"); +} + +void AttributeTest::debugDataTypeFloat() { + typedef Attribute<3, Float> Attribute; + + std::ostringstream out; + Debug{&out} << Attribute::DataType::HalfFloat << Attribute::DataType(0xdead); + CORRADE_COMPARE(out.str(), "Attribute::DataType::HalfFloat Attribute::DataType(0xdead)\n"); +} + +#ifndef MAGNUM_TARGET_GLES2 +void AttributeTest::debugDataTypeInt() { + typedef Attribute<3, Int> Attribute; + + std::ostringstream out; + Debug{&out} << Attribute::DataType::Short << Attribute::DataType(0xdead); + CORRADE_COMPARE(out.str(), "Attribute::DataType::Short Attribute::DataType(0xdead)\n"); +} +#endif + +#ifndef MAGNUM_TARGET_GLES +void AttributeTest::debugDataTypeDouble() { + typedef Attribute<3, Double> Attribute; + + std::ostringstream out; + Debug{&out} << Attribute::DataType::Double << Attribute::DataType(0xdead); + CORRADE_COMPARE(out.str(), "Attribute::DataType::Double Attribute::DataType(0xdead)\n"); +} +#endif + +void AttributeTest::debugDataTypeVector3() { + typedef Attribute<3, Vector3> Attribute; + + std::ostringstream out; + Debug{&out} << Attribute::DataType::HalfFloat << Attribute::DataType(0xdead); + CORRADE_COMPARE(out.str(), "Attribute::DataType::HalfFloat Attribute::DataType(0xdead)\n"); +} + +void AttributeTest::debugDataTypeVector4() { + typedef Attribute<3, Vector4> Attribute; + + std::ostringstream out; + Debug{&out} << Attribute::DataType::HalfFloat << Attribute::DataType(0xdead); + CORRADE_COMPARE(out.str(), "Attribute::DataType::HalfFloat Attribute::DataType(0xdead)\n"); +} + }} -CORRADE_TEST_MAIN(Magnum::Test::AbstractShaderProgramTest) +CORRADE_TEST_MAIN(Magnum::Test::AttributeTest) diff --git a/src/Magnum/Test/BufferTest.cpp b/src/Magnum/Test/BufferTest.cpp new file mode 100644 index 000000000..f890f6485 --- /dev/null +++ b/src/Magnum/Test/BufferTest.cpp @@ -0,0 +1,67 @@ +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 + Vladimír Vondruš + Copyright © 2015 Jonathan Hale + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +#include +#include + +#include "Magnum/Buffer.h" + +namespace Magnum { namespace Test { + +struct BufferTest: TestSuite::Tester { + explicit BufferTest(); + + void debugTargetHint(); + #ifndef MAGNUM_TARGET_GLES2 + void debugTarget(); + #endif +}; + +BufferTest::BufferTest() { + addTests({&BufferTest::debugTargetHint, + #ifndef MAGNUM_TARGET_GLES2 + &BufferTest::debugTarget + #endif + }); +} + +void BufferTest::debugTargetHint() { + std::ostringstream out; + Debug{&out} << Buffer::TargetHint::Array << Buffer::TargetHint(0xdead); + CORRADE_COMPARE(out.str(), "Buffer::TargetHint::Array Buffer::TargetHint(0xdead)\n"); +} + +#ifndef MAGNUM_TARGET_GLES2 +void BufferTest::debugTarget() { + std::ostringstream out; + Debug{&out} << Buffer::Target::Uniform << Buffer::Target(0xdead); + CORRADE_COMPARE(out.str(), "Buffer::Target::Uniform Buffer::Target(0xdead)\n"); +} +#endif + +}} + +CORRADE_TEST_MAIN(Magnum::Test::BufferTest) diff --git a/src/Magnum/Test/CMakeLists.txt b/src/Magnum/Test/CMakeLists.txt index 8675864a1..e042bdb67 100644 --- a/src/Magnum/Test/CMakeLists.txt +++ b/src/Magnum/Test/CMakeLists.txt @@ -23,8 +23,9 @@ # DEALINGS IN THE SOFTWARE. # -corrade_add_test(AbstractShaderProgramTest AbstractShaderProgramTest.cpp LIBRARIES Magnum) corrade_add_test(ArrayTest ArrayTest.cpp LIBRARIES Magnum) +corrade_add_test(AttributeTest AttributeTest.cpp LIBRARIES Magnum) +corrade_add_test(BufferTest BufferTest.cpp LIBRARIES Magnum) corrade_add_test(FormatTest FormatTest.cpp LIBRARIES Magnum) corrade_add_test(ContextTest ContextTest.cpp LIBRARIES Magnum) if(NOT MAGNUM_TARGET_WEBGL) diff --git a/src/Magnum/Test/ContextTest.cpp b/src/Magnum/Test/ContextTest.cpp index 2a0927ca7..bad9274ee 100644 --- a/src/Magnum/Test/ContextTest.cpp +++ b/src/Magnum/Test/ContextTest.cpp @@ -45,8 +45,8 @@ void ContextTest::debugFlag() { CORRADE_SKIP("No context flags on Emscripten yet."); #else std::ostringstream out; - Debug(&out) << Context::Flag::Debug; - CORRADE_COMPARE(out.str(), "Context::Flag::Debug\n"); + Debug(&out) << Context::Flag::Debug << Context::Flag(0xdead); + CORRADE_COMPARE(out.str(), "Context::Flag::Debug Context::Flag(0xdead)\n"); #endif } diff --git a/src/Magnum/Test/DebugOutputTest.cpp b/src/Magnum/Test/DebugOutputTest.cpp index 2d33a04c9..1f9469bfb 100644 --- a/src/Magnum/Test/DebugOutputTest.cpp +++ b/src/Magnum/Test/DebugOutputTest.cpp @@ -56,38 +56,38 @@ DebugOutputTest::DebugOutputTest() { void DebugOutputTest::debugSource() { std::ostringstream o; - Debug(&o) << DebugOutput::Source::ShaderCompiler; - CORRADE_COMPARE(o.str(), "DebugOutput::Source::ShaderCompiler\n"); + Debug(&o) << DebugOutput::Source::ShaderCompiler << DebugOutput::Source(0xdead); + CORRADE_COMPARE(o.str(), "DebugOutput::Source::ShaderCompiler DebugOutput::Source(0xdead)\n"); } void DebugOutputTest::debugType() { std::ostringstream o; - Debug(&o) << DebugOutput::Type::PushGroup; - CORRADE_COMPARE(o.str(), "DebugOutput::Type::PushGroup\n"); + Debug(&o) << DebugOutput::Type::PushGroup << DebugOutput::Type(0xdead); + CORRADE_COMPARE(o.str(), "DebugOutput::Type::PushGroup DebugOutput::Type(0xdead)\n"); } void DebugOutputTest::debugSeverity() { std::ostringstream o; - Debug(&o) << DebugOutput::Severity::Notification; - CORRADE_COMPARE(o.str(), "DebugOutput::Severity::Notification\n"); + Debug(&o) << DebugOutput::Severity::Notification << DebugOutput::Severity(0xdead); + CORRADE_COMPARE(o.str(), "DebugOutput::Severity::Notification DebugOutput::Severity(0xdead)\n"); } void DebugOutputTest::debugMessageSource() { std::ostringstream o; - Debug(&o) << DebugMessage::Source::Application; - CORRADE_COMPARE(o.str(), "DebugMessage::Source::Application\n"); + Debug(&o) << DebugMessage::Source::Application << DebugMessage::Source(0xdead); + CORRADE_COMPARE(o.str(), "DebugMessage::Source::Application DebugMessage::Source(0xdead)\n"); } void DebugOutputTest::debugMessageType() { std::ostringstream o; - Debug(&o) << DebugMessage::Type::DeprecatedBehavior; - CORRADE_COMPARE(o.str(), "DebugMessage::Type::DeprecatedBehavior\n"); + Debug(&o) << DebugMessage::Type::DeprecatedBehavior << DebugMessage::Type(0xdead); + CORRADE_COMPARE(o.str(), "DebugMessage::Type::DeprecatedBehavior DebugMessage::Type(0xdead)\n"); } void DebugOutputTest::debugGroupSource() { std::ostringstream o; - Debug(&o) << DebugGroup::Source::ThirdParty; - CORRADE_COMPARE(o.str(), "DebugGroup::Source::ThirdParty\n"); + Debug(&o) << DebugGroup::Source::ThirdParty << DebugGroup::Source(0xdead); + CORRADE_COMPARE(o.str(), "DebugGroup::Source::ThirdParty DebugGroup::Source(0xdead)\n"); } }} diff --git a/src/Magnum/Test/DefaultFramebufferTest.cpp b/src/Magnum/Test/DefaultFramebufferTest.cpp index 98f64189a..31c41e5d3 100644 --- a/src/Magnum/Test/DefaultFramebufferTest.cpp +++ b/src/Magnum/Test/DefaultFramebufferTest.cpp @@ -43,8 +43,8 @@ DefaultFramebufferTest::DefaultFramebufferTest() { void DefaultFramebufferTest::debugStatus() { std::ostringstream out; - Debug(&out) << DefaultFramebuffer::Status::Complete; - CORRADE_COMPARE(out.str(), "DefaultFramebuffer::Status::Complete\n"); + Debug(&out) << DefaultFramebuffer::Status::Complete << DefaultFramebuffer::Status(0xdead); + CORRADE_COMPARE(out.str(), "DefaultFramebuffer::Status::Complete DefaultFramebuffer::Status(0xdead)\n"); } }} diff --git a/src/Magnum/Test/FormatTest.cpp b/src/Magnum/Test/FormatTest.cpp index 0e58cd210..d1ced28e7 100644 --- a/src/Magnum/Test/FormatTest.cpp +++ b/src/Magnum/Test/FormatTest.cpp @@ -47,15 +47,15 @@ FormatTest::FormatTest() { void FormatTest::debugPixelFormat() { std::ostringstream out; - Debug(&out) << PixelFormat::RGBA; - CORRADE_COMPARE(out.str(), "PixelFormat::RGBA\n"); + Debug(&out) << PixelFormat::RGBA << PixelFormat(0xdead); + CORRADE_COMPARE(out.str(), "PixelFormat::RGBA PixelFormat(0xdead)\n"); } void FormatTest::debugPixelType() { std::ostringstream out; - Debug(&out) << PixelType::UnsignedByte; - CORRADE_COMPARE(out.str(), "PixelType::UnsignedByte\n"); + Debug(&out) << PixelType::UnsignedByte << PixelType(0xdead); + CORRADE_COMPARE(out.str(), "PixelType::UnsignedByte PixelType(0xdead)\n"); } void FormatTest::debugCompressedPixelFormat() { @@ -64,8 +64,8 @@ void FormatTest::debugCompressedPixelFormat() { #else std::ostringstream out; - Debug(&out) << CompressedPixelFormat::RGBBptcUnsignedFloat; - CORRADE_COMPARE(out.str(), "CompressedPixelFormat::RGBBptcUnsignedFloat\n"); + Debug(&out) << CompressedPixelFormat::RGBBptcUnsignedFloat << CompressedPixelFormat(0xdead); + CORRADE_COMPARE(out.str(), "CompressedPixelFormat::RGBBptcUnsignedFloat CompressedPixelFormat(0xdead)\n"); #endif } diff --git a/src/Magnum/Test/FramebufferTest.cpp b/src/Magnum/Test/FramebufferTest.cpp index 2229721f5..f73180162 100644 --- a/src/Magnum/Test/FramebufferTest.cpp +++ b/src/Magnum/Test/FramebufferTest.cpp @@ -43,8 +43,8 @@ FramebufferTest::FramebufferTest() { void FramebufferTest::debugStatus() { std::ostringstream out; - Debug(&out) << Framebuffer::Status::IncompleteMissingAttachment; - CORRADE_COMPARE(out.str(), "Framebuffer::Status::IncompleteMissingAttachment\n"); + Debug(&out) << Framebuffer::Status::IncompleteMissingAttachment << Framebuffer::Status(0xdead); + CORRADE_COMPARE(out.str(), "Framebuffer::Status::IncompleteMissingAttachment Framebuffer::Status(0xdead)\n"); } }} diff --git a/src/Magnum/Test/MeshTest.cpp b/src/Magnum/Test/MeshTest.cpp index c4c382a05..9d58b17c6 100644 --- a/src/Magnum/Test/MeshTest.cpp +++ b/src/Magnum/Test/MeshTest.cpp @@ -59,14 +59,14 @@ void MeshTest::indexSize() { void MeshTest::debugPrimitive() { std::ostringstream o; - Debug(&o) << MeshPrimitive::TriangleFan; - CORRADE_COMPARE(o.str(), "MeshPrimitive::TriangleFan\n"); + Debug(&o) << MeshPrimitive::TriangleFan << MeshPrimitive(0xdead); + CORRADE_COMPARE(o.str(), "MeshPrimitive::TriangleFan MeshPrimitive(0xdead)\n"); } void MeshTest::debugIndexType() { std::ostringstream o; - Debug(&o) << Mesh::IndexType::UnsignedShort; - CORRADE_COMPARE(o.str(), "Mesh::IndexType::UnsignedShort\n"); + Debug(&o) << Mesh::IndexType::UnsignedShort << Mesh::IndexType(0xdead); + CORRADE_COMPARE(o.str(), "Mesh::IndexType::UnsignedShort Mesh::IndexType(0xdead)\n"); } void MeshTest::configurationPrimitive() { diff --git a/src/Magnum/Test/RendererTest.cpp b/src/Magnum/Test/RendererTest.cpp index 5564ccb3b..6c7665162 100644 --- a/src/Magnum/Test/RendererTest.cpp +++ b/src/Magnum/Test/RendererTest.cpp @@ -52,23 +52,23 @@ RendererTest::RendererTest() { void RendererTest::debugError() { std::ostringstream out; - Debug(&out) << Renderer::Error::InvalidOperation; - CORRADE_COMPARE(out.str(), "Renderer::Error::InvalidOperation\n"); + Debug(&out) << Renderer::Error::InvalidOperation << Renderer::Error(0xdead); + CORRADE_COMPARE(out.str(), "Renderer::Error::InvalidOperation Renderer::Error(0xdead)\n"); } #ifndef MAGNUM_TARGET_WEBGL void RendererTest::debugResetNotificationStrategy() { std::ostringstream out; - Debug(&out) << Renderer::ResetNotificationStrategy::LoseContextOnReset; - CORRADE_COMPARE(out.str(), "Renderer::ResetNotificationStrategy::LoseContextOnReset\n"); + Debug(&out) << Renderer::ResetNotificationStrategy::LoseContextOnReset << Renderer::ResetNotificationStrategy(0xdead); + CORRADE_COMPARE(out.str(), "Renderer::ResetNotificationStrategy::LoseContextOnReset Renderer::ResetNotificationStrategy(0xdead)\n"); } void RendererTest::debugGraphicsResetStatus() { std::ostringstream out; - Debug(&out) << Renderer::GraphicsResetStatus::GuiltyContextReset; - CORRADE_COMPARE(out.str(), "Renderer::GraphicsResetStatus::GuiltyContextReset\n"); + Debug(&out) << Renderer::GraphicsResetStatus::GuiltyContextReset << Renderer::GraphicsResetStatus(0xdead); + CORRADE_COMPARE(out.str(), "Renderer::GraphicsResetStatus::GuiltyContextReset Renderer::GraphicsResetStatus(0xdead)\n"); } #endif diff --git a/src/Magnum/Test/ResourceManagerTest.cpp b/src/Magnum/Test/ResourceManagerTest.cpp index 58d5d19ba..c35b07ffe 100644 --- a/src/Magnum/Test/ResourceManagerTest.cpp +++ b/src/Magnum/Test/ResourceManagerTest.cpp @@ -332,8 +332,8 @@ void ResourceManagerTest::loader() { void ResourceManagerTest::debugResourceState() { std::ostringstream out; - Debug{&out} << ResourceState::Loading; - CORRADE_COMPARE(out.str(), "ResourceState::Loading\n"); + Debug{&out} << ResourceState::Loading << ResourceState(0xbe); + CORRADE_COMPARE(out.str(), "ResourceState::Loading ResourceState(0xbe)\n"); } }} diff --git a/src/Magnum/Test/SamplerTest.cpp b/src/Magnum/Test/SamplerTest.cpp index a7e1a87f6..0d686aee1 100644 --- a/src/Magnum/Test/SamplerTest.cpp +++ b/src/Magnum/Test/SamplerTest.cpp @@ -62,37 +62,37 @@ SamplerTest::SamplerTest() { void SamplerTest::debugFilter() { std::ostringstream out; - Debug(&out) << Sampler::Filter::Linear; - CORRADE_COMPARE(out.str(), "Sampler::Filter::Linear\n"); + Debug(&out) << Sampler::Filter::Linear << Sampler::Filter(0xdead); + CORRADE_COMPARE(out.str(), "Sampler::Filter::Linear Sampler::Filter(0xdead)\n"); } void SamplerTest::debugMipmap() { std::ostringstream out; - Debug(&out) << Sampler::Mipmap::Base; - CORRADE_COMPARE(out.str(), "Sampler::Mipmap::Base\n"); + Debug(&out) << Sampler::Mipmap::Base << Sampler::Mipmap(0xdead); + CORRADE_COMPARE(out.str(), "Sampler::Mipmap::Base Sampler::Mipmap(0xdead)\n"); } void SamplerTest::debugWrapping() { std::ostringstream out; - Debug(&out) << Sampler::Wrapping::ClampToEdge; - CORRADE_COMPARE(out.str(), "Sampler::Wrapping::ClampToEdge\n"); + Debug(&out) << Sampler::Wrapping::ClampToEdge << Sampler::Wrapping(0xdead); + CORRADE_COMPARE(out.str(), "Sampler::Wrapping::ClampToEdge Sampler::Wrapping(0xdead)\n"); } #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) void SamplerTest::debugCompareMode() { std::ostringstream out; - Debug(&out) << Sampler::CompareMode::CompareRefToTexture; - CORRADE_COMPARE(out.str(), "Sampler::CompareMode::CompareRefToTexture\n"); + Debug(&out) << Sampler::CompareMode::CompareRefToTexture << Sampler::CompareMode(0xdead); + CORRADE_COMPARE(out.str(), "Sampler::CompareMode::CompareRefToTexture Sampler::CompareMode(0xdead)\n"); } void SamplerTest::debugCompareFunction() { std::ostringstream out; - Debug(&out) << Sampler::CompareFunction::GreaterOrEqual; - CORRADE_COMPARE(out.str(), "Sampler::CompareFunction::GreaterOrEqual\n"); + Debug(&out) << Sampler::CompareFunction::GreaterOrEqual << Sampler::CompareFunction(0xdead); + CORRADE_COMPARE(out.str(), "Sampler::CompareFunction::GreaterOrEqual Sampler::CompareFunction(0xdead)\n"); } #endif @@ -100,8 +100,8 @@ void SamplerTest::debugCompareFunction() { void SamplerTest::debugDepthStencilMode() { std::ostringstream out; - Debug(&out) << Sampler::DepthStencilMode::StencilIndex; - CORRADE_COMPARE(out.str(), "Sampler::DepthStencilMode::StencilIndex\n"); + Debug(&out) << Sampler::DepthStencilMode::StencilIndex << Sampler::DepthStencilMode(0xdead); + CORRADE_COMPARE(out.str(), "Sampler::DepthStencilMode::StencilIndex Sampler::DepthStencilMode(0xdead)\n"); } #endif diff --git a/src/Magnum/Test/ShaderTest.cpp b/src/Magnum/Test/ShaderTest.cpp index 6a1f928e1..aaa24a0cf 100644 --- a/src/Magnum/Test/ShaderTest.cpp +++ b/src/Magnum/Test/ShaderTest.cpp @@ -43,8 +43,8 @@ ShaderTest::ShaderTest() { void ShaderTest::debugType() { std::ostringstream out; - Debug(&out) << Shader::Type::Fragment; - CORRADE_COMPARE(out.str(), "Shader::Type::Fragment\n"); + Debug(&out) << Shader::Type::Fragment << Shader::Type(0xdead); + CORRADE_COMPARE(out.str(), "Shader::Type::Fragment Shader::Type(0xdead)\n"); } }} diff --git a/src/Magnum/Trade/AbstractMaterialData.cpp b/src/Magnum/Trade/AbstractMaterialData.cpp index 1e585630c..029004074 100644 --- a/src/Magnum/Trade/AbstractMaterialData.cpp +++ b/src/Magnum/Trade/AbstractMaterialData.cpp @@ -42,7 +42,7 @@ Debug& operator<<(Debug& debug, const MaterialType value) { /* LCOV_EXCL_STOP */ } - return debug << "Trade::MaterialType::(unknown)"; + return debug << "Trade::MaterialType(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; } }} diff --git a/src/Magnum/Trade/ObjectData2D.cpp b/src/Magnum/Trade/ObjectData2D.cpp index 7505e4528..52926b3ba 100644 --- a/src/Magnum/Trade/ObjectData2D.cpp +++ b/src/Magnum/Trade/ObjectData2D.cpp @@ -49,7 +49,7 @@ Debug& operator<<(Debug& debug, ObjectInstanceType2D value) { /* LCOV_EXCL_STOP */ } - return debug << "Trade::ObjectInstanceType2D::(invalid)"; + return debug << "Trade::ObjectInstanceType2D(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; } #endif diff --git a/src/Magnum/Trade/ObjectData3D.cpp b/src/Magnum/Trade/ObjectData3D.cpp index c86829bc2..d9d1d038e 100644 --- a/src/Magnum/Trade/ObjectData3D.cpp +++ b/src/Magnum/Trade/ObjectData3D.cpp @@ -50,7 +50,7 @@ Debug& operator<<(Debug& debug, ObjectInstanceType3D value) { /* LCOV_EXCL_STOP */ } - return debug << "Trade::ObjectInstanceType3D::(invalid)"; + return debug << "Trade::ObjectInstanceType3D(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; } #endif diff --git a/src/Magnum/Trade/Test/CMakeLists.txt b/src/Magnum/Trade/Test/CMakeLists.txt index 6cbc59e29..17e56b827 100644 --- a/src/Magnum/Trade/Test/CMakeLists.txt +++ b/src/Magnum/Trade/Test/CMakeLists.txt @@ -38,8 +38,8 @@ corrade_add_test(TradeAbstractImageConverterTest AbstractImageConverterTest.cpp target_include_directories(TradeAbstractImageConverterTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) corrade_add_test(TradeAbstractImporterTest AbstractImporterTest.cpp LIBRARIES Magnum) target_include_directories(TradeAbstractImporterTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) -corrade_add_test(TradeAbstractMaterialDataTest AbstractMaterialDataTest.cpp LIBRARIES Magnum) corrade_add_test(TradeImageDataTest ImageDataTest.cpp LIBRARIES Magnum) +corrade_add_test(TradeMaterialDataTest MaterialDataTest.cpp LIBRARIES Magnum) corrade_add_test(TradeObjectData2DTest ObjectData2DTest.cpp LIBRARIES Magnum) corrade_add_test(TradeObjectData3DTest ObjectData3DTest.cpp LIBRARIES Magnum) corrade_add_test(TradeTextureDataTest TextureDataTest.cpp LIBRARIES Magnum) diff --git a/src/Magnum/Trade/Test/AbstractMaterialDataTest.cpp b/src/Magnum/Trade/Test/MaterialDataTest.cpp similarity index 74% rename from src/Magnum/Trade/Test/AbstractMaterialDataTest.cpp rename to src/Magnum/Trade/Test/MaterialDataTest.cpp index 7d4054031..e87164b7d 100644 --- a/src/Magnum/Trade/Test/AbstractMaterialDataTest.cpp +++ b/src/Magnum/Trade/Test/MaterialDataTest.cpp @@ -26,28 +26,28 @@ #include #include -#include "Magnum/Trade/AbstractMaterialData.h" +#include "Magnum/Trade/PhongMaterialData.h" namespace Magnum { namespace Trade { namespace Test { -class AbstractMaterialDataTest: public TestSuite::Tester { +class MaterialDataTest: public TestSuite::Tester { public: - explicit AbstractMaterialDataTest(); + explicit MaterialDataTest(); - void debug(); + void debugType(); }; -AbstractMaterialDataTest::AbstractMaterialDataTest() { - addTests({&AbstractMaterialDataTest::debug}); +MaterialDataTest::MaterialDataTest() { + addTests({&MaterialDataTest::debugType}); } -void AbstractMaterialDataTest::debug() { +void MaterialDataTest::debugType() { std::ostringstream out; - Debug(&out) << MaterialType::Phong; - CORRADE_COMPARE(out.str(), "Trade::MaterialType::Phong\n"); + Debug(&out) << MaterialType::Phong << MaterialType(0xbe); + CORRADE_COMPARE(out.str(), "Trade::MaterialType::Phong Trade::MaterialType(0xbe)\n"); } }}} -CORRADE_TEST_MAIN(Magnum::Trade::Test::AbstractMaterialDataTest) +CORRADE_TEST_MAIN(Magnum::Trade::Test::MaterialDataTest) diff --git a/src/Magnum/Trade/Test/ObjectData2DTest.cpp b/src/Magnum/Trade/Test/ObjectData2DTest.cpp index fa65e8e78..8b83003ab 100644 --- a/src/Magnum/Trade/Test/ObjectData2DTest.cpp +++ b/src/Magnum/Trade/Test/ObjectData2DTest.cpp @@ -43,8 +43,8 @@ ObjectData2DTest::ObjectData2DTest() { void ObjectData2DTest::debug() { std::ostringstream o; - Debug(&o) << ObjectInstanceType2D::Empty; - CORRADE_COMPARE(o.str(), "Trade::ObjectInstanceType2D::Empty\n"); + Debug(&o) << ObjectInstanceType2D::Empty << ObjectInstanceType2D(0xbe); + CORRADE_COMPARE(o.str(), "Trade::ObjectInstanceType2D::Empty Trade::ObjectInstanceType2D(0xbe)\n"); } }}} diff --git a/src/Magnum/Trade/Test/ObjectData3DTest.cpp b/src/Magnum/Trade/Test/ObjectData3DTest.cpp index 4f5a0d674..54de14693 100644 --- a/src/Magnum/Trade/Test/ObjectData3DTest.cpp +++ b/src/Magnum/Trade/Test/ObjectData3DTest.cpp @@ -43,8 +43,8 @@ ObjectData3DTest::ObjectData3DTest() { void ObjectData3DTest::debug() { std::ostringstream o; - Debug(&o) << ObjectInstanceType3D::Light; - CORRADE_COMPARE(o.str(), "Trade::ObjectInstanceType3D::Light\n"); + Debug(&o) << ObjectInstanceType3D::Light << ObjectInstanceType3D(0xbe); + CORRADE_COMPARE(o.str(), "Trade::ObjectInstanceType3D::Light Trade::ObjectInstanceType3D(0xbe)\n"); } }}} diff --git a/src/Magnum/Trade/Test/TextureDataTest.cpp b/src/Magnum/Trade/Test/TextureDataTest.cpp index 30c0050c1..f14a0a98a 100644 --- a/src/Magnum/Trade/Test/TextureDataTest.cpp +++ b/src/Magnum/Trade/Test/TextureDataTest.cpp @@ -44,8 +44,8 @@ TextureDataTest::TextureDataTest() { void TextureDataTest::debug() { std::ostringstream out; - Debug(&out) << TextureData::Type::Texture3D; - CORRADE_COMPARE(out.str(), "Trade::TextureData::Type::Texture3D\n"); + Debug(&out) << TextureData::Type::Texture3D << TextureData::Type(0xbe); + CORRADE_COMPARE(out.str(), "Trade::TextureData::Type::Texture3D Trade::TextureData::Type(0xbe)\n"); } }}} diff --git a/src/Magnum/Trade/TextureData.cpp b/src/Magnum/Trade/TextureData.cpp index b646306b3..e1d4fcb2d 100644 --- a/src/Magnum/Trade/TextureData.cpp +++ b/src/Magnum/Trade/TextureData.cpp @@ -40,7 +40,7 @@ Debug& operator<<(Debug& debug, const TextureData::Type value) { /* LCOV_EXCL_STOP */ } - return debug << "Trade::TextureData::Type::(unknown)"; + return debug << "Trade::TextureData::Type(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; } #endif