Adjust emptyBonesNames test.

pull/5007/head
Marc-Antoine Lortie 2023-03-11 20:48:17 -05:00
parent 3c2a425869
commit d500f60490
1 changed files with 12 additions and 1 deletions

View File

@ -143,7 +143,9 @@ public:
"Bone_7"
};
expect_named_children(scene, AI_MDL_HL1_NODE_BONES, expected_bones_names);
std::vector<std::string> 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<std::string> &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) {