| 26 | } |
| 27 | |
| 28 | int main(int argc, char *argv[]) |
| 29 | { |
| 30 | common_setup(argv[0]); |
| 31 | printf("Allocating a memory context\n"); |
| 32 | tal_t *ctx = tal(NULL, tal_t); |
| 33 | assert(ctx); |
| 34 | |
| 35 | printf("Allocating a graph\n"); |
| 36 | struct graph *graph = graph_new(ctx, MAX_NODES, MAX_ARCS, DUAL_BIT); |
| 37 | assert(graph); |
| 38 | |
| 39 | bool success; |
| 40 | |
| 41 | success = graph_add_arc(graph, arc_obj(0), node_obj(0), node_obj(1)); |
| 42 | assert(success); |
| 43 | |
| 44 | success = graph_add_arc(graph, arc_obj(1), node_obj(0), node_obj(2)); |
| 45 | assert(success); |
| 46 | |
| 47 | success = graph_add_arc(graph, arc_obj(2), node_obj(0), node_obj(3)); |
| 48 | assert(success); |
| 49 | |
| 50 | success = graph_add_arc(graph, arc_obj(3), node_obj(3), node_obj(2)); |
| 51 | assert(success); |
| 52 | |
| 53 | show(graph, node_obj(0)); |
| 54 | show(graph, node_obj(1)); |
| 55 | show(graph, node_obj(2)); |
| 56 | show(graph, node_obj(3)); |
| 57 | |
| 58 | printf("Freeing memory\n"); |
| 59 | ctx = tal_free(ctx); |
| 60 | common_shutdown(); |
| 61 | return 0; |
| 62 | } |
| 63 |
nothing calls this directly
no test coverage detected