Fix SDL warning (#6390)

This commit is contained in:
Hariharan Seshadri 2021-01-20 22:05:42 +05:30 committed by GitHub
parent d7bdd96425
commit a1b5bfc4f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -222,22 +222,29 @@ TEST(CseTests, Subgraph) {
}
}
// Assert that we were able to obtain subgraphs pertaining to the then/else attributes in the 'If' node
ASSERT_NE(if_true_graph, nullptr);
ASSERT_NE(if_false_graph, nullptr);
output_names = GetSortedNames(if_true_graph->GetOutputs());
ASSERT_EQ(output_names, (std::vector<std::string>{"Result1", "Result2", "Result3"}));
// Keep VC++ static analyzer happy
if (if_true_graph) {
output_names = GetSortedNames(if_true_graph->GetOutputs());
ASSERT_EQ(output_names, (std::vector<std::string>{"Result1", "Result2", "Result3"}));
auto op_count = CountOpsInGraph(*if_true_graph);
ASSERT_EQ(op_count["Mul"], 1);
ASSERT_EQ(op_count["Sum"], 3);
auto op_count = CountOpsInGraph(*if_true_graph);
ASSERT_EQ(op_count["Mul"], 1);
ASSERT_EQ(op_count["Sum"], 3);
}
output_names = GetSortedNames(if_false_graph->GetOutputs());
ASSERT_EQ(output_names, (std::vector<std::string>{"Result1", "Result2", "Result3"}));
// Keep VC++ static analyzer happy
if (if_false_graph) {
output_names = GetSortedNames(if_false_graph->GetOutputs());
ASSERT_EQ(output_names, (std::vector<std::string>{"Result1", "Result2", "Result3"}));
op_count = CountOpsInGraph(*if_false_graph);
ASSERT_EQ(op_count["Mul"], 3);
ASSERT_EQ(op_count["Sum"], 1);
auto op_count = CountOpsInGraph(*if_false_graph);
ASSERT_EQ(op_count["Mul"], 3);
ASSERT_EQ(op_count["Sum"], 1);
}
}
TEST(CseTests, MergedValueAndGraphOutputAreOutputsOfSameNode) {