+2010-06-12 Jim Meyering <meyering@redhat.com>
+
+ test-inttostr: avoid spurious failure on Solaris 9
+ * tests/test-inttostr.c (main): Skip the test when snprintf fails
+ to accept "%ju". Reported by Bruno Haible.
+
2010-06-11 Jim Meyering <meyering@redhat.com>
test-sys_socket: mark variables as used more readably
int
main (void)
{
- CK (int, inttostr);
- CK (unsigned int, uinttostr);
- CK (off_t, offtostr);
- CK (uintmax_t, umaxtostr);
- CK (intmax_t, imaxtostr);
- return 0;
+ char buf[2];
+
+ /* Ideally we would rely on the snprintf-posix module, in which case
+ this guard would not be required, but due to limitations in gnulib's
+ implementation (see modules/snprintf-posix), we cannot. */
+ if (snprintf (buf, sizeof buf, "%ju", (uintmax_t) 3) == 1
+ && buf[0] == '3' && buf[1] == '\0')
+ {
+ CK (int, inttostr);
+ CK (unsigned int, uinttostr);
+ CK (off_t, offtostr);
+ CK (uintmax_t, umaxtostr);
+ CK (intmax_t, imaxtostr);
+ return 0;
+ }
+
+ /* snprintf doesn't accept %ju; skip this test. */
+ return 77;
}