|
|
|
@ -53,6 +53,10 @@ struct LineTest: TestSuite::Tester { |
|
|
|
|
|
|
|
|
|
|
|
void debugCapStyle(); |
|
|
|
void debugCapStyle(); |
|
|
|
void debugJoinStyle(); |
|
|
|
void debugJoinStyle(); |
|
|
|
|
|
|
|
void debugVertexAnnotation(); |
|
|
|
|
|
|
|
void debugVertexAnnotationPacked(); |
|
|
|
|
|
|
|
void debugVertexAnnotations(); |
|
|
|
|
|
|
|
void debugVertexAnnotationsPacked(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
using namespace Math::Literals; |
|
|
|
using namespace Math::Literals; |
|
|
|
@ -99,7 +103,11 @@ LineTest::LineTest() { |
|
|
|
Containers::arraySize(MaterialUniformSetMiterAngleLimitInvalidData)); |
|
|
|
Containers::arraySize(MaterialUniformSetMiterAngleLimitInvalidData)); |
|
|
|
|
|
|
|
|
|
|
|
addTests({&LineTest::debugCapStyle, |
|
|
|
addTests({&LineTest::debugCapStyle, |
|
|
|
&LineTest::debugJoinStyle}); |
|
|
|
&LineTest::debugJoinStyle, |
|
|
|
|
|
|
|
&LineTest::debugVertexAnnotation, |
|
|
|
|
|
|
|
&LineTest::debugVertexAnnotationPacked, |
|
|
|
|
|
|
|
&LineTest::debugVertexAnnotations, |
|
|
|
|
|
|
|
&LineTest::debugVertexAnnotationsPacked}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
template<class> struct UniformTraits; |
|
|
|
template<class> struct UniformTraits; |
|
|
|
@ -301,6 +309,36 @@ void LineTest::debugJoinStyle() { |
|
|
|
CORRADE_COMPARE(out.str(), "Shaders::LineJoinStyle::Bevel Shaders::LineJoinStyle(0xb0)\n"); |
|
|
|
CORRADE_COMPARE(out.str(), "Shaders::LineJoinStyle::Bevel Shaders::LineJoinStyle(0xb0)\n"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void LineTest::debugVertexAnnotation() { |
|
|
|
|
|
|
|
/* The values are guaranteed to fit into 8 bytes but the type itself is
|
|
|
|
|
|
|
|
32bit to avoid surprises when passing it to the default-constructed |
|
|
|
|
|
|
|
LineGL::Annotation attribute (which defaults to 32bit), so it should |
|
|
|
|
|
|
|
also print the whole 32bit value. */ |
|
|
|
|
|
|
|
std::ostringstream out; |
|
|
|
|
|
|
|
Debug{&out} << LineVertexAnnotation::Join << LineVertexAnnotation(0xcafecafe); |
|
|
|
|
|
|
|
CORRADE_COMPARE(out.str(), "Shaders::LineVertexAnnotation::Join Shaders::LineVertexAnnotation(0xcafecafe)\n"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void LineTest::debugVertexAnnotationPacked() { |
|
|
|
|
|
|
|
std::ostringstream out; |
|
|
|
|
|
|
|
/* Last is not packed, ones before should not make any flags persistent */ |
|
|
|
|
|
|
|
Debug{&out} << Debug::packed << LineVertexAnnotation::Join << Debug::packed << LineVertexAnnotation(0xcafecafe) << LineVertexAnnotation::Begin; |
|
|
|
|
|
|
|
CORRADE_COMPARE(out.str(), "Join 0xcafecafe Shaders::LineVertexAnnotation::Begin\n"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void LineTest::debugVertexAnnotations() { |
|
|
|
|
|
|
|
std::ostringstream out; |
|
|
|
|
|
|
|
Debug{&out} << (LineVertexAnnotation::Up|LineVertexAnnotation::Join|LineVertexAnnotation(0xb00)) << LineVertexAnnotations{}; |
|
|
|
|
|
|
|
CORRADE_COMPARE(out.str(), "Shaders::LineVertexAnnotation::Up|Shaders::LineVertexAnnotation::Join|Shaders::LineVertexAnnotation(0xb00) Shaders::LineVertexAnnotations{}\n"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void LineTest::debugVertexAnnotationsPacked() { |
|
|
|
|
|
|
|
std::ostringstream out; |
|
|
|
|
|
|
|
/* Last is not packed, ones before should not make any flags persistent */ |
|
|
|
|
|
|
|
Debug{&out} << Debug::packed << (LineVertexAnnotation::Up|LineVertexAnnotation::Join|LineVertexAnnotation(0xb00)) << Debug::packed << LineVertexAnnotations{} << LineVertexAnnotation::Begin; |
|
|
|
|
|
|
|
CORRADE_COMPARE(out.str(), "Up|Join|0xb00 {} Shaders::LineVertexAnnotation::Begin\n"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}}}} |
|
|
|
}}}} |
|
|
|
|
|
|
|
|
|
|
|
CORRADE_TEST_MAIN(Magnum::Shaders::Test::LineTest) |
|
|
|
CORRADE_TEST_MAIN(Magnum::Shaders::Test::LineTest) |
|
|
|
|