+#include <array_length.h>
#include <float.h>
#include <math.h>
#include <stdio.h>
retval = sprintf (buf, "%p", (char *) NULL);
result |= retval != 5 || strcmp (buf, "(nil)") != 0;
- retval = swprintf (wbuf, sizeof (wbuf) / sizeof (wbuf[0]),
- L"%p", (char *) NULL);
+ retval = swprintf (wbuf, array_length (wbuf), L"%p", (char *) NULL);
result |= retval != 5 || wcscmp (wbuf, L"(nil)") != 0;
return result;
printf ("expected \"-inf -INF -inf -INF -inf -INF -inf -INF\", got \"%s\"\n",
buf);
- swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]), L"%a %A %e %E %f %F %g %G",
+ swprintf (wbuf, array_length (wbuf), L"%a %A %e %E %f %F %g %G",
qnanval, qnanval, qnanval, qnanval,
qnanval, qnanval, qnanval, qnanval);
result |= wcscmp (wbuf, L"nan NAN nan NAN nan NAN nan NAN") != 0;
printf ("expected L\"nan NAN nan NAN nan NAN nan NAN\", got L\"%S\"\n", wbuf);
- swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]), L"%a %A %e %E %f %F %g %G",
+ swprintf (wbuf, array_length (wbuf), L"%a %A %e %E %f %F %g %G",
-qnanval, -qnanval, -qnanval, -qnanval,
-qnanval, -qnanval, -qnanval, -qnanval);
result |= wcscmp (wbuf, L"-nan -NAN -nan -NAN -nan -NAN -nan -NAN") != 0;
printf ("expected L\"-nan -NAN -nan -NAN -nan -NAN -nan -NAN\", got L\"%S\"\n",
wbuf);
- swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]), L"%a %A %e %E %f %F %g %G",
+ swprintf (wbuf, array_length (wbuf), L"%a %A %e %E %f %F %g %G",
snanval, snanval, snanval, snanval,
snanval, snanval, snanval, snanval);
result |= wcscmp (wbuf, L"nan NAN nan NAN nan NAN nan NAN") != 0;
printf ("expected L\"nan NAN nan NAN nan NAN nan NAN\", got L\"%S\"\n", wbuf);
- swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]), L"%a %A %e %E %f %F %g %G",
+ swprintf (wbuf, array_length (wbuf), L"%a %A %e %E %f %F %g %G",
msnanval, msnanval, msnanval, msnanval,
msnanval, msnanval, msnanval, msnanval);
result |= wcscmp (wbuf, L"-nan -NAN -nan -NAN -nan -NAN -nan -NAN") != 0;
printf ("expected L\"-nan -NAN -nan -NAN -nan -NAN -nan -NAN\", got L\"%S\"\n",
wbuf);
- swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]), L"%a %A %e %E %f %F %g %G",
+ swprintf (wbuf, array_length (wbuf), L"%a %A %e %E %f %F %g %G",
infval, infval, infval, infval, infval, infval, infval, infval);
result |= wcscmp (wbuf, L"inf INF inf INF inf INF inf INF") != 0;
printf ("expected L\"inf INF inf INF inf INF inf INF\", got L\"%S\"\n", wbuf);
- swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]), L"%a %A %e %E %f %F %g %G",
+ swprintf (wbuf, array_length (wbuf), L"%a %A %e %E %f %F %g %G",
-infval, -infval, -infval, -infval,
-infval, -infval, -infval, -infval);
result |= wcscmp (wbuf, L"-inf -INF -inf -INF -inf -INF -inf -INF") != 0;
printf ("expected \"-inf -INF -inf -INF -inf -INF -inf -INF\", got \"%s\"\n",
buf);
- swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]),
+ swprintf (wbuf, array_length (wbuf),
L"%La %LA %Le %LE %Lf %LF %Lg %LG",
lqnanval, lqnanval, lqnanval, lqnanval,
lqnanval, lqnanval, lqnanval, lqnanval);
result |= wcscmp (wbuf, L"nan NAN nan NAN nan NAN nan NAN") != 0;
printf ("expected L\"nan NAN nan NAN nan NAN nan NAN\", got L\"%S\"\n", wbuf);
- swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]),
+ swprintf (wbuf, array_length (wbuf),
L"%La %LA %Le %LE %Lf %LF %Lg %LG",
-lqnanval, -lqnanval, -lqnanval, -lqnanval,
-lqnanval, -lqnanval, -lqnanval, -lqnanval);
printf ("expected L\"-nan -NAN -nan -NAN -nan -NAN -nan -NAN\", got L\"%S\"\n",
wbuf);
- swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]),
+ swprintf (wbuf, array_length (wbuf),
L"%La %LA %Le %LE %Lf %LF %Lg %LG",
lsnanval, lsnanval, lsnanval, lsnanval,
lsnanval, lsnanval, lsnanval, lsnanval);
result |= wcscmp (wbuf, L"nan NAN nan NAN nan NAN nan NAN") != 0;
printf ("expected L\"nan NAN nan NAN nan NAN nan NAN\", got L\"%S\"\n", wbuf);
- swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]),
+ swprintf (wbuf, array_length (wbuf),
L"%La %LA %Le %LE %Lf %LF %Lg %LG",
lmsnanval, lmsnanval, lmsnanval, lmsnanval,
lmsnanval, lmsnanval, lmsnanval, lmsnanval);
printf ("expected L\"-nan -NAN -nan -NAN -nan -NAN -nan -NAN\", got L\"%S\"\n",
wbuf);
- swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]),
+ swprintf (wbuf, array_length (wbuf),
L"%La %LA %Le %LE %Lf %LF %Lg %LG",
linfval, linfval, linfval, linfval,
linfval, linfval, linfval, linfval);
result |= wcscmp (wbuf, L"inf INF inf INF inf INF inf INF") != 0;
printf ("expected L\"inf INF inf INF inf INF inf INF\", got L\"%S\"\n", wbuf);
- swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]),
+ swprintf (wbuf, array_length (wbuf),
L"%La %LA %Le %LE %Lf %LF %Lg %LG",
-linfval, -linfval, -linfval, -linfval,
-linfval, -linfval, -linfval, -linfval);