We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1bc2b97 commit a3c1e1eCopy full SHA for a3c1e1e
unit/util/graph.cpp
@@ -310,3 +310,25 @@ SCENARIO("graph-connected-subgraphs",
310
}
311
312
313
+
314
+SCENARIO("predecessors-successors-graph", "[core][util][graph]")
315
+{
316
+ GIVEN("A graph")
317
+ {
318
+ simple_grapht graph;
319
+ simple_grapht::node_indext indices[2];
320
321
+ for(int i = 0; i < 2; ++i)
322
+ indices[i] = graph.add_node();
323
324
+ graph.add_edge(indices[0], indices[1]);
325
326
+ THEN("Nodes should have correct successors and predecessors")
327
328
+ REQUIRE(graph.get_predecessors(indices[0]).size() == 0);
329
+ REQUIRE(graph.get_successors(indices[0]).size() == 1);
330
+ REQUIRE(graph.get_predecessors(indices[1]).size() == 1);
331
+ REQUIRE(graph.get_successors(indices[1]).size() == 0);
332
+ }
333
334
+}
0 commit comments