X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Faga%2Ftest%2Fapi-adjacency.c;h=6e5043017788272e6aa8f2b07163e49277d71c34;hb=eedf1079f38efb2b8dc4fd3f516cce8ac1272c06;hp=26cb52b342075c8f023fda87fc9c0a627db334ae;hpb=2192bdd98afbb1ddb489c863edd191877051de8b;p=ccan diff --git a/ccan/aga/test/api-adjacency.c b/ccan/aga/test/api-adjacency.c index 26cb52b3..6e504301 100644 --- a/ccan/aga/test/api-adjacency.c +++ b/ccan/aga/test/api-adjacency.c @@ -20,7 +20,7 @@ static void test_adjacency(const char *name, struct aga_edge_info ei; int j = 0; const struct aga_node *from; - int err; + int err = 0xdeadbeef; assert(i < MAX_NODES); @@ -42,6 +42,8 @@ static void test_adjacency(const char *name, ok(err == at[i].to[j], "%s: %p #%d -> ERROR %d", name, e, at[i].from, at[i].to[j]); continue; /* Move onto next node on errors */ + } else { + ok1(err == 0); } assert(j < MAX_EDGES); ok(at[i].to[j] == 0, @@ -59,13 +61,15 @@ int main(void) struct grid_graph gg1, gg2; struct error_graph eg; struct traversal1_graph t1g; + struct shortcut1_graph s1g; + struct shortcut2_graph s2g; - plan_tests(1 + 5 + 30 + 22 + 21 + 33 + 6 + 21); + plan_tests(2 + 7 + 35 + 30 + 30 + 42 + 9 + 30 + 9 + 9); trivial_graph_init(&tg); test_adjacency("trivial", &tg.sg, trivial_adjacency); - parallel_graph_init(&pg, 3); + parallel_graph_init(&pg, 3, 0); test_adjacency("parallel nlinks 3", &pg.sg, parallel_adjacency_nlinks3); @@ -89,5 +93,11 @@ int main(void) traversal1_graph_init(&t1g); test_adjacency("traversal1 graph", &t1g.sg, traversal1_adjacency); + shortcut1_graph_init(&s1g); + test_adjacency("shortcut1 graph", &s1g.sg, shortcut1_adjacency); + + shortcut2_graph_init(&s2g); + test_adjacency("shortcut2 graph", &s2g.sg, shortcut2_adjacency); + return exit_status(); }