5 #include <ccan/order/order.h>
7 #include <ccan/tap/tap.h>
25 struct cmp_info ctx1 = {
29 struct cmp_info ctx2 = {
33 total_order(order1, struct item, struct cmp_info *) = {
36 total_order(order2, struct item, struct cmp_info *) = {
42 ok1(total_order_cmp(order1, &item1, &item1) == 0);
43 ok1(total_order_cmp(order1, &item2, &item2) == 0);
44 ok1(total_order_cmp(order1, &item3, &item3) == 0);
46 ok1(total_order_cmp(order1, &item1, &item2) == -1);
47 ok1(total_order_cmp(order1, &item2, &item3) == -1);
48 ok1(total_order_cmp(order1, &item1, &item3) == -1);
50 ok1(total_order_cmp(order1, &item2, &item1) == 1);
51 ok1(total_order_cmp(order1, &item3, &item2) == 1);
52 ok1(total_order_cmp(order1, &item3, &item1) == 1);
55 ok1(total_order_cmp(order2, &item1, &item1) == 0);
56 ok1(total_order_cmp(order2, &item2, &item2) == 0);
57 ok1(total_order_cmp(order2, &item3, &item3) == 0);
59 ok1(total_order_cmp(order2, &item1, &item2) == 1);
60 ok1(total_order_cmp(order2, &item2, &item3) == 1);
61 ok1(total_order_cmp(order2, &item1, &item3) == 1);
63 ok1(total_order_cmp(order2, &item2, &item1) == -1);
64 ok1(total_order_cmp(order2, &item3, &item2) == -1);
65 ok1(total_order_cmp(order2, &item3, &item1) == -1);