From 1b9ff6a2dfc31781697afb26a35fd50bb14b79ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 5 Jan 2014 20:25:39 +0100 Subject: [PATCH] Test Mesh::indexSize(). I wonder if it is possible to test the function even more. --- src/Test/MeshTest.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Test/MeshTest.cpp b/src/Test/MeshTest.cpp index afe8d57db..b3b4fe283 100644 --- a/src/Test/MeshTest.cpp +++ b/src/Test/MeshTest.cpp @@ -34,6 +34,8 @@ class MeshTest: public TestSuite::Tester { public: MeshTest(); + void indexSize(); + void debugPrimitive(); void debugIndexType(); void configurationPrimitive(); @@ -41,12 +43,20 @@ class MeshTest: public TestSuite::Tester { }; MeshTest::MeshTest() { - addTests({&MeshTest::debugPrimitive, + addTests({&MeshTest::indexSize, + + &MeshTest::debugPrimitive, &MeshTest::debugIndexType, &MeshTest::configurationPrimitive, &MeshTest::configurationIndexType}); } +void MeshTest::indexSize() { + CORRADE_COMPARE(Mesh::indexSize(Mesh::IndexType::UnsignedByte), 1); + CORRADE_COMPARE(Mesh::indexSize(Mesh::IndexType::UnsignedShort), 2); + CORRADE_COMPARE(Mesh::indexSize(Mesh::IndexType::UnsignedInt), 4); +} + void MeshTest::debugPrimitive() { std::ostringstream o; Debug(&o) << MeshPrimitive::TriangleFan;