summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-02-14 14:19:21 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-02-14 14:19:21 +0000
commitc08e33649931b679b17488ba6f7dab1d628213fd (patch)
tree76382c1740e4605667dce2fc74f03034f0b34960 /test
parentApply pitch to vehicles on a link (diff)
downloadilt-c08e33649931b679b17488ba6f7dab1d628213fd.tar.bz2
ilt-c08e33649931b679b17488ba6f7dab1d628213fd.tar.xz
ilt-c08e33649931b679b17488ba6f7dab1d628213fd.zip
Add our first vehicle
Diffstat (limited to 'test')
-rw-r--r--test/Jamfile.jam1
-rw-r--r--test/test-obj.cpp21
2 files changed, 22 insertions, 0 deletions
diff --git a/test/Jamfile.jam b/test/Jamfile.jam
index c6e6d5e..ffc1a19 100644
--- a/test/Jamfile.jam
+++ b/test/Jamfile.jam
@@ -15,4 +15,5 @@ project : requirements
;
run test-collection.cpp ;
+run test-obj.cpp ;
run test-maths.cpp ;
diff --git a/test/test-obj.cpp b/test/test-obj.cpp
new file mode 100644
index 0000000..337df99
--- /dev/null
+++ b/test/test-obj.cpp
@@ -0,0 +1,21 @@
+#define BOOST_TEST_MODULE test_obj
+
+#include <boost/test/unit_test.hpp>
+
+#include <gfx/models/obj.h>
+#include <memory>
+#include <vector>
+
+BOOST_AUTO_TEST_CASE(objparse)
+{
+ ObjParser op {"/home/randomdan/dev/game/res/brush47.obj"};
+ BOOST_REQUIRE_EQUAL(0, op.yylex());
+ BOOST_CHECK_EQUAL(48, op.vertices.size());
+ BOOST_CHECK_EQUAL(104, op.texCoords.size());
+ BOOST_CHECK_EQUAL(16, op.normals.size());
+ BOOST_CHECK_EQUAL(28, op.faces.size());
+ BOOST_CHECK_EQUAL(4, op.faces[0].size());
+ BOOST_CHECK_EQUAL(6, op.faces[10].size());
+ BOOST_CHECK_EQUAL(6, op.faces[11].size());
+ BOOST_CHECK_EQUAL(4, op.faces[12].size());
+}