From 84bfeb6735d2103305f00ff40f592e2355400370 Mon Sep 17 00:00:00 2001 From: sbaldu Date: Thu, 28 Sep 2023 17:21:07 +0200 Subject: [PATCH] Improve coverage for tests of inOutEdges functions --- test/GraphTest.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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) {