6 /* r = place to store result
7 * f = function call to test (or any expression)
9 * m = message to print on failure (with formats for r & x)
12 #define TEST(r, f, x, m) ( \
13 ((r) = (f)) == (x) || \
14 (t_error("%s failed (" m ")\n", #f, r, x, r-x), 0) )
22 for (i=0; i<100; i++) {
24 snprintf(buf, sizeof buf, "%.300f", d);
25 TEST(d2, strtod(buf, 0), d, "round trip fail %a != %a (%a)");
28 TEST(d, strtod("0x1p4", 0), 16.0, "hex float %a != %a");
29 TEST(d, strtod("0x1.1p4", 0), 17.0, "hex float %a != %a");