30#define DOUBLE(x) (WCHAR)((x<<8)|(x))
70 ok( atom >= 0xc000,
"bad atom id %x\n", atom );
71 ok(
GetLastError() == 0xdeadbeef,
"GlobalAddAtomA set last error\n" );
85 trace(
"WARNING: Unicode atom APIs are not supported on this platform\n");
89 ok( w_atom == atom,
"Unicode atom does not match ASCII\n" );
90 ok(
GetLastError() == 0xdeadbeef,
"GlobalAddAtomW set last error\n" );
114 for (
i = 1;
i <= 0xbfff;
i++)
118 "failed to add atom %lx\n",
i );
123 "failed to add atom %lx\n",
i );
127 for (
i = 0xc000;
i <= 0xffff;
i++)
141 static const WCHAR resultW[] = {
'f',
'o',
'o',
'b',
'a',
'r',0,
'.',
'.',
'.'};
142 char in[257],
out[257];
151 ok( !
memcmp(
buf,
"foobar\0...", 10 ),
"bad buffer contents\n" );
156 for (
i = 0;
i < 10;
i++) bufW[
i] =
'.';
161 ok( !
memcmp( bufW, resultW, 10*
sizeof(
WCHAR) ),
"bad buffer contents\n" );
167 ok( !
memcmp(
buf,
"..........", 10 ),
"should not touch buffer\n" );
171 static const WCHAR sampleW[] = {
'.',
'.',
'.',
'.',
'.',
'.',
'.',
'.',
'.',
'.'};
173 for (
i = 0;
i < 10;
i++) bufW[
i] =
'.';
175 ok( !
memcmp( bufW, sampleW,
sizeof(sampleW) ),
"should not touch buffer\n" );
179 for (
i = 0;
i <= 0xbfff;
i++)
186 ok( (
len > 1) && (
len < 7),
"bad length %d\n",
len );
190 if (len <= 1 || len >= 7)
break;
204 ok(
len == 0,
"bad length %d\n",
len );
205 ok( !
memcmp(
buf,
"fooba\0....", 10 ),
"bad buffer contents\n");
208 static const WCHAR resW[] = {
'f',
'o',
'o',
'b',
'a',
'r',
'.',
'.',
'.',
'.'};
214 ok( !
memcmp( bufW, resW, 10*
sizeof(
WCHAR) ),
"bad buffer contents\n" );
220 ok(atom,
"couldn't add atom for %s\n",
in);
222 ok(
len == 255,
"length mismatch (%u instead of 255)\n",
len);
223 for (
i = 0;
i < 255;
i++)
225 ok(
out[
i] ==
"abcdefghij"[
i % 10],
"wrong string at %i (%c instead of %c)\n",
i,
out[
i],
"abcdefghij"[
i % 10]);
227 ok(
out[255] ==
'\0',
"wrong end of string\n");
233 for (
i = 0;
i < 9;
i++)
235 ok(
out[
i] ==
"abcdefghij"[
i % 10],
"wrong string at %i (%c instead of %c)\n",
i,
out[
i],
"abcdefghij"[
i % 10]);
237 ok(
out[9] ==
'\0',
"wrong end of string\n");
238 ok(
out[10] ==
'.',
"wrote after end of buf\n");
241 ok(!atom,
"succeeded\n");
245 for (
i = 0;
i <= 0xbfff;
i++)
253 ok( (
len > 1) && (
len < 7),
"bad length %d\n",
len );
257 if (len <= 1 || len >= 7)
break;
269 "0x%04x: got %u with %d (expected '1' or '0' with "
278 ok(atom,
"couldn't add atom for %s\n",
in);
280 ok(
len == 255,
"length mismatch (%u instead of 255)\n",
len);
281 for (
i = 0;
i < 255;
i++)
283 ok(
outW[
i] ==
"abcdefghij"[
i % 10],
"wrong string at %i (%c instead of %c)\n",
i,
outW[
i],
"abcdefghij"[
i % 10]);
285 ok(
outW[255] ==
'\0',
"wrong end of string\n");
288 ok(
len == 10,
"succeeded\n");
289 for (
i = 0;
i < 10;
i++)
291 ok(
outW[
i] ==
"abcdefghij"[
i % 10],
"wrong string at %i (%c instead of %c)\n",
i,
outW[
i],
"abcdefghij"[
i % 10]);
293 ok(
outW[10] ==
DOUBLE(
'.'),
"wrote after end of buf\n");
296 ok(!atom,
"succeeded\n");
314 for (
i = 0;
i < 256;
i++) bufferW[
i] =
'b';
328 ok( atom >= 0xc000,
"bad atom id %x\n", atom );
332 ok(
FindAtomA(
"foobar" ) == atom,
"could not find atom foobar\n" );
333 ok(
FindAtomA(
"FOOBAR" ) == atom,
"could not find atom FOOBAR\n" );
343 trace(
"WARNING: Unicode atom APIs are not supported on this platform\n");
347 ok( w_atom == atom,
"Unicode atom does not match ASCII\n" );
372 for (
i = 1;
i <= 0xbfff;
i++)
376 "failed to add atom %lx\n",
i );
381 "failed to add atom %lx\n",
i );
385 for (
i = 0xc000;
i <= 0xffff;
i++)
399 static const WCHAR resultW[] = {
'f',
'o',
'o',
'b',
'a',
'r',0,
'.',
'.',
'.'};
407 ok( !
memcmp(
buf,
"foobar\0...", 10 ),
"bad buffer contents\n" );
412 for (
i = 0;
i < 10;
i++) bufW[
i] =
'.';
417 ok( !
memcmp( bufW, resultW, 10*
sizeof(
WCHAR) ),
"bad buffer contents\n" );
423 ok(
len == 5,
"bad length %d\n",
len );
424 ok( !
memcmp(
buf,
"fooba\0....", 10 ),
"bad buffer contents\n" );
429 WCHAR resW[] = {
'f',
'o',
'o',
'b',
'a',
'\0',
'.',
'.',
'.',
'.'};
430 for (
i = 0;
i < 10;
i++) bufW[
i] =
'.';
434 ok(
len == 5,
"bad length %d\n",
len );
435 ok( !
memcmp( bufW, resW, 10*
sizeof(
WCHAR) ),
"bad buffer contents\n" );
441 ok( !
memcmp(
buf,
"..........", 10 ),
"should not touch buffer\n" );
445 static const WCHAR sampleW[] = {
'.',
'.',
'.',
'.',
'.',
'.',
'.',
'.',
'.',
'.'};
447 for (
i = 0;
i < 10;
i++) bufW[
i] =
'.';
449 ok( !
memcmp( bufW, sampleW,
sizeof(sampleW) ),
"should not touch buffer\n" );
453 for (
i = 0;
i <= 0xbfff;
i++)
469 ok(!
len,
"succeed with %u for %u\n",
len,
i);
484 ok(atom,
"couldn't add atom for %s\n",
in);
486 ok(
len == 255,
"length mismatch (%u instead of 255)\n",
len);
487 for (
i = 0;
i < 255;
i++)
489 ok(
out[
i] ==
"abcdefghij"[
i % 10],
"wrong string at %i (%c instead of %c)\n",
i,
out[
i],
"abcdefghij"[
i % 10]);
491 ok(
out[255] ==
'\0',
"wrong end of string\n");
494 ok(
len == 9,
"succeeded %d\n",
len);
495 for (
i = 0;
i < 9;
i++)
497 ok(
out[
i] ==
"abcdefghij"[
i % 10],
"wrong string at %i (%c instead of %c)\n",
i,
out[
i],
"abcdefghij"[
i % 10]);
499 ok(
out[9] ==
'\0',
"wrong end of string\n");
500 ok(
out[10] ==
'.',
"buffer overwrite\n");
503 ok(!atom,
"succeeded\n");
513 for (
i = 0;
i <= 0xbfff;
i++)
521 ok( (
len > 1) && (
len < 7),
"bad length %d\n",
len );
530 ok(!
len,
"succeed with %u for %u\n",
len,
i);
539 ok(atom,
"couldn't add atom for %s\n",
in);
541 ok(
len == 255,
"length mismatch (%u instead of 255)\n",
len);
542 for (
i = 0;
i < 255;
i++)
544 ok(
outW[
i] ==
"abcdefghij"[
i % 10],
"wrong string at %i (%c instead of %c)\n",
i,
outW[
i],
"abcdefghij"[
i % 10]);
546 ok(
outW[255] ==
'\0',
"wrong end of string\n");
549 ok(
len == 9,
"succeeded %d\n",
len);
550 for (
i = 0;
i < 9;
i++)
552 ok(
outW[
i] ==
"abcdefghij"[
i % 10],
"wrong string at %i (%c instead of %c)\n",
i,
outW[
i],
"abcdefghij"[
i % 10]);
554 ok(
outW[9] ==
'\0',
"wrong end of string\n");
558 ok(!atom,
"succeeded\n");
580 for (
i = 0;
i < 256;
i++) bufferW[
i] =
'b';
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
#define ERROR_INSUFFICIENT_BUFFER
#define ERROR_CALL_NOT_IMPLEMENTED
#define ERROR_INVALID_PARAMETER
ATOM WINAPI FindAtomW(LPCWSTR lpString)
UINT WINAPI GetAtomNameW(ATOM nAtom, LPWSTR lpBuffer, int nSize)
ATOM WINAPI GlobalFindAtomW(LPCWSTR lpString)
UINT WINAPI GlobalGetAtomNameW(ATOM nAtom, LPWSTR lpBuffer, int nSize)
ATOM WINAPI FindAtomA(LPCSTR lpString)
ATOM WINAPI AddAtomA(LPCSTR lpString)
ATOM WINAPI GlobalAddAtomA(LPCSTR lpString)
ATOM WINAPI AddAtomW(LPCWSTR lpString)
UINT WINAPI GetAtomNameA(ATOM nAtom, LPSTR lpBuffer, int nSize)
ATOM WINAPI GlobalFindAtomA(LPCSTR lpString)
UINT WINAPI GlobalGetAtomNameA(ATOM nAtom, LPSTR lpBuffer, int nSize)
ATOM WINAPI GlobalAddAtomW(LPCWSTR lpString)
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLenum GLenum GLenum GLenum outW
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
#define sprintf(buf, format,...)
static const WCHAR _foobarW[]
static const WCHAR foobarW[]
static void do_initW(WCHAR *tmp, const char *pattern, int len)
static void do_initA(char *tmp, const char *pattern, int len)
static void test_get_atom_name(void)
static void test_local_add_atom(void)
static const WCHAR integfmt[]
static void test_local_error_handling(void)
static const WCHAR FOOBARW[]
static void test_error_handling(void)
static void test_local_get_atom_name(void)
static void test_add_atom(void)
DWORD WINAPI GetLastError(void)
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
HWND WINAPI GetDesktopWindow(void)