#include #include #include "tap.h" #include "hex.h" void iso(struct hex *h) { hex_iso(h); printf("iso(%d,%d,%d)", h->x, h->y, h->z); } void xy(struct hex *h) { hex_xy(h); printf("xy(%d,%d)", h->x, h->y); } int main(void) { int x, y; struct hex h; plan_tests(121); for (x = -5; x<6; x++) { for (y = -5 ; y<6;y++) { h.x = x; h.y = y; h.iso = 0; printf("# "); xy(&h); printf(" = "); iso(&h); printf(" = "); xy(&h); printf("\n"); ok(h.x == x && h.y == y, "xy -> iso -> xy"); } } return exit_status(); }