tests/graph_test.cpp
/**
 * Tests the removal of an edge.
 */
Tests the removal of an edge.
Tests the removal of an edge .
TEST(GraphTest, RemoveEdgeFromUndirectedGraph) {
    Graph *graph = init_graph(UNWEIGHTED, UNDIRECTED, 4);
    add_unweighted_edge(graph, 0, 1);
    add_unweighted_edge(graph, 3, 0);
    EXPECT_EQ(remove_edge(graph, 0, 1), GRAPH_SUCCESS);
    EXPECT_EQ(graph->adjacent[0][1], 0);
    EXPECT_EQ(graph->adjacent[1][0], 0);
    EXPECT_EQ(graph->adjacent[3][0], 1);
    EXPECT_EQ(graph->adjacent[0][3], 1);
}
TEST ( GraphTest , RemoveEdgeFromUndirectedGraph ) { Graph * graph = init_graph ( UNWEIGHTED , UNDIRECTED , 4 ) ; add_unweighted_edge ( graph , 0 , 1 ) ; add_unweighted_edge ( graph , 3 , 0 ) ; EXPECT_EQ ( remove_edge ( graph , 0 , 1 ) , GRAPH_SUCCESS ) ; EXPECT_EQ ( graph -> adjacent [ 0 ] [ 1 ] , 0 ) ; EXPECT_EQ ( graph -> adjacent [ 1 ] [ 0 ] , 0 ) ; EXPECT_EQ ( graph -> adjacent [ 3 ] [ 0 ] , 1 ) ; EXPECT_EQ ( graph -> adjacent [ 0 ] [ 3 ] , 1 ) ; }
Tests the removal of an edge.
Tests the removal of an edge .