diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-02-21 16:43:56 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-02-21 16:48:04 +0000 |
commit | 605db8cd3778bd2f58a956a0776c1001d7286def (patch) | |
tree | f7cad28fb8480cf6b7f11353907c4fed9856f04c /test | |
parent | fix.arc (diff) | |
download | ilt-605db8cd3778bd2f58a956a0776c1001d7286def.tar.bz2 ilt-605db8cd3778bd2f58a956a0776c1001d7286def.tar.xz ilt-605db8cd3778bd2f58a956a0776c1001d7286def.zip |
Named model parts, fix bogie spelling, new brush47 model
Diffstat (limited to 'test')
-rw-r--r-- | test/test-obj.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/test/test-obj.cpp b/test/test-obj.cpp index 4adc961..963a9ad 100644 --- a/test/test-obj.cpp +++ b/test/test-obj.cpp @@ -5,6 +5,7 @@ #include <gfx/models/obj.h> #include <gfx/models/vertex.hpp> #include <glm/glm.hpp> +#include <map> #include <memory> #include <utility> #include <vector> @@ -12,15 +13,15 @@ BOOST_AUTO_TEST_CASE(objparse) { ObjParser op {"/home/randomdan/dev/game/res/brush47.obj"}; - BOOST_CHECK_EQUAL(48, op.vertices.size()); - BOOST_CHECK_EQUAL(104, op.texCoords.size()); - BOOST_CHECK_EQUAL(25, op.normals.size()); + BOOST_CHECK_EQUAL(75, op.vertices.size()); + BOOST_CHECK_EQUAL(112, op.texCoords.size()); + BOOST_CHECK_EQUAL(31, op.normals.size()); BOOST_CHECK_EQUAL(3, op.objects.size()); const auto & object {op.objects.front()}; BOOST_CHECK_EQUAL("Body", object.first); - BOOST_CHECK_EQUAL(18, object.second.size()); - BOOST_CHECK_EQUAL(6, object.second[0].size()); - BOOST_CHECK_EQUAL(6, object.second[1].size()); + BOOST_CHECK_EQUAL(21, object.second.size()); + BOOST_CHECK_EQUAL(8, object.second[0].size()); + BOOST_CHECK_EQUAL(8, object.second[1].size()); BOOST_CHECK_EQUAL(4, object.second[12].size()); } @@ -29,9 +30,10 @@ BOOST_AUTO_TEST_CASE(create_meshes) ObjParser op {"/home/randomdan/dev/game/res/brush47.obj"}; const auto ms = op.createMeshData(); BOOST_REQUIRE_EQUAL(3, ms.size()); - BOOST_REQUIRE_EQUAL("Body", ms.front().first); - BOOST_REQUIRE_EQUAL(76, ms.front().second.first.size()); - const auto & v = ms.front().second.first.front(); + BOOST_REQUIRE_EQUAL("Body", ms.begin()->first); + const auto & o = ms.at("Body"); + BOOST_REQUIRE_EQUAL(88, o.first.size()); + const auto & v = o.first.front(); BOOST_REQUIRE_CLOSE(1.345, v.pos.x, 1); - BOOST_REQUIRE_EQUAL(120, ms.front().second.second.size()); + BOOST_REQUIRE_EQUAL(138, o.second.size()); } |