|
|
|
@ -72,6 +72,7 @@ struct MeshDataTest: TestSuite::Tester { |
|
|
|
void constructArrayAttribute2DWrongSize(); |
|
|
|
void constructArrayAttribute2DWrongSize(); |
|
|
|
void constructArrayAttribute2DNonContiguous(); |
|
|
|
void constructArrayAttribute2DNonContiguous(); |
|
|
|
void constructArrayAttributeTypeErased(); |
|
|
|
void constructArrayAttributeTypeErased(); |
|
|
|
|
|
|
|
void constructArrayAttributeNullptr(); |
|
|
|
void constructArrayAttributeOffsetOnly(); |
|
|
|
void constructArrayAttributeOffsetOnly(); |
|
|
|
void constructArrayAttributeNotAllowed(); |
|
|
|
void constructArrayAttributeNotAllowed(); |
|
|
|
|
|
|
|
|
|
|
|
@ -231,6 +232,7 @@ MeshDataTest::MeshDataTest() { |
|
|
|
&MeshDataTest::constructArrayAttribute2DWrongSize, |
|
|
|
&MeshDataTest::constructArrayAttribute2DWrongSize, |
|
|
|
&MeshDataTest::constructArrayAttribute2DNonContiguous, |
|
|
|
&MeshDataTest::constructArrayAttribute2DNonContiguous, |
|
|
|
&MeshDataTest::constructArrayAttributeTypeErased, |
|
|
|
&MeshDataTest::constructArrayAttributeTypeErased, |
|
|
|
|
|
|
|
&MeshDataTest::constructArrayAttributeNullptr, |
|
|
|
&MeshDataTest::constructArrayAttributeOffsetOnly, |
|
|
|
&MeshDataTest::constructArrayAttributeOffsetOnly, |
|
|
|
&MeshDataTest::constructArrayAttributeNotAllowed}); |
|
|
|
&MeshDataTest::constructArrayAttributeNotAllowed}); |
|
|
|
|
|
|
|
|
|
|
|
@ -880,6 +882,15 @@ void MeshDataTest::constructArrayAttributeTypeErased() { |
|
|
|
CORRADE_COMPARE(data.data().stride(), sizeof(Vector2)*4); |
|
|
|
CORRADE_COMPARE(data.data().stride(), sizeof(Vector2)*4); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MeshDataTest::constructArrayAttributeNullptr() { |
|
|
|
|
|
|
|
MeshAttributeData positions{meshAttributeCustom(35), VertexFormat::Vector2, 4, nullptr}; |
|
|
|
|
|
|
|
CORRADE_VERIFY(!positions.isOffsetOnly()); |
|
|
|
|
|
|
|
CORRADE_COMPARE(positions.arraySize(), 4); |
|
|
|
|
|
|
|
CORRADE_COMPARE(positions.name(), meshAttributeCustom(35)); |
|
|
|
|
|
|
|
CORRADE_COMPARE(positions.format(), VertexFormat::Vector2); |
|
|
|
|
|
|
|
CORRADE_VERIFY(!positions.data().data()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void MeshDataTest::constructArrayAttributeOffsetOnly() { |
|
|
|
void MeshDataTest::constructArrayAttributeOffsetOnly() { |
|
|
|
MeshAttributeData data{meshAttributeCustom(35), VertexFormat::Vector2, sizeof(Vector2), 3, sizeof(Vector2), 4}; |
|
|
|
MeshAttributeData data{meshAttributeCustom(35), VertexFormat::Vector2, sizeof(Vector2), 3, sizeof(Vector2), 4}; |
|
|
|
CORRADE_VERIFY(data.isOffsetOnly()); |
|
|
|
CORRADE_VERIFY(data.isOffsetOnly()); |
|
|
|
|