Added a bunch of test cases for atoms.
[wine] / dlls / kernel / tests / atom.c
1 /*
2  * Unit tests for atom functions
3  *
4  * Copyright (c) 2002 Alexandre Julliard
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #include <stdarg.h>
22 #include <stdio.h>
23
24 #include "wine/test.h"
25 #include "windef.h"
26 #include "winbase.h"
27 #include "winerror.h"
28 #include "winuser.h"
29
30 #define DOUBLE(x)       (WCHAR)((x<<8)|(x))
31
32 static const WCHAR foobarW[] = {'f','o','o','b','a','r',0};
33 static const WCHAR FOOBARW[] = {'F','O','O','B','A','R',0};
34 static const WCHAR _foobarW[] = {'_','f','o','o','b','a','r',0};
35
36 static void do_initA(char* tmp, const char* pattern, int len)
37 {
38     const char* p = pattern;
39
40     while (len--)
41     {
42         *tmp++ = *p++;
43         if (!*p) p = pattern;
44     }
45     *tmp = '\0';
46 }
47
48 static void do_initW(WCHAR* tmp, const char* pattern, int len)
49 {
50     const char* p = pattern;
51
52     while (len--)
53     {
54         *tmp++ = *p++;
55         if (!*p) p = pattern;
56     }
57     *tmp = '\0';
58 }
59
60 static void print_integral( WCHAR* buffer, int atom )
61 {
62     BOOL first = TRUE;
63
64 #define X(v) { if (atom >= v) {*buffer++ = '0' + atom / v; first = FALSE; } else if (!first || v == 1) *buffer++ = '0'; atom %= v; }
65     *buffer++ = '#';
66     X(10000);
67     X(1000);
68     X(100);
69     X(10);
70     X(1);
71     *buffer = '\0';
72 #undef X
73 }
74
75 static BOOL unicode_OS;
76
77 static void test_add_atom(void)
78 {
79     ATOM atom, w_atom;
80     int i;
81
82     SetLastError( 0xdeadbeef );
83     atom = GlobalAddAtomA( "foobar" );
84     ok( atom >= 0xc000, "bad atom id %x\n", atom );
85     ok( GetLastError() == 0xdeadbeef, "GlobalAddAtomA set last error\n" );
86
87     /* Verify that it can be found (or not) appropriately */
88     ok( GlobalFindAtomA( "foobar" ) == atom, "could not find atom foobar\n" );
89     ok( GlobalFindAtomA( "FOOBAR" ) == atom, "could not find atom FOOBAR\n" );
90     ok( !GlobalFindAtomA( "_foobar" ), "found _foobar\n" );
91
92     /* Add the same atom, specifying string as unicode; should
93      * find the first one, not add a new one */
94     SetLastError( 0xdeadbeef );
95     w_atom = GlobalAddAtomW( foobarW );
96     if (w_atom && GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
97         unicode_OS = TRUE;
98     else
99         trace("WARNING: Unicode atom APIs are not supported on this platform\n");
100
101     if (unicode_OS)
102     {
103         ok( w_atom == atom, "Unicode atom does not match ASCII\n" );
104         ok( GetLastError() == 0xdeadbeef, "GlobalAddAtomW set last error\n" );
105     }
106
107     /* Verify that it can be found (or not) appropriately via unicode name */
108     if (unicode_OS)
109     {
110         ok( GlobalFindAtomW( foobarW ) == atom, "could not find atom foobar\n" );
111         ok( GlobalFindAtomW( FOOBARW ) == atom, "could not find atom FOOBAR\n" );
112         ok( !GlobalFindAtomW( _foobarW ), "found _foobar\n" );
113     }
114
115     /* Test integer atoms
116      * (0x0001 .. 0xbfff) should be valid;
117      * (0xc000 .. 0xffff) should be invalid */
118
119     SetLastError( 0xdeadbeef );
120     ok( GlobalAddAtomA(0) == 0 && GetLastError() == 0xdeadbeef, "succeeded to add atom 0\n" );
121     if (unicode_OS)
122     {
123         SetLastError( 0xdeadbeef );
124         ok( GlobalAddAtomW(0) == 0 && GetLastError() == 0xdeadbeef, "succeeded to add atom 0\n" );
125     }
126
127     SetLastError( 0xdeadbeef );
128     for (i = 1; i <= 0xbfff; i++)
129     {
130         SetLastError( 0xdeadbeef );
131         ok( GlobalAddAtomA((LPCSTR)i) == i && GetLastError() == 0xdeadbeef,
132             "failed to add atom %x\n", i );
133         if (unicode_OS)
134         {
135             SetLastError( 0xdeadbeef );
136             ok( GlobalAddAtomW((LPCWSTR)i) == i && GetLastError() == 0xdeadbeef,
137                 "failed to add atom %x\n", i );
138         }
139     }
140
141     for (i = 0xc000; i <= 0xffff; i++)
142     {
143         ok( !GlobalAddAtomA((LPCSTR)i), "succeeded adding %x\n", i );
144         if (unicode_OS)
145             ok( !GlobalAddAtomW((LPCWSTR)i), "succeeded adding %x\n", i );
146     }
147 }
148
149 static void test_get_atom_name(void)
150 {
151     char buf[10];
152     WCHAR bufW[10];
153     int i;
154     UINT len;
155     static const WCHAR resultW[] = {'f','o','o','b','a','r',0,'.','.','.'};
156     char in[257], out[257];
157     WCHAR inW[257], outW[257];
158
159     ATOM atom = GlobalAddAtomA( "foobar" );
160
161     /* Get the name of the atom we added above */
162     memset( buf, '.', sizeof(buf) );
163     len = GlobalGetAtomNameA( atom, buf, 10 );
164     ok( len == strlen("foobar"), "bad length %d\n", len );
165     ok( !memcmp( buf, "foobar\0...", 10 ), "bad buffer contents\n" );
166
167     /* Repeat, unicode-style */
168     if (unicode_OS)
169     {
170         for (i = 0; i < 10; i++) bufW[i] = '.';
171         SetLastError( 0xdeadbeef );
172         len = GlobalGetAtomNameW( atom, bufW, 10 );
173         ok( len && GetLastError() == 0xdeadbeef, "GlobalGetAtomNameW failed\n" );
174         ok( len == lstrlenW(foobarW), "bad length %d\n", len );
175         ok( !memcmp( bufW, resultW, 10*sizeof(WCHAR) ), "bad buffer contents\n" );
176     }
177
178     /* Check error code returns */
179     memset(buf, '.', 10);
180     ok( !GlobalGetAtomNameA( atom, buf,  0 ), "succeeded\n" );
181     ok( !memcmp( buf, "..........", 10 ), "should not touch buffer\n" );
182
183     if (unicode_OS)
184     {
185         static const WCHAR sampleW[10] = {'.','.','.','.','.','.','.','.','.','.'};
186
187         for (i = 0; i < 10; i++) bufW[i] = '.';
188         ok( !GlobalGetAtomNameW( atom, bufW, 0 ), "succeeded\n" );
189         ok( !memcmp( bufW, sampleW, 10 * sizeof(WCHAR) ), "should not touch buffer\n" );
190     }
191
192     /* Test integer atoms */
193     for (i = 0; i <= 0xbfff; i++)
194     {
195         memset( buf, 'a', 10 );
196         len = GlobalGetAtomNameA( (ATOM)i, buf, 10 );
197         if (i)
198         {
199             char res[20];
200             ok( (len > 1) && (len < 7), "bad length %d\n", len );
201             sprintf( res, "#%d", i );
202             memset( res + strlen(res) + 1, 'a', 10 );
203             ok( !memcmp( res, buf, 10 ), "bad buffer contents %s\n", buf );
204         }
205         else
206             ok( !len, "bad length %d\n", len );
207
208         SetLastError(0xdeadbeef);
209         len = GlobalGetAtomNameA( (ATOM)i, buf, 2);
210         if (!len) /* the NT way */
211         {
212             ok(GetLastError() == (i ? ERROR_MORE_DATA : ERROR_INVALID_PARAMETER),
213                "wrong error conditions %lu for %u\n", GetLastError(), i);
214         }
215         else /* the Win 9x way */
216         {
217             ok(GetLastError() == 0xdeadbeef,
218                "wrong error conditions %lu for %u\n", GetLastError(), i);
219         }
220     }
221
222     /* test string limits & overflow */
223     do_initA(in, "abcdefghij", 255);
224     atom = GlobalAddAtomA(in);
225     ok(atom, "couldn't add atom for %s\n", in);
226     len = GlobalGetAtomNameA(atom, out, sizeof(out));
227     ok(len == 255, "length mismatch (%u instead of 255)\n", len);
228     for (i = 0; i < 255; i++)
229     {
230         ok(out[i] == "abcdefghij"[i % 10], "wrong string at %i (%c instead of %c)\n", i, out[i], "abcdefghij"[i % 10]);
231     }
232     ok(out[255] == '\0', "wrong end of string\n");
233     memset(out, '.', sizeof(out));
234     SetLastError(0xdeadbeef);
235     len = GlobalGetAtomNameA(atom, out, 10);
236     if (!len) /* the NT way */
237     {
238         ok(GetLastError() == ERROR_MORE_DATA, "wrong error code (%lu instead of %u)\n", GetLastError(), ERROR_MORE_DATA);
239     }
240     else /* the Win9x way */
241     {
242         ok(GetLastError() == 0xdeadbeef, "wrong error code (%lu instead of %u)\n", GetLastError(), 0xdeadbeef);
243     }
244     for (i = 0; i < 9; i++)
245     {
246         ok(out[i] == "abcdefghij"[i % 10], "wrong string at %i (%c instead of %c)\n", i, out[i], "abcdefghij"[i % 10]);
247     }
248     ok(out[9] == '\0', "wrong end of string\n");
249     ok(out[10] == '.', "wrote after end of buf\n");
250     do_initA(in, "abcdefghij", 256);
251     atom = GlobalAddAtomA(in);
252     ok(!atom, "succeeded\n");
253     if (unicode_OS)
254     {
255         /* test integral atoms */
256         for (i = 0; i <= 0xbfff; i++)
257         {
258             memset(outW, 'a', sizeof(outW));
259             len = GlobalGetAtomNameW( (ATOM)i, outW, 10 );
260             if (i)
261             {
262                 WCHAR res[20];
263                 
264                 if (len < 7) /* FIXME: temporary before we fix it */
265                     ok( (len > 1) && (len < 7), "bad length %d\n", len );
266                 else
267                     todo_wine ok( (len > 1) && (len < 7), "bad length %d\n", len );
268                 print_integral( res, i );
269                 memset( res + lstrlenW(res) + 1, 'a', 10 * sizeof(WCHAR));
270                 ok( !memcmp( res, outW, 10 * sizeof(WCHAR) ), "bad buffer contents for %d\n", i );
271             }
272             else
273                 ok( !len, "bad length %d\n", len );
274
275             memset(outW, '.', sizeof(outW));
276             len = GlobalGetAtomNameW( (ATOM)i, outW, 1);
277             if (i)
278             {
279                 todo_wine ok(len == 1, "succeed (got %u instead of 1)\n", len);
280                 ok(outW[1] == DOUBLE('.'), "buffer overwrite\n");
281             }
282             else ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "0 badly handled\n");
283         }
284
285         do_initW(inW, "abcdefghij", 255);
286         atom = GlobalAddAtomW(inW);
287         ok(atom, "couldn't add atom for %s\n", in);
288         len = GlobalGetAtomNameW(atom, outW, sizeof(outW));
289         ok(len == 255, "length mismatch (%u instead of 255)\n", len);
290         for (i = 0; i < 255; i++)
291         {
292             ok(outW[i] == "abcdefghij"[i % 10], "wrong string at %i (%c instead of %c)\n", i, outW[i], "abcdefghij"[i % 10]);
293         }
294         ok(outW[255] == '\0', "wrong end of string\n");
295         memset(outW, '.', sizeof(outW));
296         len = GlobalGetAtomNameW(atom, outW, 10);
297         todo_wine ok(len == 10, "succeeded\n");
298         for (i = 0; i < 10; i++)
299         {
300             if (i < 9) /* FIXME: temporary */
301                 ok(outW[i] == "abcdefghij"[i % 10], "wrong string at %i (%c instead of %c)\n", i, outW[i], "abcdefghij"[i % 10]);
302             else
303                 todo_wine ok(outW[i] == "abcdefghij"[i % 10], "wrong string at %i (%c instead of %c)\n", i, outW[i], "abcdefghij"[i % 10]);
304         }
305         ok(outW[10] == DOUBLE('.'), "wrote after end of buf\n");
306         do_initW(inW, "abcdefghij", 256);
307         atom = GlobalAddAtomW(inW);
308         ok(!atom, "succeeded\n");
309         ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error code\n");
310     }
311 }
312
313 static void test_error_handling(void)
314 {
315     char buffer[260];
316     WCHAR bufferW[260];
317     int i;
318
319     memset( buffer, 'a', 256 );
320     buffer[256] = 0;
321     ok( !GlobalAddAtomA(buffer), "add succeeded\n" );
322     ok( !GlobalFindAtomA(buffer), "find succeeded\n" );
323
324     if (unicode_OS)
325     {
326         for (i = 0; i < 256; i++) bufferW[i] = 'b';
327         bufferW[256] = 0;
328         ok( !GlobalAddAtomW(bufferW), "add succeeded\n" );
329         ok( !GlobalFindAtomW(bufferW), "find succeeded\n" );
330     }
331 }
332
333 static void test_local_add_atom(void)
334 {
335     ATOM atom, w_atom;
336     int i;
337
338     SetLastError( 0xdeadbeef );
339     atom = AddAtomA( "foobar" );
340     ok( atom >= 0xc000, "bad atom id %x\n", atom );
341     ok( GetLastError() == 0xdeadbeef, "AddAtomA set last error\n" );
342
343     /* Verify that it can be found (or not) appropriately */
344     ok( FindAtomA( "foobar" ) == atom, "could not find atom foobar\n" );
345     ok( FindAtomA( "FOOBAR" ) == atom, "could not find atom FOOBAR\n" );
346     ok( !FindAtomA( "_foobar" ), "found _foobar\n" );
347
348     /* Add the same atom, specifying string as unicode; should
349      * find the first one, not add a new one */
350     SetLastError( 0xdeadbeef );
351     w_atom = AddAtomW( foobarW );
352     if (w_atom && GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
353         unicode_OS = TRUE;
354     else
355         trace("WARNING: Unicode atom APIs are not supported on this platform\n");
356
357     if (unicode_OS)
358     {
359         ok( w_atom == atom, "Unicode atom does not match ASCII\n" );
360         ok( GetLastError() == 0xdeadbeef, "AddAtomW set last error\n" );
361     }
362
363     /* Verify that it can be found (or not) appropriately via unicode name */
364     if (unicode_OS)
365     {
366         ok( FindAtomW( foobarW ) == atom, "could not find atom foobar\n" );
367         ok( FindAtomW( FOOBARW ) == atom, "could not find atom FOOBAR\n" );
368         ok( !FindAtomW( _foobarW ), "found _foobar\n" );
369     }
370
371     /* Test integer atoms
372      * (0x0001 .. 0xbfff) should be valid;
373      * (0xc000 .. 0xffff) should be invalid */
374
375     SetLastError( 0xdeadbeef );
376     ok( AddAtomA(0) == 0 && GetLastError() == 0xdeadbeef, "succeeded to add atom 0\n" );
377     if (unicode_OS)
378     {
379         SetLastError( 0xdeadbeef );
380         ok( AddAtomW(0) == 0 && GetLastError() == 0xdeadbeef, "succeeded to add atom 0\n" );
381     }
382
383     SetLastError( 0xdeadbeef );
384     for (i = 1; i <= 0xbfff; i++)
385     {
386         SetLastError( 0xdeadbeef );
387         ok( AddAtomA((LPCSTR)i) == i && GetLastError() == 0xdeadbeef,
388             "failed to add atom %x\n", i );
389         if (unicode_OS)
390         {
391             SetLastError( 0xdeadbeef );
392             ok( AddAtomW((LPCWSTR)i) == i && GetLastError() == 0xdeadbeef,
393                 "failed to add atom %x\n", i );
394         }
395     }
396
397     for (i = 0xc000; i <= 0xffff; i++)
398     {
399         ok( !AddAtomA((LPCSTR)i), "succeeded adding %x\n", i );
400         if (unicode_OS)
401             ok( !AddAtomW((LPCWSTR)i), "succeeded adding %x\n", i );
402     }
403 }
404
405 static void test_local_get_atom_name(void)
406 {
407     char buf[10], in[257], out[257];
408     WCHAR bufW[10], inW[257], outW[257];
409     int i;
410     UINT len;
411     static const WCHAR resultW[] = {'f','o','o','b','a','r',0,'.','.','.'};
412
413     ATOM atom = AddAtomA( "foobar" );
414
415     /* Get the name of the atom we added above */
416     memset( buf, '.', sizeof(buf) );
417     len = GetAtomNameA( atom, buf, 10 );
418     ok( len == strlen("foobar"), "bad length %d\n", len );
419     ok( !memcmp( buf, "foobar\0...", 10 ), "bad buffer contents\n" );
420
421     /* Repeat, unicode-style */
422     if (unicode_OS)
423     {
424         for (i = 0; i < 10; i++) bufW[i] = '.';
425         SetLastError( 0xdeadbeef );
426         len = GetAtomNameW( atom, bufW, 10 );
427         ok( len && GetLastError() == 0xdeadbeef, "GetAtomNameW failed\n" );
428         ok( len == lstrlenW(foobarW), "bad length %d\n", len );
429         ok( !memcmp( bufW, resultW, 10*sizeof(WCHAR) ), "bad buffer contents\n" );
430     }
431
432     /* Check error code returns */
433     memset(buf, '.', 10);
434     ok( !GetAtomNameA( atom, buf,  0 ), "succeeded\n" );
435     ok( !memcmp( buf, "..........", 10 ), "should not touch buffer\n" );
436
437     if (unicode_OS)
438     {
439         static const WCHAR sampleW[10] = {'.','.','.','.','.','.','.','.','.','.'};
440
441         for (i = 0; i < 10; i++) bufW[i] = '.';
442         ok( !GetAtomNameW( atom, bufW, 0 ), "succeeded\n" );
443         ok( !memcmp( bufW, sampleW, 10 * sizeof(WCHAR) ), "should not touch buffer\n" );
444     }
445
446     /* Test integer atoms */
447     for (i = 0; i <= 0xbfff; i++)
448     {
449         memset( buf, 'a', 10 );
450         len = GetAtomNameA( (ATOM)i, buf, 10 );
451         if (i)
452         {
453             char res[20];
454             ok( (len > 1) && (len < 7), "bad length %d for %s\n", len, buf );
455             sprintf( res, "#%d", i );
456             memset( res + strlen(res) + 1, 'a', 10 );
457             ok( !memcmp( res, buf, 10 ), "bad buffer contents %s\n", buf );
458         }
459         else
460             ok( !len, "bad length %d\n", len );
461
462         len = GetAtomNameA( (ATOM)i, buf, 1);
463         ok(!len, "succeed\n");
464         if (i)
465             todo_wine ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "wrong error conditions %lu for %u\n", GetLastError(), i);
466         else
467             ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error conditions %lu for %u\n", GetLastError(), i);
468     }
469     /* test string limits & overflow */
470     do_initA(in, "abcdefghij", 255);
471     atom = AddAtomA(in);
472     ok(atom, "couldn't add atom for %s\n", in);
473     len = GetAtomNameA(atom, out, sizeof(out));
474     ok(len == 255, "length mismatch (%u instead of 255)\n", len);
475     for (i = 0; i < 255; i++)
476     {
477         ok(out[i] == "abcdefghij"[i % 10], "wrong string at %i (%c instead of %c)\n", i, out[i], "abcdefghij"[i % 10]);
478     }
479     ok(out[255] == '\0', "wrong end of string\n");
480     memset(out, '.', sizeof(out));
481     len = GetAtomNameA(atom, out, 10);
482     todo_wine ok(len == 9, "succeeded %d\n", len);
483     for (i = 0; i < 9; i++)
484     {
485         ok(out[i] == "abcdefghij"[i % 10], "wrong string at %i (%c instead of %c)\n", i, out[i], "abcdefghij"[i % 10]);
486     }
487     ok(out[9] == '\0', "wrong end of string\n");
488     ok(out[10] == '.', "buffer overwrite\n");
489     do_initA(in, "abcdefghij", 256);
490     atom = AddAtomA(in);
491     ok(!atom, "succeeded\n");
492     ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error code (%lu)\n", GetLastError());
493
494     if (unicode_OS)
495     {
496         /* test integral atoms */
497         for (i = 0; i <= 0xbfff; i++)
498         {
499             memset(outW, 'a', sizeof(outW));
500             len = GetAtomNameW( (ATOM)i, outW, 10 );
501             if (i)
502             {
503                 WCHAR res[20];
504                 
505                 if (len < 7) /* FIXME: temporary before we fix it */
506                     ok( (len > 1) && (len < 7), "bad length %d\n", len );
507                 else
508                     todo_wine ok( (len > 1) && (len < 7), "bad length %d\n", len );
509                 print_integral( res, i );
510                 memset( res + lstrlenW(res) + 1, 'a', 10 * sizeof(WCHAR));
511                 ok( !memcmp( res, outW, 10 * sizeof(WCHAR) ), "bad buffer contents for %d\n", i );
512             }
513             else
514                 ok( !len, "bad length %d\n", len );
515
516             len = GetAtomNameW( (ATOM)i, outW, 1);
517             ok(!len, "succeed\n");
518             ok(GetLastError() == (i ? ERROR_INSUFFICIENT_BUFFER : ERROR_INVALID_PARAMETER),
519                "wrong error conditions %lu for %u\n", GetLastError(), i);
520         }
521         do_initW(inW, "abcdefghij", 255);
522         atom = AddAtomW(inW);
523         ok(atom, "couldn't add atom for %s\n", in);
524         len = GetAtomNameW(atom, outW, sizeof(outW));
525         ok(len == 255, "length mismatch (%u instead of 255)\n", len);
526         for (i = 0; i < 255; i++)
527         {
528             ok(outW[i] == "abcdefghij"[i % 10], "wrong string at %i (%c instead of %c)\n", i, outW[i], "abcdefghij"[i % 10]);
529         }
530         ok(outW[255] == '\0', "wrong end of string\n");
531         memset(outW, '.', sizeof(outW));
532         len = GetAtomNameW(atom, outW, 10);
533         todo_wine ok(len == 9, "succeeded %d\n", len);
534         for (i = 0; i < 9; i++)
535         {
536             ok(outW[i] == "abcdefghij"[i % 10], "wrong string at %i (%c instead of %c)\n", i, outW[i], "abcdefghij"[i % 10]);
537         }
538         ok(outW[9] == '\0', "wrong end of string\n");
539         ok(outW[10] == DOUBLE('.'), "buffer overwrite\n");
540         do_initW(inW, "abcdefghij", 256);
541         atom = AddAtomW(inW);
542         ok(!atom, "succeeded\n");
543         ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error code (%lu)\n", GetLastError());
544     }
545 }
546
547 static void test_local_error_handling(void)
548 {
549     char buffer[260];
550     WCHAR bufferW[260];
551     int i;
552
553     memset( buffer, 'a', 256 );
554     buffer[256] = 0;
555     ok( !AddAtomA(buffer), "add succeeded\n" );
556     ok( !FindAtomA(buffer), "find succeeded\n" );
557
558     if (unicode_OS)
559     {
560         for (i = 0; i < 256; i++) bufferW[i] = 'b';
561         bufferW[256] = 0;
562         ok( !AddAtomW(bufferW), "add succeeded\n" );
563         ok( !FindAtomW(bufferW), "find succeeded\n" );
564     }
565 }
566
567 START_TEST(atom)
568 {
569     test_add_atom();
570     test_get_atom_name();
571     test_error_handling();
572     test_local_add_atom();
573     test_local_get_atom_name();
574     test_local_error_handling();
575 }