summaryrefslogtreecommitdiff
path: root/src/import
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2022-09-26 20:10:54 -0500
committersanine <sanine.not@pm.me>2022-09-26 20:10:54 -0500
commit59b70e473e994d3efaa33f7a9e1e934fb3a8ca8b (patch)
tree70f8e788545f9b1c3156d7e15a4effdab09d56ce /src/import
parent60732c9489c89df2057b7f981253447eb7ccee63 (diff)
fix memory overflow bug in test_node_push and add import_scene.test.c
Diffstat (limited to 'src/import')
-rw-r--r--src/import/CMakeLists.txt1
-rw-r--r--src/import/import.c6
-rw-r--r--src/import/import.test.c2
-rw-r--r--src/import/import.test.h3
-rw-r--r--src/import/import_node.test.c1
-rw-r--r--src/import/import_scene.test.c13
6 files changed, 26 insertions, 0 deletions
diff --git a/src/import/CMakeLists.txt b/src/import/CMakeLists.txt
index 5b9238b..358e96c 100644
--- a/src/import/CMakeLists.txt
+++ b/src/import/CMakeLists.txt
@@ -9,4 +9,5 @@ target_sources(test PUBLIC
${CMAKE_CURRENT_LIST_DIR}/import.test.c
${CMAKE_CURRENT_LIST_DIR}/import_mesh.test.c
${CMAKE_CURRENT_LIST_DIR}/import_node.test.c
+ ${CMAKE_CURRENT_LIST_DIR}/import_scene.test.c
)
diff --git a/src/import/import.c b/src/import/import.c
index 400f1d9..8852c81 100644
--- a/src/import/import.c
+++ b/src/import/import.c
@@ -225,3 +225,9 @@ static void push_node(lua_State *L, struct aiNode *node)
lua_setfield(L, nodetbl, "children");
}
}
+
+
+static void push_scene(lua_State *L, struct aiNode *node)
+{
+
+}
diff --git a/src/import/import.test.c b/src/import/import.test.c
index 558398a..d002dba 100644
--- a/src/import/import.test.c
+++ b/src/import/import.test.c
@@ -14,4 +14,6 @@ void suite_import()
lily_run_test(test_push_mesh_uvs);
lily_run_test(test_push_node);
+
+ lily_run_test(test_push_scene);
}
diff --git a/src/import/import.test.h b/src/import/import.test.h
index 5aafdb3..3613187 100644
--- a/src/import/import.test.h
+++ b/src/import/import.test.h
@@ -15,4 +15,7 @@ void test_push_mesh_uvs();
/* node tests */
void test_push_node();
+/* scene tests */
+void test_push_scene();
+
#endif
diff --git a/src/import/import_node.test.c b/src/import/import_node.test.c
index 7c498a8..fed3125 100644
--- a/src/import/import_node.test.c
+++ b/src/import/import_node.test.c
@@ -42,6 +42,7 @@ void test_push_node()
struct aiNode nodeC;
struct aiNode *a_children[] = { &nodeC };
nodeA.mChildren = a_children;
+ nodeA.mNumChildren = 1;
nodeC.mMeshes = meshes + 7;
nodeC.mNumMeshes = 1;
nodeC.mChildren = NULL;
diff --git a/src/import/import_scene.test.c b/src/import/import_scene.test.c
new file mode 100644
index 0000000..72718eb
--- /dev/null
+++ b/src/import/import_scene.test.c
@@ -0,0 +1,13 @@
+#include <lua.h>
+#include <lauxlib.h>
+#include <assimp/scene.h>
+#include "test/lily-test.h"
+#include "import.test.h"
+
+
+#include "import.c"
+
+
+void test_push_scene()
+{
+}