Commit 373fbfd
Changed files (1)
src
03
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() {