[logo] Revise test to use make_graph (#7371)
author박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Wed, 11 Sep 2019 05:23:33 +0000 (14:23 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Wed, 11 Sep 2019 05:23:33 +0000 (14:23 +0900)
This will revise ConstantFoldingPass test to use make_graph() method instead of using stack value

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
compiler/logo/src/Passes/ConstantFoldingPass.test.cpp

index 47269b5..8240277 100644 (file)
@@ -72,16 +72,16 @@ void create_net_const_relu(loco::Graph *graph)
 
 TEST(ConstantFolding, const_relu_to_const)
 {
-  loco::Graph graph;
-  create_net_const_relu(&graph);
+  auto graph = loco::make_graph();
+  create_net_const_relu(graph.get());
 
   logo::ConstantFoldingPass pass;
-  while (pass.run(&graph) == true)
+  while (pass.run(graph.get()) == true)
   {
     ;
   }
 
-  auto push = logo::test::find_first_node_by_type<loco::Push>(&graph);
+  auto push = logo::test::find_first_node_by_type<loco::Push>(graph.get());
   auto const_gen = dynamic_cast<loco::ConstGen *>(push->from());
   ASSERT_NE(const_gen, nullptr);
 
@@ -158,16 +158,16 @@ void create_net_const_relu_concat(loco::Graph *graph)
 
 TEST(ConstantFolding, const_relu_to_concat)
 {
-  loco::Graph graph;
-  create_net_const_relu_concat(&graph);
+  auto graph = loco::make_graph();
+  create_net_const_relu_concat(graph.get());
 
   logo::ConstantFoldingPass pass;
-  while (pass.run(&graph) == true)
+  while (pass.run(graph.get()) == true)
   {
     ;
   }
 
-  auto push = logo::test::find_first_node_by_type<loco::Push>(&graph);
+  auto push = logo::test::find_first_node_by_type<loco::Push>(graph.get());
   auto const_gen = dynamic_cast<loco::ConstGen *>(push->from());
   ASSERT_NE(const_gen, nullptr);