diff --git a/test/GraphTest.cpp b/test/GraphTest.cpp index 720f965bf..3641c8d1f 100644 --- a/test/GraphTest.cpp +++ b/test/GraphTest.cpp @@ -736,6 +736,12 @@ TEST(InOutNodesTest, test_outEdges_shared) { x == make_shared>(edge4)); ASSERT_FALSE(x == make_shared>(edge1)); } + + // Check the result for a node that does not exist in the graph + CXXGraph::Node node9("9", 9); + auto node9_shared = make_shared>(node9); + auto edges = graph.outEdges(node9_shared); + ASSERT_EQ(edges.size(), 0); } TEST(InOutNodesTest, test_inOutEdges) { @@ -827,6 +833,12 @@ TEST(InOutNodesTest, test_inOutEdges_shared) { for (auto x : graph.inOutEdges(node7_shared)) { ASSERT_TRUE(x == make_shared>(edge7)); } + + // Check the result for a node that does not exist in the graph + CXXGraph::Node node9("9", 9); + auto node9_shared = make_shared>(node9); + auto edges = graph.inOutEdges(node9_shared); + ASSERT_EQ(edges.size(), 0); } TEST(ReverseDirectedGraphTest, test_function) {