X-Git-Url: https://git.auder.net/?p=cgds.git;a=blobdiff_plain;f=test%2Flut.h;fp=test%2Flut.h;h=8f703d6e9355c8f6e47229fcf2596ec969bbf7a4;hp=e41e9c9936f3613e6e54259f4b3397fad89b104e;hb=e45132acdb58c076d5e06849fa51c26de9a7486d;hpb=1ff641f9960fa6c6081817a5641afb22fad91dcd diff --git a/test/lut.h b/test/lut.h index e41e9c9..8f703d6 100644 --- a/test/lut.h +++ b/test/lut.h @@ -1,19 +1,19 @@ #define lu_assert_msg(expr, ...) \ - if (!(expr)) { \ - fprintf(stdout, "Failure in file %s at line %i\n", __FILE__, __LINE__); \ - fprintf(stdout, ## __VA_ARGS__); \ - return; \ - } + if (!(expr)) { \ + fprintf(stdout, "Failure in file %s at line %i\n", __FILE__, __LINE__); \ + fprintf(stdout, ## __VA_ARGS__); \ + return; \ + } #define lu_assert(expr) \ - lu_assert_msg(expr, ""); + lu_assert_msg(expr, ""); /* OP may be any comparison operator. */ #define _lu_assert_int(X, OP, Y) do { \ - int _lu_x = (X); \ - int _lu_y = (Y); \ - lu_assert_msg(_lu_x OP _lu_y, \ + int _lu_x = (X); \ + int _lu_y = (Y); \ + lu_assert_msg(_lu_x OP _lu_y, \ "Assertion '"#X#OP#Y"' failed: "#X"==%i, "#Y"==%i\n", \ _lu_x, _lu_y); \ } while (0) @@ -25,9 +25,9 @@ #define lu_assert_int_ge(X, Y) _lu_assert_int(X, >=, Y) #define _lu_assert_dbl(X, OP, Y) do { \ - double _lu_x = (X); \ - double _lu_y = (Y); \ - lu_assert_msg(_lu_x OP _lu_y, \ + double _lu_x = (X); \ + double _lu_y = (Y); \ + lu_assert_msg(_lu_x OP _lu_y, \ "Assertion '"#X#OP#Y"' failed: "#X"==%g, "#Y"==%g", \ _lu_x, _lu_y); \ } while (0)