30 static const unsigned __inf_bytes = 0x7f800000;
31 return *(
const float *)&__inf_bytes;
36#define INFINITY __port_infinity()
40 static const unsigned __nan_bytes = 0x7fc00000;
41 return *(
const float *)&__nan_bytes;
46#define NAN __port_nan()
49 if(d1-d2>-1
e-30 && d1-d2<1
e-30)
71static void *(
__cdecl *p_lfind_s)(
const void*,
const void*,
unsigned int*,
72 size_t,
int (
__cdecl *)(
void*,
const void*,
const void*),
void*);
100 win_skip(
"rand_s is not available\n");
106 ok(
ret ==
EINVAL,
"Expected rand_s to return EINVAL, got %d\n",
ret);
110 ok(
ret == 0,
"Expected rand_s to return 0, got %d\n",
ret);
132 { { 0x00000000, 0x00000000, 0x0000 }, 10, 0, {0,
' ', 1,
"0"}, 1,
"" },
133 { { 0x00000000, 0x80000000, 0x3fff }, 10, 0, {1,
' ', 1,
"1"}, 1,
"000000009" },
134 { { 0x00000000, 0x80000000, 0xbfff }, 10, 0, {1,
'-', 1,
"1"}, 1,
"000000009" },
135 { { 0x0a3d7000, 0x9d70a3d7, 0x3fff }, 10, 0, {1,
' ', 3,
"123"}, 1,
"0000009" },
136 { { 0x00000000, 0x9184e72a, 0x402a }, 10, 0, {14,
' ', 1,
"1"}, 1,
"000000009" },
137 { { 0x04675000, 0xc9f2c9cd, 0x4062 }, 30, 0, {31,
' ', 21,
"100000000000000001988"}, 1,
"" },
138 { { 0x4bb41000, 0xe12e1342, 0x3fd3 }, 10, 0, {-12,
' ', 1,
"1"}, 1,
"000000000" },
139 { { 0x00000000, 0x80000000, 0x3ffd }, 10, 0, {0,
' ', 2,
"25"}, 1,
"00000000" },
140 { { 0xbf94d800, 0x800000d6, 0x3fff }, 10, 0, {1,
' ', 8,
"10000001"}, 1,
"00" },
141 { { 0x00000000, 0x80000000, 0x7fff }, 10, 0, {1,
' ', 5,
"1#INF"}, 0,
"" },
142 { { 0x00000000, 0x80000000, 0xffff }, 10, 0, {1,
'-', 5,
"1#INF"}, 0,
"" },
143 { { 0x00000001, 0x80000000, 0x7fff }, 10, 0, {1,
' ', 6,
"1#SNAN"}, 0,
"" },
144 { { 0x00000001, 0x80000000, 0xffff }, 10, 0, {1,
'-', 6,
"1#SNAN"}, 0,
"" },
145 { { 0x00000000, 0xc0000000, 0x7fff }, 10, 0, {1,
' ', 6,
"1#QNAN"}, 0,
"" },
146 { { 0x00000000, 0x40000000, 0xffff }, 10, 0, {1,
'-', 6,
"1#QNAN"}, 0,
"" },
148 { { 0x00000000, 0x00000000, 0x0000 }, 10, 1, {0,
' ', 1,
"0"}, 1,
"" },
149 { { 0x00000000, 0x80000000, 0x3fff }, 10, 1, {1,
' ', 1,
"1"}, 1,
"0000000009" },
150 { { 0x00000000, 0x80000000, 0xbfff }, 10, 1, {1,
'-', 1,
"1"}, 1,
"0000000009" },
151 { { 0x0a3d7000, 0x9d70a3d7, 0x3fff }, 10, 1, {1,
' ', 3,
"123"}, 1,
"00000009" },
152 { { 0x00000000, 0x9184e72a, 0x402a }, 10, 1, {14,
' ', 1,
"1"}, 1,
"00000000000000000009" },
153 { { 0x04675000, 0xc9f2c9cd, 0x4062 }, 30, 1, {31,
' ', 21,
"100000000000000001988"}, 1,
"" },
154 { { 0x4bb41000, 0xe12e1342, 0x3fd3 }, 10, 1, {0,
' ', 1,
"0"}, 1,
"" },
155 { { 0xe57a4000, 0xd6bf94d5, 0x3fe7 }, 10, 1, {-6,
' ', 1,
"1"}, 1,
"09" },
156 { { 0x00000000, 0x80000000, 0x3ffd }, 10, 1, {0,
' ', 2,
"25"}, 1,
"00000000" },
157 { { 0xbf94d800, 0x800000d6, 0x3fff }, 10, 1, {1,
' ', 8,
"10000001"}, 1,
"000" },
158 { { 0x00000000, 0x80000000, 0x7fff }, 10, 1, {1,
' ', 5,
"1#INF"}, 0,
"" },
159 { { 0x00000000, 0x80000000, 0xffff }, 10, 1, {1,
'-', 5,
"1#INF"}, 0,
"" },
160 { { 0x00000001, 0x80000000, 0x7fff }, 10, 1, {1,
' ', 6,
"1#SNAN"}, 0,
"" },
161 { { 0x00000000, 0xc0000000, 0x7fff }, 10, 1, {1,
' ', 6,
"1#QNAN"}, 0,
"" },
162 { { 0x00000000, 0x40000000, 0x7fff }, 10, 1, {1,
' ', 6,
"1#QNAN"}, 0,
"" },
164 { { 0x00000000, 0x00000000, 0x0000 }, 0, 0, {0,
' ', 1,
"0"}, 1,
"" },
165 { { 0x00000000, 0x00000000, 0x0000 }, 0, 1, {0,
' ', 1,
"0"}, 1,
"" },
166 { { 0x00000000, 0xf6000000, 0x4005 }, 2, 0, {3,
' ', 2,
"12"}, 1,
"" },
167 { { 0x00000000, 0xf6000000, 0x4005 }, 0, 0, {0,
' ', 1,
"0"}, 1,
"" },
168 { { 0x00000000, 0xf6000000, 0x4005 }, 2, 1, {3,
' ', 3,
"123"}, 1,
"09" },
169 { { 0x0a3d7000, 0xfd70a3d7, 0x3ffe }, 1, 0, {1,
' ', 1,
"1"}, 1,
"" },
170 { { 0x00000000, 0x9a5db800, 0x4013 }, 2, 0, {7,
' ', 2,
"13"}, 1,
"" },
171 { { 0x00000000, 0x9a5db800, 0x4013 }, 2, 1, {7,
' ', 7,
"1264567"}, 1,
"00" },
172 { { 0x00000000, 0x932c05a6, 0x401d }, 2, 1, {10,
' ', 10,
"1234567891"}, 1,
"09" }
181 win_skip(
"I10_OUTPUT not available\n");
197 "%d: &out.str[%d] = %.25s...\n",
i,
out.len+1,
out.str+
out.len+1);
200 if(
out.str[
j] !=
'#')
201 ok(0,
"%d: out.str[%d] = %c (expected \'#\')\n",
i,
j,
out.str[
j]);
212 win_skip(
"strerror_s is not available\n");
218 ok(
ret ==
EINVAL,
"Expected strerror_s to return EINVAL, got %d\n",
ret);
223 ok(
ret ==
EINVAL,
"Expected strerror_s to return EINVAL, got %d\n",
ret);
228 ret = pstrerror_s(
buf, 0, 0);
229 ok(
ret ==
EINVAL,
"Expected strerror_s to return EINVAL, got %d\n",
ret);
231 ok(
buf[0] ==
'X',
"Expected output buffer to be untouched\n");
234 ret = pstrerror_s(
buf, 1, 0);
235 ok(
ret == 0,
"Expected strerror_s to return 0, got %d\n",
ret);
236 ok(
strlen(
buf) == 0,
"Expected output buffer to be null terminated\n");
239 ret = pstrerror_s(
buf, 2, 0);
240 ok(
ret == 0,
"Expected strerror_s to return 0, got %d\n",
ret);
241 ok(
strlen(
buf) == 1,
"Expected output buffer to be truncated\n");
245 ok(
ret == 0,
"Expected strerror_s to return 0, got %d\n",
ret);
249 ok(
ret == 0,
"Expected strerror_s to return 0, got %d\n",
ret);
258 win_skip(
"_get_doserrno is not available\n");
265 ok(
ret ==
EINVAL,
"Expected _get_doserrno to return EINVAL, got %d\n",
ret);
272 ret = p_get_doserrno(&
out);
273 ok(
ret == 0,
"Expected _get_doserrno to return 0, got %d\n",
ret);
283 win_skip(
"_get_errno is not available\n");
289 ok(
ret ==
EINVAL,
"Expected _get_errno to return EINVAL, got %d\n",
ret);
295 ok(
ret == 0,
"Expected _get_errno to return 0, got %d\n",
ret);
296 ok(
out ==
EBADF,
"Expected output variable to be EBADF, got %d\n",
out);
305 win_skip(
"_set_doserrno is not available\n");
311 ok(
ret == 0,
"Expected _set_doserrno to return 0, got %d\n",
ret);
313 "Expected _doserrno to be ERROR_FILE_NOT_FOUND, got %d\n",
_doserrno);
316 ret = p_set_doserrno(-1);
317 ok(
ret == 0,
"Expected _set_doserrno to return 0, got %d\n",
ret);
319 "Expected _doserrno to be -1, got %d\n",
_doserrno);
322 ret = p_set_doserrno(0xdeadbeef);
323 ok(
ret == 0,
"Expected _set_doserrno to return 0, got %d\n",
ret);
325 "Expected _doserrno to be 0xdeadbeef, got %d\n",
_doserrno);
334 win_skip(
"_set_errno is not available\n");
340 ok(
ret == 0,
"Expected _set_errno to return 0, got %d\n",
ret);
344 ret = p_set_errno(-1);
345 ok(
ret == 0,
"Expected _set_errno to return 0, got %d\n",
ret);
346 ok(
errno == -1,
"Expected errno to be -1, got %d\n",
errno);
349 ret = p_set_errno(0xdeadbeef);
350 ok(
ret == 0,
"Expected _set_errno to return 0, got %d\n",
ret);
351 ok(
errno == 0xdeadbeef,
"Expected errno to be 0xdeadbeef, got %d\n",
errno);
370 ok(pipe !=
NULL,
"_popen failed with error: %d\n",
errno);
376 ok(
ret == 0x37,
"_pclose returned %x, expected 0x37\n",
ret);
380 ok(
ret == -1,
"_pclose returned %x, expected -1\n",
ret);
387 if(!p__invalid_parameter) {
388 win_skip(
"_invalid_parameter not available\n");
411 ok(qt->
pos < 64,
"qt->pos = %d\n", qt->
pos);
413 "%d) l on %ld position\n", qt->
pos, (
long)((
int*)
l - qt->
base));
415 "%d) r on %ld position\n", qt->
pos, (
long)((
int*)
r - qt->
base));
419 return *(
int*)
l%1000 - *(
int*)
r%1000;
424 static const int nonstable_test[] = {9000, 8001, 7002, 6003, 1003, 5004, 4005, 3006, 2007};
429 {1, 0}, {2, 1}, {3, 2}, {4, 3}, {5, 4}, {6, 5}, {7, 6},
430 {1, 0}, {2, 1}, {3, 2}, {4, 3}, {5, 4}, {6, 5},
431 {1, 0}, {2, 1}, {3, 2}, {4, 3}, {5, 4},
432 {1, 0}, {2, 1}, {3, 2}, {4, 3},
433 {1, 0}, {2, 1}, {3, 2},
439 {1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}, {6, 0}, {7, 0},
440 {1, 0}, {2, 1}, {3, 1}, {4, 1}, {5, 1}, {6, 1},
441 {1, 0}, {2, 1}, {3, 2}, {4, 2}, {5, 2},
442 {1, 0}, {2, 1}, {3, 2}, {4, 3},
443 {1, 0}, {2, 1}, {3, 2},
449 {0, 4}, {0, 8}, {4, 8},
450 {1, 4}, {2, 4}, {3, 4}, {5, 4}, {6, 4}, {7, 4}, {7, 4}, {6, 4},
453 {1, 0}, {2, 1}, {3, 2}, {4, 3}, {5, 4}, {6, 4},
454 {1, 0}, {2, 1}, {3, 2}, {4, 3}, {5, 3},
455 {1, 0}, {2, 1}, {3, 2}, {4, 2},
456 {1, 0}, {2, 1}, {3, 2},
463 win_skip(
"qsort_s not available\n");
467 for(
i=0;
i<8;
i++) tab[
i] =
i;
468 p_qsort_s(tab, 8,
sizeof(
int),
qsort_comp, &small_sort);
469 ok(small_sort.
pos == 28,
"small_sort.pos = %d\n", small_sort.
pos);
471 ok(tab[
i] ==
i,
"tab[%d] = %d\n",
i, tab[
i]);
473 for(
i=0;
i<8;
i++) tab[
i] = 7-
i;
474 p_qsort_s(tab, 8,
sizeof(
int),
qsort_comp, &small_sort2);
475 ok(small_sort2.pos == 28,
"small_sort2.pos = %d\n", small_sort2.pos);
477 ok(tab[
i] ==
i,
"tab[%d] = %d\n",
i, tab[
i]);
479 for(
i=0;
i<9;
i++) tab[
i] =
i;
482 p_qsort_s(tab, 9,
sizeof(
int),
qsort_comp, &quick_sort);
483 ok(quick_sort.pos == 34,
"quick_sort.pos = %d\n", quick_sort.pos);
486 for(
i=0;
i<9;
i++) tab[
i] = 8-
i + 1000*(
i+1);
490 ok(tab[
i] == nonstable_test[
i],
"tab[%d] = %d, expected %d\n",
i, tab[
i], nonstable_test[
i]);
494 for(
i=0;
i<100;
i++) tab[
i] =
rand()%1000;
497 ok(tab[
i-1] <= tab[
i],
"data sorted incorrectly on position %d: %d <= %d\n",
i, tab[
i-1], tab[
i]);
500 for(
i=0;
i<100;
i++) tab[
i] =
i;
501 for(
i=0;
i<100;
i++) {
512 ok(tab[
i] ==
i,
"data sorted incorrectly on position %d: %d\n",
i, tab[
i]);
553 if (end_thread_type == (
void*)1)
555 else if (end_thread_type == (
void*)2)
557 else if (end_thread_type == (
void*)3)
613 *(
int *)
ctx = 0xdeadc0de;
614 return *(
int *)
l - *(
int *)
r;
619 static const int tests[] = {9000, 8001, 7002, 6003, 1003, 5004, 4005, 3006, 2007};
627 win_skip(
"_lfind_s is not available\n");
637 ok(!found,
"Expected NULL, got %p\n", found);
642 ok(!found,
"Expected NULL, got %p\n", found);
647 ok(!found,
"Expected NULL, got %p\n", found);
652 ok(!found,
"Expected NULL, got %p\n", found);
659 ok(found ==
tests,
"Expected %p, got %p\n",
tests, found);
660 ok(
ctx == 0xdeadc0de,
"Expected 0xdeadc0de, got %x\n",
ctx);
667 ok(found ==
tests+8,
"Expected %p, got %p\n",
tests+8, found);
668 ok(
ctx == 0xdeadc0de,
"Expected 0xdeadc0de, got %x\n",
ctx);
675 ok(!found,
"Expected NULL, got %p\n", found);
676 ok(
ctx == 0xdeadc0de,
"Expected 0xdeadc0de, got %x\n",
ctx);
688 if(!
strcmp(arg_v[2],
"popen"))
691 ok(0,
"invalid argument '%s'\n", arg_v[2]);
int strcmp(const char *String1, const char *String2)
ACPI_SIZE strlen(const char *String)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
VOID WINAPI ExitProcess(IN UINT uExitCode)
VOID WINAPI ExitThread(IN DWORD uExitCode)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
GLdouble GLdouble GLdouble r
GLboolean GLboolean GLboolean b
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_opt_ _CRTIMP int __cdecl _pclose(_Inout_ FILE *_File)
_Check_return_opt_ _CRTIMP char *__cdecl fgets(_Out_writes_z_(_MaxCount) char *_Buf, _In_ int _MaxCount, _Inout_ FILE *_File)
_Check_return_ _CRTIMP FILE *__cdecl _popen(_In_z_ const char *_Command, _In_z_ const char *_Mode)
void __cdecl srand(_In_ unsigned int _Seed)
_Check_return_ int __cdecl rand(void)
#define ERROR_FILE_NOT_FOUND
static struct test_info tests[]
#define sprintf(buf, format,...)
static PEXPLICIT_ACCESSW *static HMODULE hmod
#define todo_wine_if(is_todo)
static void test__popen_child(void)
static void test__invalid_parameter(void)
static void test__lfind_s(void)
struct _I10_OUTPUT_data I10_OUTPUT_data
static void test__set_doserrno(void)
static void test_math_functions(void)
static const I10_OUTPUT_test I10_OUTPUT_tests[]
static void __cdecl test_thread_func(void *end_thread_type)
static void test_qsort_s(void)
static void test__get_errno(void)
static unsigned __stdcall test_thread_func_ex(void *arg)
static void test_thread_handle_close(void)
static void *static MSVCRT_size_t
struct _I10_OUTPUT_test I10_OUTPUT_test
static void test__set_errno(void)
static void test__get_doserrno(void)
static void test_I10_OUTPUT(void)
static int __cdecl _lfind_s_comp(void *ctx, const void *l, const void *r)
static void test_strerror_s(void)
static BOOL almost_equal(double d1, double d2)
static float __port_infinity(void)
static int __cdecl qsort_comp(void *ctx, const void *l, const void *r)
static void test__popen(const char *name)
static void test_rand_s(void)
static const wchar_t const wchar_t unsigned uintptr_t
static float __port_nan(void)
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
_CRTIMP void __cdecl _endthreadex(_In_ unsigned _Retval)
_CRTIMP uintptr_t __cdecl _beginthreadex(_In_opt_ void *_Security, _In_ unsigned _StackSize, _In_ unsigned(__stdcall *_StartAddress)(void *), _In_opt_ void *_ArgList, _In_ unsigned _InitFlag, _Out_opt_ unsigned *_ThrdAddr)
_CRTIMP uintptr_t __cdecl _beginthread(_In_ void(__cdecl *_StartAddress)(void *), _In_ unsigned _StackSize, _In_opt_ void *_ArgList)
_CRTIMP void __cdecl _endthread(void)
int winetest_get_mainargs(char ***pargv)
struct qsort_test::@1682 cmp[64]
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
#define ERROR_INVALID_CMM