35#define DEFINE_EXPECT(func) \
36 static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
38#define SET_EXPECT(func) \
39 expect_ ## func = TRUE
41#define CHECK_EXPECT2(func) \
43 ok(expect_ ##func, "unexpected call " #func "\n"); \
44 called_ ## func = TRUE; \
47#define CHECK_EXPECT(func) \
49 CHECK_EXPECT2(func); \
50 expect_ ## func = FALSE; \
53#define CHECK_CALLED(func) \
55 ok(called_ ## func, "expected " #func "\n"); \
56 expect_ ## func = called_ ## func = FALSE; \
63 static const unsigned __ind_bytes = 0xffc00000;
64 return *(
const float *)&__ind_bytes;
66#define IND __port_ind()
69 const wchar_t *function,
const wchar_t *
file,
73 ok(expression ==
NULL,
"expression is not NULL\n");
74 ok(function ==
NULL,
"function is not NULL\n");
93 const char *
tests[] = {
"short",
"justfit",
"justfits",
"muchlonger",
"",
"1"};
95 int bufsizes[] = { 0, 1,
sizeof(
buffer) };
99 const int bufsiz = bufsizes[
j];
105 const int valid =
n < 0 ? bufsiz : (
n == bufsiz ?
n :
n+1);
107 ok (
n ==
expect,
"\"%s\": expected %d, returned %d\n",
118 const int valid =
n >= bufsiz ? (bufsiz > 0 ? bufsiz - 1 : 0) :
n < 0 ? 0 :
n;
120 ok (
n ==
expect,
"\"%s\": expected %d, returned %d\n",
123 "\"%s\": rendered \"%.*s\" bufsiz %d\n",
fmt,
valid,
buffer, bufsiz);
125 "\"%s\": Missing null termination (ret %d) - is %d (bufsiz %d)\n",
fmt,
n,
buffer[
valid], bufsiz);
133 const int valid = n < 0 ? bufsiz > 0 ? bufsiz - 1 : 0 :
n;
135 ok (
n ==
expect,
"\"%s\": expected %d, returned %d\n",
138 "\"%s\": rendered \"%.*s\" bufsiz %d\n",
fmt,
valid,
buffer, bufsiz);
140 "\"%s\": Missing null termination (ret %d) - is %d\n",
fmt,
n,
buffer[
valid]);
145 "Failure to snprintf to NULL\n");
147 "Failure to snprintf to NULL\n");
149 "Failure to snprintf to NULL\n");
151 "Failure to snprintf to zero length buffer\n");
153 "Failure to snprintf to zero length buffer\n");
155 "Failure to snprintf to zero length buffer\n");
157 "Failure to snprintf a zero length string to a zero length buffer\n");
159 "Failure to snprintf a zero length string to a zero length buffer\n");
161 "Failure to snprintf a zero length string to a zero length buffer\n");
177 const wchar_t str_short[] = {
's',
'h',
'o',
'r',
't',0};
178 const wchar_t str_justfit[] = {
'j',
'u',
's',
't',
'f',
'i',
't',0};
179 const wchar_t str_justfits[] = {
'j',
'u',
's',
't',
'f',
'i',
't',
's',0};
180 const wchar_t str_muchlonger[] = {
'm',
'u',
'c',
'h',
'l',
'o',
'n',
'g',
'e',
'r',0};
181 const wchar_t str_empty[] = {0};
182 const wchar_t *
tests[] = {str_short, str_justfit, str_justfits, str_muchlonger};
185 char narrow[8], narrow_fmt[16];
194 const int valid =
n < 0 ? bufsiz : (
n == bufsiz ?
n :
n+1);
198 ok (
n ==
expect,
"\"%s\": expected %d, returned %d\n",
201 "\"%s\": rendered \"%.*s\"\n", narrow_fmt,
valid, narrow);
209 const int valid =
n >= bufsiz ? bufsiz - 1 :
n < 0 ? 0 :
n;
213 ok (
n ==
expect,
"\"%s\": expected %d, returned %d\n",
216 "\"%s\": rendered \"%.*s\"\n", narrow_fmt,
valid, narrow);
218 "\"%s\": Missing null termination (ret %d) - is %d\n", narrow_fmt,
n,
buffer[
valid]);
226 const int valid =
n < 0 ? bufsiz - 1 :
n;
230 ok (
n ==
expect,
"\"%s\": expected %d, returned %d\n",
233 "\"%s\": rendered \"%.*s\"\n", narrow_fmt,
valid, narrow);
235 "\"%s\": Missing null termination (ret %d) - is %d\n", narrow_fmt,
n,
buffer[
valid]);
239 "Failure to swprintf to NULL\n");
241 "Failure to swprintf to NULL\n");
243 "Failure to swprintf to NULL\n");
245 "Failure to swprintf to a zero length buffer\n");
247 "Failure to swprintf to a zero length buffer\n");
249 "Failure to swprintf to a zero length buffer\n");
251 "Failure to swprintf a zero length string to a zero length buffer\n");
253 "Failure to swprintf a zero length string to a zero length buffer\n");
255 "Failure to swprintf a zero length string to a zero length buffer\n");
271 static const char file_name[] =
"fprintf.tst";
280 ok(
ret == 12,
"ftell returned %d\n",
ret);
285 ok(
ret == 26,
"ftell returned %d\n",
ret);
292 ok(
ret == 12,
"ftell returned %d\n",
ret);
307 ok(
ret == 13,
"ftell returned %d\n",
ret);
312 ok(
ret == 28,
"ftell returned %d\n",
ret);
319 ok(
ret == 13,
"ftell returned %d\n",
ret);
332 const wchar_t *
format, ...)
344 static const char file_name[] =
"fprintf.tst";
345 static const WCHAR simple[] = {
's',
'i',
'm',
'p',
'l',
'e',
' ',
't',
'e',
's',
't',
'\n',0};
346 static const WCHAR cont_fmt[] = {
'c',
'o',
'n',
't',
'a',
'i',
'n',
's',
'%',
'c',
'n',
'u',
'l',
'l',
'\n',0};
347 static const WCHAR cont[] = {
'c',
'o',
'n',
't',
'a',
'i',
'n',
's',
'\0',
'n',
'u',
'l',
'l',
'\n',0};
357 ok(
ret == 24,
"ftell returned %d\n",
ret);
362 ok(
ret == 52,
"ftell returned %d\n",
ret);
369 ok(
ret == 24,
"ftell returned %d\n",
ret);
384 ok(
ret == 13,
"ftell returned %d\n",
ret);
389 ok(
ret == 28,
"ftell returned %d\n",
ret);
394 fgets(bufa,
sizeof(bufa), fp);
396 ok(
ret == 13,
"ftell returned %d\n",
ret);
397 ok(!
strcmp(bufa,
"simple test\r\n"),
"buf = %s\n", bufa);
399 fgets(bufa,
sizeof(bufa), fp);
402 ok(!
memcmp(bufa,
"contains\0null\r\n", 15),
"buf = %s\n", bufa);
412 ok(
ret == -1,
"expected ret -1, got %d\n",
ret);
420 ok(
ret == -1,
"expected ret -1, got %d\n",
ret);
441 const char format[] =
"AB%uC";
442 const char out7[] =
"AB123C";
443 const char out6[] =
"AB123";
444 const char out2[] =
"A";
445 const char out1[] =
"";
453 ok(
exp == got,
"length wrong, expect=%d, got=%d\n",
exp, got);
457 ok(
exp == got,
"length wrong, expect=%d, got=%d\n",
exp, got);
461 ok(
exp == got,
"length wrong, expect=%d, got=%d\n",
exp, got);
468 ok(
exp == got,
"length wrong, expect=%d, got=%d\n",
exp, got);
472 ok(
exp == got,
"length wrong, expect=%d, got=%d\n",
exp, got);
476 ok(
exp == got,
"length wrong, expect=%d, got=%d\n",
exp, got);
494 const WCHAR out7[] = {
'A',
'B',
'1',
'2',
'3',
'C',0};
495 const WCHAR out6[] = {
'A',
'B',
'1',
'2',
'3',0};
496 const WCHAR out2[] = {
'A',0};
497 const WCHAR out1[] = {0};
505 ok(
exp == got,
"length wrong, expect=%d, got=%d\n",
exp, got);
509 ok(
exp == got,
"length wrong, expect=%d, got=%d\n",
exp, got);
513 ok(
exp == got,
"length wrong, expect=%d, got=%d\n",
exp, got);
520 ok(
exp == got,
"length wrong, expect=%d, got=%d\n",
exp, got);
524 ok(
exp == got,
"length wrong, expect=%d, got=%d\n",
exp, got);
528 ok(
exp == got,
"length wrong, expect=%d, got=%d\n",
exp, got);
534 const wchar_t wide[] = {
'A',
'B',
'C',
'D',0};
535 const char narrow[] =
"abcd";
536 const char out[] =
"abcd ABCD";
539 const char narrow_fmt[] =
"%s %ls";
542 const wchar_t std_wide_fmt[] = {
'%',
's',
' ',
'%',
'l',
's',0};
543 const wchar_t legacy_wide_fmt[] = {
'%',
'h',
's',
' ',
'%',
's',0};
572 vsprintf_wrapper(0,
buf,
sizeof(
buf),
"%f %F %f %e %E %g %G",
INFINITY,
INFINITY, -
INFINITY,
INFINITY,
INFINITY,
INFINITY,
INFINITY);
573 ok(!
strcmp(
buf,
"inf INF -inf inf INF inf INF"),
"buf = %s\n",
buf);
605 for (
i = 0;
i < 2;
i++) {
611 if (
sizeof(
size_t) == 8)
635 const wchar_t wide[] = {
'A',
'B',
'C',
'D',0};
636 const char narrow[] =
"abcd";
637 const char narrow_fmt[] =
"%s %Ts";
638 const char narrow_out[] =
"abcd abcd";
639 const wchar_t wide_fmt[] = {
'%',
's',
' ',
'%',
'T',
's',0};
640 const wchar_t wide_out[] = {
'a',
'b',
'c',
'd',
' ',
'A',
'B',
'C',
'D',0};
653 static const int flags[] = {
669 {
"%a",
NAN, {
"nan",
"0x1.#QNAN00000000p+0",
"nan",
"0x1.#QNAN00000000p+0" }},
670 {
"%A",
NAN, {
"NAN",
"0X1.#QNAN00000000P+0",
"NAN",
"0X1.#QNAN00000000P+0" }},
671 {
"%e",
NAN, {
"nan",
"1.#QNAN0e+00",
"nan",
"1.#QNAN0e+000" }},
672 {
"%E",
NAN, {
"NAN",
"1.#QNAN0E+00",
"NAN",
"1.#QNAN0E+000" }},
673 {
"%g",
NAN, {
"nan",
"1.#QNAN",
"nan",
"1.#QNAN" }},
674 {
"%G",
NAN, {
"NAN",
"1.#QNAN",
"NAN",
"1.#QNAN" }},
675 {
"%21a",
NAN, {
" nan",
" 0x1.#QNAN00000000p+0",
" nan",
" 0x1.#QNAN00000000p+0" }},
676 {
"%20e",
NAN, {
" nan",
" 1.#QNAN0e+00",
" nan",
" 1.#QNAN0e+000" }},
677 {
"%20g",
NAN, {
" nan",
" 1.#QNAN",
" nan",
" 1.#QNAN" }},
678 {
"%.21a",
NAN, {
"nan",
"0x1.#QNAN0000000000000000p+0",
"nan",
"0x1.#QNAN0000000000000000p+0" }},
679 {
"%.20e",
NAN, {
"nan",
"1.#QNAN000000000000000e+00",
"nan",
"1.#QNAN000000000000000e+000" }},
680 {
"%.20g",
NAN, {
"nan",
"1.#QNAN",
"nan",
"1.#QNAN" }},
681 {
"%.021a",
NAN, {
"nan",
"0x1.#QNAN0000000000000000p+0",
"nan",
"0x1.#QNAN0000000000000000p+0" }},
682 {
"%.020e",
NAN, {
"nan",
"1.#QNAN000000000000000e+00",
"nan",
"1.#QNAN000000000000000e+000" }},
683 {
"%.020g",
NAN, {
"nan",
"1.#QNAN",
"nan",
"1.#QNAN" }},
684 {
"%#.21a",
NAN, {
"nan",
"0x1.#QNAN0000000000000000p+0",
"nan",
"0x1.#QNAN0000000000000000p+0" }},
685 {
"%#.20e",
NAN, {
"nan",
"1.#QNAN000000000000000e+00",
"nan",
"1.#QNAN000000000000000e+000" }},
686 {
"%#.20g",
NAN, {
"nan",
"1.#QNAN00000000000000",
"nan",
"1.#QNAN00000000000000" }},
687 {
"%.1g",
NAN, {
"nan",
"1",
"nan",
"1" }},
688 {
"%.2g",
NAN, {
"nan",
"1.$",
"nan",
"1.$" }},
689 {
"%.3g",
NAN, {
"nan",
"1.#R",
"nan",
"1.#R" }},
691 {
"%a",
IND, {
"-nan(ind)",
"-0x1.#IND000000000p+0",
"-nan(ind)",
"-0x1.#IND000000000p+0" }},
692 {
"%e",
IND, {
"-nan(ind)",
"-1.#IND00e+00",
"-nan(ind)",
"-1.#IND00e+000" }},
693 {
"%g",
IND, {
"-nan(ind)",
"-1.#IND",
"-nan(ind)",
"-1.#IND" }},
694 {
"%21a",
IND, {
" -nan(ind)",
"-0x1.#IND000000000p+0",
" -nan(ind)",
"-0x1.#IND000000000p+0" }},
695 {
"%20e",
IND, {
" -nan(ind)",
" -1.#IND00e+00",
" -nan(ind)",
" -1.#IND00e+000" }},
696 {
"%20g",
IND, {
" -nan(ind)",
" -1.#IND",
" -nan(ind)",
" -1.#IND" }},
697 {
"%.21a",
IND, {
"-nan(ind)",
"-0x1.#IND00000000000000000p+0",
"-nan(ind)",
"-0x1.#IND00000000000000000p+0" }},
698 {
"%.20e",
IND, {
"-nan(ind)",
"-1.#IND0000000000000000e+00",
"-nan(ind)",
"-1.#IND0000000000000000e+000" }},
699 {
"%.20g",
IND, {
"-nan(ind)",
"-1.#IND",
"-nan(ind)",
"-1.#IND" }},
700 {
"%.021a",
IND, {
"-nan(ind)",
"-0x1.#IND00000000000000000p+0",
"-nan(ind)",
"-0x1.#IND00000000000000000p+0" }},
701 {
"%.020e",
IND, {
"-nan(ind)",
"-1.#IND0000000000000000e+00",
"-nan(ind)",
"-1.#IND0000000000000000e+000" }},
702 {
"%.020g",
IND, {
"-nan(ind)",
"-1.#IND",
"-nan(ind)",
"-1.#IND" }},
703 {
"%#.21a",
IND, {
"-nan(ind)",
"-0x1.#IND00000000000000000p+0",
"-nan(ind)",
"-0x1.#IND00000000000000000p+0" }},
704 {
"%#.20e",
IND, {
"-nan(ind)",
"-1.#IND0000000000000000e+00",
"-nan(ind)",
"-1.#IND0000000000000000e+000" }},
705 {
"%#.20g",
IND, {
"-nan(ind)",
"-1.#IND000000000000000",
"-nan(ind)",
"-1.#IND000000000000000" }},
707 {
"%a",
INFINITY, {
"inf",
"0x1.#INF000000000p+0",
"inf",
"0x1.#INF000000000p+0" }},
708 {
"%e",
INFINITY, {
"inf",
"1.#INF00e+00",
"inf",
"1.#INF00e+000" }},
709 {
"%g",
INFINITY, {
"inf",
"1.#INF",
"inf",
"1.#INF" }},
710 {
"%21a",
INFINITY, {
" inf",
" 0x1.#INF000000000p+0",
" inf",
" 0x1.#INF000000000p+0" }},
711 {
"%20e",
INFINITY, {
" inf",
" 1.#INF00e+00",
" inf",
" 1.#INF00e+000" }},
712 {
"%20g",
INFINITY, {
" inf",
" 1.#INF",
" inf",
" 1.#INF" }},
713 {
"%.21a",
INFINITY, {
"inf",
"0x1.#INF00000000000000000p+0",
"inf",
"0x1.#INF00000000000000000p+0" }},
714 {
"%.20e",
INFINITY, {
"inf",
"1.#INF0000000000000000e+00",
"inf",
"1.#INF0000000000000000e+000" }},
715 {
"%.20g",
INFINITY, {
"inf",
"1.#INF",
"inf",
"1.#INF" }},
716 {
"%.021a",
INFINITY, {
"inf",
"0x1.#INF00000000000000000p+0",
"inf",
"0x1.#INF00000000000000000p+0" }},
717 {
"%.020e",
INFINITY, {
"inf",
"1.#INF0000000000000000e+00",
"inf",
"1.#INF0000000000000000e+000" }},
718 {
"%.020g",
INFINITY, {
"inf",
"1.#INF",
"inf",
"1.#INF" }},
719 {
"%#.21a",
INFINITY, {
"inf",
"0x1.#INF00000000000000000p+0",
"inf",
"0x1.#INF00000000000000000p+0" }},
720 {
"%#.20e",
INFINITY, {
"inf",
"1.#INF0000000000000000e+00",
"inf",
"1.#INF0000000000000000e+000" }},
721 {
"%#.20g",
INFINITY, {
"inf",
"1.#INF000000000000000",
"inf",
"1.#INF000000000000000" }},
723 {
"%a", -
INFINITY, {
"-inf",
"-0x1.#INF000000000p+0",
"-inf",
"-0x1.#INF000000000p+0" }},
724 {
"%e", -
INFINITY, {
"-inf",
"-1.#INF00e+00",
"-inf",
"-1.#INF00e+000" }},
725 {
"%g", -
INFINITY, {
"-inf",
"-1.#INF",
"-inf",
"-1.#INF" }},
726 {
"%21a", -
INFINITY, {
" -inf",
"-0x1.#INF000000000p+0",
" -inf",
"-0x1.#INF000000000p+0" }},
727 {
"%20e", -
INFINITY, {
" -inf",
" -1.#INF00e+00",
" -inf",
" -1.#INF00e+000" }},
728 {
"%20g", -
INFINITY, {
" -inf",
" -1.#INF",
" -inf",
" -1.#INF" }},
729 {
"%.21a", -
INFINITY, {
"-inf",
"-0x1.#INF00000000000000000p+0",
"-inf",
"-0x1.#INF00000000000000000p+0" }},
730 {
"%.20e", -
INFINITY, {
"-inf",
"-1.#INF0000000000000000e+00",
"-inf",
"-1.#INF0000000000000000e+000" }},
731 {
"%.20g", -
INFINITY, {
"-inf",
"-1.#INF",
"-inf",
"-1.#INF" }},
732 {
"%.021a", -
INFINITY, {
"-inf",
"-0x1.#INF00000000000000000p+0",
"-inf",
"-0x1.#INF00000000000000000p+0" }},
733 {
"%.020e", -
INFINITY, {
"-inf",
"-1.#INF0000000000000000e+00",
"-inf",
"-1.#INF0000000000000000e+000" }},
734 {
"%.020g", -
INFINITY, {
"-inf",
"-1.#INF",
"-inf",
"-1.#INF" }},
735 {
"%#.21a", -
INFINITY, {
"-inf",
"-0x1.#INF00000000000000000p+0",
"-inf",
"-0x1.#INF00000000000000000p+0" }},
736 {
"%#.20e", -
INFINITY, {
"-inf",
"-1.#INF0000000000000000e+00",
"-inf",
"-1.#INF0000000000000000e+000" }},
737 {
"%#.20g", -
INFINITY, {
"-inf",
"-1.#INF000000000000000",
"-inf",
"-1.#INF000000000000000" }},
739 {
"%a", 0, {
"0x0.0000000000000p+0" }},
740 {
"%A", 0, {
"0X0.0000000000000P+0" }},
741 {
"%a", 0.5, {
"0x1.0000000000000p-1" }},
742 {
"%a", 1, {
"0x1.0000000000000p+0" }},
743 {
"%a", 20, {
"0x1.4000000000000p+4" }},
744 {
"%a", -1, {
"-0x1.0000000000000p+0" }},
745 {
"%a", 0.1, {
"0x1.999999999999ap-4" }},
746 {
"%24a", 0.1, {
" 0x1.999999999999ap-4" }},
747 {
"%024a", 0.1, {
"0x00001.999999999999ap-4" }},
748 {
"%.2a", 0.1, {
"0x1.9ap-4" }},
749 {
"%.20a", 0.1, {
"0x1.999999999999a0000000p-4" }},
750 {
"%.a", 0.1e-20, {
"0x1p-70" }},
751 {
"%a", 0.1e-20, {
"0x1.2e3b40a0e9b4fp-70" }},
752 {
"%a", 4.9406564584124654e-324, {
"0x0.0000000000001p-1022" }},
753 {
"%.0a", -1.5, {
"-0x2p+0" }, {
"-0x1p+0" }},
754 {
"%.0a", -0.5, {
"-0x1p-1" }},
755 {
"%.0a", 0.5, {
"0x1p-1" }},
756 {
"%.0a", 1.5, {
"0x2p+0" }, {
"0x1p+0" }},
757 {
"%.0a", 1.99, {
"0x2p+0" }},
758 {
"%.0a", 2, {
"0x1p+1" }},
759 {
"%.0a", 9.5, {
"0x1p+3" }},
760 {
"%.0a", 10.5, {
"0x1p+3" }},
761 {
"%#.0a", -1.5, {
"-0x2.p+0" }, {
"-0x1.p+0" }},
762 {
"%#.0a", -0.5, {
"-0x1.p-1" }},
763 {
"%#.0a", 0.5, {
"0x1.p-1" }},
764 {
"%#.0a", 1.5, {
"0x2.p+0" }, {
"0x1.p+0" }},
765 {
"%#.1a", 1.03125, {
"0x1.1p+0",
NULL,
NULL,
NULL,
"0x1.0p+0" }, {
"0x1.0p+0" }},
766 {
"%#.1a", 1.09375, {
"0x1.2p+0" }, {
"0x1.1p+0" }},
767 {
"%#.1a", 1.15625, {
"0x1.3p+0",
NULL,
NULL,
NULL,
"0x1.2p+0" }, {
"0x1.2p+0" }},
769 {
"%f", 0, {
"0.000000" }},
770 {
"%e", 0, {
"0.000000e+00",
NULL,
"0.000000e+000" }},
772 {
"%21f", 0, {
" 0.000000" }},
773 {
"%20e", 0, {
" 0.000000e+00",
NULL,
" 0.000000e+000" }},
774 {
"%20g", 0, {
" 0" }},
775 {
"%.21f", 0, {
"0.000000000000000000000" }},
776 {
"%.20e", 0, {
"0.00000000000000000000e+00",
NULL,
"0.00000000000000000000e+000" }},
777 {
"%.20g", 0, {
"0" }},
778 {
"%.021f", 0, {
"0.000000000000000000000" }},
779 {
"%.020e", 0, {
"0.00000000000000000000e+00",
NULL,
"0.00000000000000000000e+000" }},
780 {
"%.020g", 0, {
"0" }},
781 {
"%#.21f", 0, {
"0.000000000000000000000" }},
782 {
"%#.20e", 0, {
"0.00000000000000000000e+00",
NULL,
"0.00000000000000000000e+000" }},
783 {
"%#.20g", 0, {
"0.0000000000000000000" }, {
"0.00000000000000000000" }},
785 {
"%f", 123, {
"123.000000" }},
786 {
"%e", 123, {
"1.230000e+02",
NULL,
"1.230000e+002" }},
787 {
"%g", 123, {
"123" }},
788 {
"%21f", 123, {
" 123.000000" }},
789 {
"%20e", 123, {
" 1.230000e+02",
NULL,
" 1.230000e+002" }},
790 {
"%20g", 123, {
" 123" }},
791 {
"%.21f", 123, {
"123.000000000000000000000" }},
792 {
"%.20e", 123, {
"1.23000000000000000000e+02",
NULL,
"1.23000000000000000000e+002" }},
793 {
"%.20g", 123, {
"123" }},
794 {
"%.021f", 123, {
"123.000000000000000000000" }},
795 {
"%.020e", 123, {
"1.23000000000000000000e+02",
NULL,
"1.23000000000000000000e+002" }},
796 {
"%.020g", 123, {
"123" }},
797 {
"%#.21f", 123, {
"123.000000000000000000000" }},
798 {
"%#.20e", 123, {
"1.23000000000000000000e+02",
NULL,
"1.23000000000000000000e+002" }},
799 {
"%#.20g", 123, {
"123.00000000000000000" }},
801 {
"%f", -765, {
"-765.000000" }},
802 {
"%e", -765, {
"-7.650000e+02",
NULL,
"-7.650000e+002" }},
803 {
"%g", -765, {
"-765" }},
804 {
"%21f", -765, {
" -765.000000" }},
805 {
"%20e", -765, {
" -7.650000e+02",
NULL,
" -7.650000e+002" }},
806 {
"%20g", -765, {
" -765" }},
807 {
"%.21f", -765, {
"-765.000000000000000000000" }},
808 {
"%.20e", -765, {
"-7.65000000000000000000e+02",
NULL,
"-7.65000000000000000000e+002" }},
809 {
"%.20g", -765, {
"-765" }},
810 {
"%.021f", -765, {
"-765.000000000000000000000" }},
811 {
"%.020e", -765, {
"-7.65000000000000000000e+02",
NULL,
"-7.65000000000000000000e+002" }},
812 {
"%.020g", -765, {
"-765" }},
813 {
"%#.21f", -765, {
"-765.000000000000000000000" }},
814 {
"%#.20e", -765, {
"-7.65000000000000000000e+02",
NULL,
"-7.65000000000000000000e+002" }},
815 {
"%#.20g", -765, {
"-765.00000000000000000" }},
816 {
"%.30f", 1.0/3.0, {
"0.333333333333333314829616256247" }},
817 {
"%.30lf",
sqrt(2), {
"1.414213562373095145474621858739" }},
818 {
"%f", 3.141592653590000, {
"3.141593" }},
819 {
"%.10f", 3.141592653590000, {
"3.1415926536" }},
820 {
"%.11f", 3.141592653590000, {
"3.14159265359" }},
821 {
"%.15f", 3.141592653590000, {
"3.141592653590000" }},
822 {
"%.15f",
M_PI, {
"3.141592653589793" }},
823 {
"%.13f", 37.866261574537077, {
"37.8662615745371" }},
824 {
"%.14f", 37.866261574537077, {
"37.86626157453708" }},
825 {
"%.15f", 37.866261574537077, {
"37.866261574537077" }},
826 {
"%.0g", 9.8949714229143402e-05, {
"0.0001" }},
827 {
"%.0f", 0.5, {
"1",
NULL,
NULL,
NULL,
"0" }, {
NULL,
NULL,
NULL,
NULL,
"1" }},
828 {
"%.0f", 1.5, {
"2" }},
829 {
"%.0f", 2.5, {
"3",
NULL,
NULL,
NULL,
"2" }, {
NULL,
NULL,
NULL,
NULL,
"3" }},
830 {
"%g", 9.999999999999999e-5, {
"0.0001" }},
832 {
"%g", 0.0005, {
"0.0005" }},
833 {
"%g", 0.00005, {
"5e-05",
NULL,
"5e-005" }},
834 {
"%g", 0.000005, {
"5e-06",
NULL,
"5e-006" }},
835 {
"%g", 999999999999999.0, {
"1e+15",
NULL,
"1e+015" }},
836 {
"%g", 1000000000000000.0, {
"1e+15",
NULL,
"1e+015" }},
837 {
"%.15g", 0.0005, {
"0.0005" }},
838 {
"%.15g", 0.00005, {
"5e-05",
NULL,
"5e-005" }},
839 {
"%.15g", 0.000005, {
"5e-06",
NULL,
"5e-006" }},
840 {
"%.15g", 999999999999999.0, {
"999999999999999" }},
841 {
"%.15g", 1000000000000000.0, {
"1e+15",
NULL,
"1e+015" }},
845 const char *broken_res;
862 "%d,%d) buf = %s, expected %s\n",
i,
j,
buf,
res);
873 ok(
r == 2,
"r = %d\n",
r);
877 ok(
r == 1,
"r = %d\n",
r);
881 ok(
r == 2,
"r = %d\n",
r);
888 "Invalid parameter handler was already set\n");
_STLP_DECLSPEC complex< float > _STLP_CALL sqrt(const complex< float > &)
static _invalid_parameter_handler invalid_parameter_handler
int strcmp(const char *String1, const char *String2)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
#define _CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION
#define _CRT_INTERNAL_PRINTF_STANDARD_ROUNDING
#define _CRT_INTERNAL_PRINTF_LEGACY_THREE_DIGIT_EXPONENTS
#define _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR
#define _CRT_INTERNAL_PRINTF_LEGACY_WIDE_SPECIFIERS
#define _CRT_INTERNAL_PRINTF_LEGACY_MSVCRT_COMPATIBILITY
#define WideCharToMultiByte
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
__kernel_ptrdiff_t ptrdiff_t
GLuint GLuint GLsizei count
GLdouble GLdouble GLdouble r
GLenum GLuint GLenum GLsizei const GLchar * buf
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
_Check_return_opt_ _CRTIMP char *__cdecl fgets(_Out_writes_z_(_MaxCount) char *_Buf, _In_ int _MaxCount, _Inout_ FILE *_File)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_ _CRTIMP long __cdecl ftell(_Inout_ FILE *_File)
_invalid_parameter_handler __cdecl _set_invalid_parameter_handler(_In_opt_ _invalid_parameter_handler _Handler)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
static struct test_info tests[]
static void test_vsnwprintf_s(void)
static int WINAPIV vswprintf_wrapper(wchar_t *str, const wchar_t *format,...)
static void test_swprintf(void)
static float __port_ind(void)
static size_t sizeOfBuffer
static void test_fprintf(void)
static int WINAPIV _vsnwprintf_s_wrapper(wchar_t *str, size_t sizeOfBuffer, size_t count, const wchar_t *format,...)
static void test_snprintf(void)
static void test_invalid_parameter_handler(void)
static int WINAPIV vfwprintf_wrapper(FILE *file, const wchar_t *format,...)
static void test_printf_fp(void)
static void test_vsnprintf_s(void)
static void test_printf_c99(void)
static int WINAPIV _vsnprintf_s_wrapper(char *str, size_t sizeOfBuffer, size_t count, const char *format,...)
#define CHECK_EXPECT(func)
#define DEFINE_EXPECT(func)
static int WINAPIV vfprintf_wrapper(FILE *file, const char *format,...)
static int WINAPIV vsprintf_wrapper(unsigned __int64 options, char *str, size_t len, const char *format,...)
static void test_printf_natural_string(void)
static void test_printf_legacy_wide(void)
static void test_printf_legacy_three_digit_exp(void)
static void test_printf_legacy_msvcrt(void)
#define CHECK_CALLED(func)
static void test_printf_width_specification(void)
static void test_fwprintf(void)
int __cdecl __stdio_common_vfprintf(unsigned __int64 const options, FILE *const stream, char const *const format, _locale_t const locale, va_list const arglist)
int __cdecl __stdio_common_vsprintf(unsigned __int64 const options, char *const buffer, size_t const buffer_count, char const *const format, _locale_t const locale, va_list const arglist)
int __cdecl __stdio_common_vswprintf(unsigned __int64 const options, wchar_t *const buffer, size_t const buffer_count, wchar_t const *const format, _locale_t const locale, va_list const arglist)
int __cdecl __stdio_common_vfwprintf(unsigned __int64 const options, FILE *const stream, wchar_t const *const format, _locale_t const locale, va_list const arglist)
int __cdecl __stdio_common_vsnprintf_s(unsigned __int64 const options, char *const buffer, size_t const buffer_count, size_t const max_count, char const *const format, _locale_t const locale, va_list const arglist)
int __cdecl __stdio_common_vsnwprintf_s(unsigned __int64 const options, wchar_t *const buffer, size_t const buffer_count, size_t const max_count, wchar_t const *const format, _locale_t const locale, va_list const arglist)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
wchar_t * fgetws(wchar_t *buf, int bufsize, FILE *file)