]> pd.if.org Git - hexagon/blobdiff - t/adjacency.c
rework library to use structs
[hexagon] / t / adjacency.c
index 95750cfb9b19425d41540a7e43d2355d388fa6ce..2f9d26ed670de9ef16d6ab3783f5763bb0933419 100644 (file)
@@ -1,25 +1,27 @@
-#include "hexmap.h"
+#include "hexagon.h"
 
-#include "tap.h"
+#include "ctap.h"
 
 int main(void) {
-       int hex, start, dist;
+       struct HL_hex hex, start;
+
+       int dist;
        int x, y, i;
 
-       plan_tests(294);
+       plan(294);
 
        for (x = -3 ; x <= 3; x++) {
                for (y = -3 ; y <= 3; y++) {
-                       start = HL_cantor_xy(x, y);
+                       start = HL_hex_xy(x, y);
                        for (i = 0; i < 6; i++) {
                                hex = HL_adjhex(start, i);
                                dist = HL_distance(hex, start);
-                               ok(dist == 1,
+                               is_int((long)dist, 1L,
                                        "%d, %d direction %d distance one",
                                        x, y, i);
                        }
                }
        }
 
-       return exit_status();
+       return 0;
 }