Minor test cleanup.

AnimGraphEditor
Martin Felis 2022-02-19 12:18:54 +01:00
parent da916a7346
commit 618f6b613e
2 changed files with 6 additions and 8 deletions

View File

@ -154,7 +154,6 @@ struct NodeSocketAccessorBase {
const std::vector<Socket>& sockets, const std::vector<Socket>& sockets,
const std::string& name) const { const std::string& name) const {
for (size_t i = 0, n = sockets.size(); i < n; i++) { for (size_t i = 0, n = sockets.size(); i < n; i++) {
std::cout << i << ", " << sockets[i].m_name << std::endl;
if (sockets[i].m_name == name) { if (sockets[i].m_name == name) {
return i; return i;
} }

View File

@ -66,12 +66,6 @@ TEST_CASE("BasicGraph", "[AnimGraphResource]") {
AnimGraph graph = AnimGraph::createFromResource(graph_resource); AnimGraph graph = AnimGraph::createFromResource(graph_resource);
for (size_t i = 0; i < graph.m_nodes.size(); i++) {
const AnimNode* node = graph.m_nodes[i];
std::cout << node->m_name << " [" << node->m_node_type_name << "]"
<< std::endl;
}
REQUIRE(graph.m_nodes.size() == 5); REQUIRE(graph.m_nodes.size() == 5);
REQUIRE(graph.m_nodes[0]->m_node_type_name == "BlendTree"); REQUIRE(graph.m_nodes[0]->m_node_type_name == "BlendTree");
REQUIRE(graph.m_nodes[1]->m_node_type_name == "BlendTree"); REQUIRE(graph.m_nodes[1]->m_node_type_name == "BlendTree");
@ -411,6 +405,9 @@ TEST_CASE("GraphInputOutputConnectivity", "[AnimGraphResource]") {
AnimSamplerNode* sampler_node = dynamic_cast<AnimSamplerNode*>( AnimSamplerNode* sampler_node = dynamic_cast<AnimSamplerNode*>(
anim_graph.m_nodes[sampler_node_index]); anim_graph.m_nodes[sampler_node_index]);
//
// check connectivity
//
AnimData* graph_input0 = AnimData* graph_input0 =
(AnimData*)anim_graph.GetInput("GraphAnimInput0"); (AnimData*)anim_graph.GetInput("GraphAnimInput0");
REQUIRE(graph_input0 == &blend2_node->m_input0); REQUIRE(graph_input0 == &blend2_node->m_input0);
@ -439,7 +436,9 @@ TEST_CASE("GraphInputOutputConnectivity", "[AnimGraphResource]") {
anim_graph.m_nodes[blend2_node_index] anim_graph.m_nodes[blend2_node_index]
== anim_graph.getAnimNodeForInput(0, "GraphAnimOutput")); == anim_graph.getAnimNodeForInput(0, "GraphAnimOutput"));
// Check ordering //
// check ordering
//
REQUIRE (anim_graph.getAnimNodeOrderIndex(blend2_node) < anim_graph.getAnimNodeOrderIndex(sampler_node)); REQUIRE (anim_graph.getAnimNodeOrderIndex(blend2_node) < anim_graph.getAnimNodeOrderIndex(sampler_node));
REQUIRE (anim_graph.getAnimNodeOrderIndex(blend2_node) < anim_graph.getAnimNodeOrderIndex(speed_scale_node)); REQUIRE (anim_graph.getAnimNodeOrderIndex(blend2_node) < anim_graph.getAnimNodeOrderIndex(speed_scale_node));
REQUIRE (anim_graph.getAnimNodeOrderIndex(speed_scale_node) < anim_graph.getAnimNodeOrderIndex(sampler_node)); REQUIRE (anim_graph.getAnimNodeOrderIndex(speed_scale_node) < anim_graph.getAnimNodeOrderIndex(sampler_node));