diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/03/graph_test.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/03/graph_test.c b/src/03/graph_test.c index fd025a5..7a04a5b 100644 --- a/src/03/graph_test.c +++ b/src/03/graph_test.c @@ -35,13 +35,15 @@ Ensure(add_vertex_adds_max_number_of_verticies_to_graph) { Ensure(add_edge_connects_two_vertices) { Graph *graph = graph_initialize(); - Vertex *a = graph_add_vertex(graph, 'a'); - Vertex *b = graph_add_vertex(graph, 'b'); - graph_add_edge(graph, a, b); + graph_add_edge( + graph, + graph_add_vertex(graph, 'a'), + graph_add_vertex(graph, 'b') + ); - assert_that(graph->edges[a->label][b->label], is_equal_to(true)); - assert_that(graph->edges[b->label][a->label], is_equal_to(false)); + assert_that(graph->edges['a']['b'], is_equal_to(true)); + assert_that(graph->edges['b']['a'], is_equal_to(false)); } TestSuite *graph_tests() { |
