| 52 | }; |
| 53 | |
| 54 | TEST_F(SCCTest, NoLoops) { |
| 55 | // Create a simple graph without any loop. |
| 56 | TrivialTestGraphInputYielder fake_input(4, 1, 10, false, |
| 57 | cluster_->GetDeviceNames()); |
| 58 | GrapplerItem item; |
| 59 | CHECK(fake_input.NextItem(&item)); |
| 60 | |
| 61 | std::unordered_map<const NodeDef*, int> components; |
| 62 | int num_components; |
| 63 | StronglyConnectedComponents(item.graph, &components, &num_components); |
| 64 | |
| 65 | EXPECT_EQ(num_components, 1); |
| 66 | for (const auto& node : item.graph.node()) { |
| 67 | EXPECT_EQ(-1, components[&node]); |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | TEST_F(SCCTest, DisjointCycleAndPath) { |
| 72 | GraphDef graph; |
nothing calls this directly
no test coverage detected