From d500f604903d982c321851d3f108098ab8ff2608 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Lortie Date: Sat, 11 Mar 2023 20:48:17 -0500 Subject: [PATCH] Adjust emptyBonesNames test. --- .../ImportExport/MDL/utMDLImporter_HL1_Nodes.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test/unit/ImportExport/MDL/utMDLImporter_HL1_Nodes.cpp b/test/unit/ImportExport/MDL/utMDLImporter_HL1_Nodes.cpp index d2984477b..c94fa3f3f 100644 --- a/test/unit/ImportExport/MDL/utMDLImporter_HL1_Nodes.cpp +++ b/test/unit/ImportExport/MDL/utMDLImporter_HL1_Nodes.cpp @@ -143,7 +143,9 @@ public: "Bone_7" }; - expect_named_children(scene, AI_MDL_HL1_NODE_BONES, expected_bones_names); + std::vector actual_bones_names; + get_node_children_names(scene->mRootNode->FindNode(AI_MDL_HL1_NODE_BONES), actual_bones_names); + ASSERT_EQ(expected_bones_names, actual_bones_names); } /* Given a model with bodyparts that have empty names, @@ -479,6 +481,15 @@ private: flatten_hierarchy(node->mChildren[i], hierarchy, level + 1); } } + + void get_node_children_names(const aiNode *node, std::vector &names) + { + for (size_t i = 0; i < node->mNumChildren; ++i) + { + names.push_back(node->mChildren[i]->mName.C_Str()); + get_node_children_names(node->mChildren[i], names); + } + } }; TEST_F(utMDLImporter_HL1_Nodes, checkBoneHierarchy) {