| 27 | class GrapplerItemTest : public ::testing::Test {}; |
| 28 | |
| 29 | TEST_F(GrapplerItemTest, Basic) { |
| 30 | TrivialTestGraphInputYielder fake_input(4, 1, 10, false, {{"CPU:0"}}); |
| 31 | GrapplerItem item; |
| 32 | CHECK(fake_input.NextItem(&item)); |
| 33 | |
| 34 | EXPECT_TRUE(item.InitOpsFanin().empty()); |
| 35 | |
| 36 | std::vector<string> graph_nodes; |
| 37 | for (const auto& node : item.graph.node()) { |
| 38 | graph_nodes.push_back(node.name()); |
| 39 | } |
| 40 | std::vector<string> main_ops; |
| 41 | for (const auto& node : item.MainOpsFanin()) { |
| 42 | main_ops.push_back(node->name()); |
| 43 | } |
| 44 | std::sort(graph_nodes.begin(), graph_nodes.end()); |
| 45 | std::sort(main_ops.begin(), main_ops.end()); |
| 46 | EXPECT_EQ(main_ops, graph_nodes); |
| 47 | } |
| 48 | |
| 49 | TEST_F(GrapplerItemTest, InferDevices) { |
| 50 | using test::function::NDef; |
nothing calls this directly
no test coverage detected