34#define DEFINE_EXPECT(func) \
35 static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
37#define SET_EXPECT(func) \
38 expect_ ## func = TRUE
40#define CHECK_EXPECT2(func) \
42 ok(expect_ ##func, "unexpected call " #func "\n"); \
43 called_ ## func = TRUE; \
46#define CHECK_EXPECT(func) \
48 CHECK_EXPECT2(func); \
49 expect_ ## func = FALSE; \
52#define CHECK_CALLED(func) \
54 ok(called_ ## func, "expected " #func "\n"); \
55 expect_ ## func = called_ ## func = FALSE; \
61 const wchar_t *function,
const wchar_t *
file,
65 ok(expression ==
NULL,
"expression is not NULL\n");
66 ok(function ==
NULL,
"function is not NULL\n");
80#define test_strtod_str_errno(string, value, length, err) _test_strtod_str(__LINE__, string, value, length, err)
81#define test_strtod_str(string, value, length) _test_strtod_str(__LINE__, string, value, length, 0)
141 test_strtod_str(
"0x1ffffffffffffe.80000000000000000000", 9007199254740990.0, 37);
142 test_strtod_str(
"0x1ffffffffffffe.80000000000000000001", 9007199254740991.0, 37);
143 test_strtod_str(
"0x1fffffffffffff.80000000000000000000", 9007199254740992.0, 37);
144 test_strtod_str(
"0x1fffffffffffff.80000000000000000001", 9007199254740992.0, 37);
146 test_strtod_str(
"4.0621786324484881721115322e-53", 4.0621786324484881721115322e-53, 31);
147 test_strtod_str(
"1.8905590910042396899370942", 1.8905590910042396899370942, 27);
148 test_strtod_str(
"1.7976931348623158e+308", 1.7976931348623158e+308, 23);
149 test_strtod_str(
"2.2250738585072014e-308", 2.2250738585072014e-308, 23);
150 test_strtod_str(
"4.9406564584124654e-324", 4.9406564584124654e-324, 23);
157 static const struct {
163 {
"12.1", 4, 12.1f },
164 {
"-13.721", 7, -13.721f },
169 {
"1.4e-45", 7, 1.4e-45f },
170 {
"-1.4e-45", 8, -1.4e-45f },
171 {
"1.e-60", 6, 0,
ERANGE },
172 {
"-1.e-60", 7, 0,
ERANGE },
187 "%d) errno = %d\n",
i,
errno);
193 static const char *
s1 =
"abc";
194 static const char *
s2 =
"aBd";
230 static const char *
s1 =
"abc";
231 static const char *
s2 =
"aBd";
287 ok(
ret == strncnt_tests[
i].
ret,
"%u: unexpected return value %u.\n",
i, (
int)
ret);
302 static const char *locales[] = {
NULL,
"C" };
306 for (
i = 0;
i <= 0xffff;
i++)
309 if (
i >=
'A' &&
i <=
'Z')
315 ok(
ret ==
i,
"expected self %x, got %x for C locale\n",
i,
ret);
322 if (
i >=
'A' &&
i <=
'Z')
328 ok(
ret ==
i,
"expected self %x, got %x for C locale\n",
i,
ret);
331 if (
i >=
'A' &&
i <=
'Z')
337 ok(
ret ==
i,
"expected self %x, got %x for C locale\n",
i,
ret);
340 if (
i >=
'a' &&
i <=
'z')
346 ok(
ret ==
i,
"expected self %x, got %x for C locale\n",
i,
ret);
353 if (
i >=
'a' &&
i <=
'z')
359 ok(
ret ==
i,
"expected self %x, got %x for C locale\n",
i,
ret);
362 if (
i >=
'a' &&
i <=
'z')
368 ok(
ret ==
i,
"expected self %x, got %x for C locale\n",
i,
ret);
374 for (
j = 0;
j <= 0xffff;
j++) {
376 if (
j >=
'A' &&
j <=
'Z')
382 ok(
ret ==
j,
"expected self %x, got %x for C locale\n",
j,
ret);
385 if (
j >=
'a' &&
j <=
'z')
391 ok(
ret ==
j,
"expected self %x, got %x for C locale\n",
j,
ret);
400 unsigned char str1[] =
"cabernet";
401 unsigned char str2[] =
"shiraz";
402 unsigned char set[] =
"abc";
403 unsigned char empty[] =
"";
404 unsigned char mbstr[] =
" 2019\x94\x4e" "6\x8c\x8e" "29\x93\xfa";
405 unsigned char mbset1[] =
"0123456789 \x94\x4e";
406 unsigned char mbset2[] =
" \x94\x4e\x8c\x8e";
407 unsigned char mbset3[] =
"\x8e";
411 ok(
ret == 3,
"_mbsspn returns %d should be 3\n",
ret);
413 ok(
ret == 0,
"_mbsspn returns %d should be 0\n",
ret);
415 ok(
ret == 0,
"_mbsspn returns %d should be 0\n",
ret);
419 ok(
ret == 8,
"_mbsspn returns %d should be 8\n",
ret);
421 ok(
ret == 1,
"_mbsspn returns %d should be 1\n",
ret);
423 ok(
ret == 0,
"_mbsspn returns %d should be 0\n",
ret);
425 ok(
ret == 2,
"_mbsspn returns %d should be 2\n",
ret);
427 ok(
ret == 14,
"_mbsspn returns %d should be 14\n",
ret);
434 static const wchar_t *
input =
L"two words";
479 static const char str1[] =
"TEST";
480 static const char str2[] =
"test";
514 static const wchar_t str1[] =
L"TEST";
515 static const wchar_t str2[] =
L"test";
537 struct test ucases[] = {
538 {
"English",
'I',
'i'},
541 {
"Turkish",
'I',
'i'},
544 struct test lcases[] = {
545 {
"English",
'i',
'I'},
548 {
"Turkish",
'i',
'I'},
554 win_skip(
"skipping special case tests for %s\n", ucases[
i].
lang);
559 exp = ucases[
i].exp ? ucases[
i].exp : ucases[
i].ch;
565 win_skip(
"skipping special case tests for %s\n", lcases[
i].
lang);
570 exp = lcases[
i].exp ? lcases[
i].exp : lcases[
i].ch;
579 win_skip(
"locale %s not available. skipping\n", ucases[
i].
lang);
584 exp = ucases[
i].exp ? ucases[
i].exp : ucases[
i].ch;
593 win_skip(
"locale %s not available. skipping\n", lcases[
i].
lang);
598 exp = lcases[
i].exp ? lcases[
i].exp : lcases[
i].ch;
611 for (
c = 0;
c < 256; ++
c)
626 ok(
ret == -1,
"wrong ret %d\n",
ret );
628 ok(
ret == -1,
"wrong ret %d\n",
ret );
630 ok(
ret == -1,
"wrong ret %d\n",
ret );
632 ok(
ret == 1,
"wrong ret %d\n",
ret );
634 ok(
ret == 0,
"wrong ret %d\n",
ret );
637 ok(
ret == 0,
"wrong ret %d\n",
ret );
639 ok(
ret == -1,
"wrong ret %d\n",
ret );
641 ok(
ret == -1,
"wrong ret %d\n",
ret );
643 ok(
ret == 1,
"wrong ret %d\n",
ret );
645 ok(
ret == 0,
"wrong ret %d\n",
ret );
647 ok(
ret == 0,
"wrong ret %d\n",
ret );
649 ok(
ret == 0,
"wrong ret %d\n",
ret );
651 ok(
ret == 0,
"wrong ret %d\n",
ret );
654#define expect_bin(buf, value, len) { ok(memcmp((buf), value, len) == 0, \
655 "Binary buffer mismatch - expected %s, got %s\n", \
656 debugstr_an(value, len), debugstr_an((char *)(buf), len)); }
660 unsigned char *mbstring = (
unsigned char *)
"\xb0\xb1\xb2\xb3Q\xb4\xb5\x0";
661 unsigned char *mbstring2 = (
unsigned char *)
"\xb0\x0";
662 unsigned char buf[16];
669 skip(
"Code page 936 is not available, skipping test.\n");
820 static const char mbs[] = { 0xc3, 0xa9, 0 };
826 win_skip(
"skipping UTF8 mbstowcs tests\n");
831 ok(
ret == 1,
"mbstowcs returned %Id\n",
ret);
834 ok(
ret == 1,
"mbstowcs returned %Id\n",
ret);
835 ok(
wcs[0] == 0xe9,
"wcsstring[0] = %x\n",
wcs[0]);
836 ok(
wcs[1] == 0xfefe,
"wcsstring[1] = %x\n",
wcs[1]);
843 "Invalid parameter handler was already set\n");
static const WCHAR empty[]
#define _strnicmp(_String1, _String2, _MaxCount)
static _invalid_parameter_handler invalid_parameter_handler
_ACRTIMP wint_t __cdecl _towlower_l(wint_t, _locale_t)
_ACRTIMP wint_t __cdecl _towupper_l(wint_t, _locale_t)
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
_ACRTIMP wchar_t *__cdecl wcstok(wchar_t *, const wchar_t *)
_ACRTIMP void __cdecl _free_locale(_locale_t)
_ACRTIMP _locale_t __cdecl _create_locale(int, const char *)
_ACRTIMP int __cdecl _getmbcp(void)
_ACRTIMP int __cdecl _setmbcp(int)
_ACRTIMP int __cdecl _mbbtype_l(unsigned char, int, _locale_t)
_ACRTIMP errno_t __cdecl _mbsncpy_s(unsigned char *, size_t, const unsigned char *, size_t)
_ACRTIMP size_t __cdecl _mbsspn(const unsigned char *, const unsigned char *)
_ACRTIMP int __cdecl _mbbtype(unsigned char, int)
_ACRTIMP float __cdecl strtof(const char *, char **)
_ACRTIMP _invalid_parameter_handler __cdecl _set_invalid_parameter_handler(_invalid_parameter_handler)
int __cdecl strncmp(const char *str1, const char *str2, size_t len)
int __cdecl _memicmp_l(const void *v1, const void *v2, size_t len, _locale_t locale)
int __cdecl _memicmp(const void *s1, const void *s2, size_t len)
double CDECL strtod(const char *str, char **end)
size_t __cdecl __strncnt(const char *str, size_t size)
int __cdecl strcmp(const char *str1, const char *str2)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLsizei GLsizei * length
GLenum GLenum GLenum input
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 token
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
static struct test_info tests[]
static void test_C_locale(void)
static void test_SpecialCasing(void)
static void test___strncnt(void)
#define expect_bin(buf, value, len)
static void test_strcmp(void)
static void test__memicmp(void)
static void test_mbsspn(void)
static void test__memicmp_l(void)
static void test_mbstowcs(void)
static void test_invalid_parameter_handler(void)
_ACRTIMP int __cdecl _o_tolower(int)
static void _test_strtod_str(int line, const char *string, double value, int length, int err)
static void test_wcstok(void)
#define test_strtod_str(string, value, length)
static void test__strnicmp(void)
static void test_strtof(void)
#define CHECK_EXPECT(func)
#define DEFINE_EXPECT(func)
_ACRTIMP int __cdecl _o_toupper(int)
#define test_strtod_str_errno(string, value, length, err)
static void test_wcsnicmp(void)
static void test__mbbtype_l(void)
#define CHECK_CALLED(func)
static void test_strtod(void)
static void test__mbsncpy_s(void)
static BOOL local_isnan(double d)
static unsigned __int64 next
static const WCHAR lang[]