From a2749adf5dee5937100b435f876b52e364dc44d6 Mon Sep 17 00:00:00 2001 From: nhzlx Date: Tue, 31 Jul 2018 13:14:45 +0000 Subject: [PATCH] fix warning --- paddle/fluid/framework/ir/graph_helper_test.cc | 4 ++-- paddle/fluid/framework/ir/graph_test.cc | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/paddle/fluid/framework/ir/graph_helper_test.cc b/paddle/fluid/framework/ir/graph_helper_test.cc index b517442bb..a260dd3da 100644 --- a/paddle/fluid/framework/ir/graph_helper_test.cc +++ b/paddle/fluid/framework/ir/graph_helper_test.cc @@ -116,8 +116,8 @@ TEST(GraphHelperTest, Basic) { for (size_t i = 0; i < sorted.size(); ++i) { node_map[sorted[i]->Name()] = i; } - ASSERT_EQ(node_map.at("op1"), 0); - ASSERT_EQ(node_map.at("op2"), 1); + ASSERT_EQ(node_map.at("op1"), 0UL); + ASSERT_EQ(node_map.at("op2"), 1UL); ASSERT_TRUE(node_map.at("op3") < node_map.at("op5")); } } // namespace ir diff --git a/paddle/fluid/framework/ir/graph_test.cc b/paddle/fluid/framework/ir/graph_test.cc index 73ef55756..f9e6bdf36 100644 --- a/paddle/fluid/framework/ir/graph_test.cc +++ b/paddle/fluid/framework/ir/graph_test.cc @@ -97,15 +97,15 @@ TEST(GraphTest, Basic) { std::vector nodes(g->Nodes().begin(), g->Nodes().end()); for (ir::Node *n : nodes) { if (n->Name() == "sum") { - ASSERT_EQ(n->inputs.size(), 3); - ASSERT_EQ(n->outputs.size(), 1); + ASSERT_EQ(n->inputs.size(), 3UL); + ASSERT_EQ(n->outputs.size(), 1UL); } else if (n->Name() == "test_a" || n->Name() == "test_b" || n->Name() == "test_c") { - ASSERT_EQ(n->inputs.size(), 0); - ASSERT_EQ(n->outputs.size(), 1); + ASSERT_EQ(n->inputs.size(), 0UL); + ASSERT_EQ(n->outputs.size(), 1UL); } else if (n->Name() == "test_out") { - ASSERT_EQ(n->inputs.size(), 1); - ASSERT_EQ(n->outputs.size(), 0); + ASSERT_EQ(n->inputs.size(), 1UL); + ASSERT_EQ(n->outputs.size(), 0UL); } } ASSERT_EQ(nodes.size(), 5); -- GitLab