summaryrefslogtreecommitdiff
path: root/src/03/graph_test.c
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2020-09-07 18:51:54 -0600
committermo khan <mo.khan@gmail.com>2020-09-07 18:51:54 -0600
commit373fbfd822be53d76c861118d5fa60300d223d6b (patch)
tree4c7e884938c7749c6ec2d251d46d9803ae733822 /src/03/graph_test.c
parent007076ed2be0e2fa03b94d0711e54c7f562d87cc (diff)
refactor: inline variable declarations
Diffstat (limited to 'src/03/graph_test.c')
-rw-r--r--src/03/graph_test.c12
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() {