|
|
|
@ -58,6 +58,9 @@ struct MeshTest: TestSuite::Tester { |
|
|
|
void mapIndexTypeImplementationSpecific(); |
|
|
|
void mapIndexTypeImplementationSpecific(); |
|
|
|
void mapIndexTypeInvalid(); |
|
|
|
void mapIndexTypeInvalid(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void indexTypeSize(); |
|
|
|
|
|
|
|
void indexTypeSizeInvalid(); |
|
|
|
|
|
|
|
|
|
|
|
void debugPrimitive(); |
|
|
|
void debugPrimitive(); |
|
|
|
void debugIndexType(); |
|
|
|
void debugIndexType(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
@ -81,6 +84,9 @@ MeshTest::MeshTest() { |
|
|
|
&MeshTest::mapIndexTypeImplementationSpecific, |
|
|
|
&MeshTest::mapIndexTypeImplementationSpecific, |
|
|
|
&MeshTest::mapIndexTypeInvalid, |
|
|
|
&MeshTest::mapIndexTypeInvalid, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
&MeshTest::indexTypeSize, |
|
|
|
|
|
|
|
&MeshTest::indexTypeSizeInvalid, |
|
|
|
|
|
|
|
|
|
|
|
&MeshTest::debugPrimitive, |
|
|
|
&MeshTest::debugPrimitive, |
|
|
|
&MeshTest::debugIndexType}); |
|
|
|
&MeshTest::debugIndexType}); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -264,6 +270,24 @@ void MeshTest::mapIndexTypeInvalid() { |
|
|
|
"GL::meshIndexType(): invalid type MeshIndexType(0x12)\n"); |
|
|
|
"GL::meshIndexType(): invalid type MeshIndexType(0x12)\n"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MeshTest::indexTypeSize() { |
|
|
|
|
|
|
|
CORRADE_COMPARE(meshIndexTypeSize(MeshIndexType::UnsignedByte), 1); |
|
|
|
|
|
|
|
CORRADE_COMPARE(meshIndexTypeSize(MeshIndexType::UnsignedShort), 2); |
|
|
|
|
|
|
|
CORRADE_COMPARE(meshIndexTypeSize(MeshIndexType::UnsignedInt), 4); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MeshTest::indexTypeSizeInvalid() { |
|
|
|
|
|
|
|
CORRADE_SKIP_IF_NO_ASSERT(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::ostringstream out; |
|
|
|
|
|
|
|
Error redirectError{&out}; |
|
|
|
|
|
|
|
meshIndexTypeSize(MeshIndexType{}); |
|
|
|
|
|
|
|
meshIndexTypeSize(MeshIndexType(0xbadcafe)); |
|
|
|
|
|
|
|
CORRADE_COMPARE(out.str(), |
|
|
|
|
|
|
|
"GL::meshIndexTypeSize(): invalid type GL::MeshIndexType(0x0)\n" |
|
|
|
|
|
|
|
"GL::meshIndexTypeSize(): invalid type GL::MeshIndexType(0xbadcafe)\n"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void MeshTest::debugPrimitive() { |
|
|
|
void MeshTest::debugPrimitive() { |
|
|
|
std::ostringstream o; |
|
|
|
std::ostringstream o; |
|
|
|
Debug(&o) << MeshPrimitive::TriangleFan << MeshPrimitive(0xdead); |
|
|
|
Debug(&o) << MeshPrimitive::TriangleFan << MeshPrimitive(0xdead); |
|
|
|
|