X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=t%2Fcantor.c;h=7362714c09e5ae9823acea24715059dbdfdb1c11;hb=HEAD;hp=0f179d20e1c724b8b06ecc8c63648f268d6727f3;hpb=8ca2b8a06b00066a20f744a61c9bcdd65949a344;p=hexagon diff --git a/t/cantor.c b/t/cantor.c index 0f179d2..7362714 100644 --- a/t/cantor.c +++ b/t/cantor.c @@ -2,24 +2,26 @@ #include "hexagon.h" -#include "tap.h" +#include "ctap.h" int main(void) { - int xy[2]; - int ijk[3]; int hex; + struct HL_hex in; + struct HL_hex out; int x, y; - plan_tests(81*2); + plan(81*2); for (x=-4;x<=4;x++) { for (y=-4;y<=4;y++) { - hex = HL_cantor_xy(x,y); - HL_cantor_arrays(hex, xy, ijk); - ok(x == xy[0], "x check %d %d", x, y); - ok(y == xy[1], "y check %d %d", x, y); + in.x = x; + in.y = y; + hex = HL_cantor(in); + out = HL_uncantor(hex); + is_int(x, out.x, "x check %d %d", x, y); + is_int(y, out.y, "y check %d %d", x, y); } } - return exit_status(); + return 0; }