未验证 提交 7e6bac3e 编写于 作者: Z Zhaolong Xing 提交者: GitHub

Merge pull request #12479 from NHZlX/fix_gtest_test_eq_warning

fix warning
...@@ -116,8 +116,8 @@ TEST(GraphHelperTest, Basic) { ...@@ -116,8 +116,8 @@ TEST(GraphHelperTest, Basic) {
for (size_t i = 0; i < sorted.size(); ++i) { for (size_t i = 0; i < sorted.size(); ++i) {
node_map[sorted[i]->Name()] = i; node_map[sorted[i]->Name()] = i;
} }
ASSERT_EQ(node_map.at("op1"), 0); ASSERT_EQ(node_map.at("op1"), 0UL);
ASSERT_EQ(node_map.at("op2"), 1); ASSERT_EQ(node_map.at("op2"), 1UL);
ASSERT_TRUE(node_map.at("op3") < node_map.at("op5")); ASSERT_TRUE(node_map.at("op3") < node_map.at("op5"));
} }
} // namespace ir } // namespace ir
......
...@@ -97,15 +97,15 @@ TEST(GraphTest, Basic) { ...@@ -97,15 +97,15 @@ TEST(GraphTest, Basic) {
std::vector<ir::Node *> nodes(g->Nodes().begin(), g->Nodes().end()); std::vector<ir::Node *> nodes(g->Nodes().begin(), g->Nodes().end());
for (ir::Node *n : nodes) { for (ir::Node *n : nodes) {
if (n->Name() == "sum") { if (n->Name() == "sum") {
ASSERT_EQ(n->inputs.size(), 3); ASSERT_EQ(n->inputs.size(), 3UL);
ASSERT_EQ(n->outputs.size(), 1); ASSERT_EQ(n->outputs.size(), 1UL);
} else if (n->Name() == "test_a" || n->Name() == "test_b" || } else if (n->Name() == "test_a" || n->Name() == "test_b" ||
n->Name() == "test_c") { n->Name() == "test_c") {
ASSERT_EQ(n->inputs.size(), 0); ASSERT_EQ(n->inputs.size(), 0UL);
ASSERT_EQ(n->outputs.size(), 1); ASSERT_EQ(n->outputs.size(), 1UL);
} else if (n->Name() == "test_out") { } else if (n->Name() == "test_out") {
ASSERT_EQ(n->inputs.size(), 1); ASSERT_EQ(n->inputs.size(), 1UL);
ASSERT_EQ(n->outputs.size(), 0); ASSERT_EQ(n->outputs.size(), 0UL);
} }
} }
ASSERT_EQ(nodes.size(), 5); ASSERT_EQ(nodes.size(), 5);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册