5 static void t(const char *fmt, double d, const char *want)
9 int r = snprintf(buf, sizeof buf, fmt, d);
10 if (r != n || memcmp(buf, want, n+1) != 0)
11 t_error("snprintf(\"%s\",%f) want %s got %s\n", fmt, d, want, buf);
16 // fill stack with something
17 t("%.1f", 123123123123123.0, "123123123123123.0");
18 // test for out-of-bounds access
19 t("%g", 999999999.0, "1e+09");
20 t("%.3e", 999999999.75, "1.000e+09");