kernel32: Add test for pending ReadFileEx/WriteFileEx calls.
[wine] / dlls / kernel32 / tests / directory.c
1 /*
2  * Unit test suite for directory functions.
3  *
4  * Copyright 2002 Dmitry Timoshkov
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20
21 #include <stdarg.h>
22
23 #include "wine/test.h"
24 #include "windef.h"
25 #include "winbase.h"
26 #include "winerror.h"
27
28 /* If you change something in these tests, please do the same
29  * for GetSystemDirectory tests.
30  */
31 static void test_GetWindowsDirectoryA(void)
32 {
33     UINT len, len_with_null;
34     char buf[MAX_PATH];
35
36     len_with_null = GetWindowsDirectoryA(NULL, 0);
37     ok(len_with_null <= MAX_PATH, "should fit into MAX_PATH\n");
38
39     lstrcpyA(buf, "foo");
40     len_with_null = GetWindowsDirectoryA(buf, 1);
41     ok(lstrcmpA(buf, "foo") == 0, "should not touch the buffer\n");
42
43     lstrcpyA(buf, "foo");
44     len = GetWindowsDirectoryA(buf, len_with_null - 1);
45     ok(lstrcmpA(buf, "foo") == 0, "should not touch the buffer\n");
46     ok(len == len_with_null, "GetWindowsDirectoryW returned %d, expected %d\n",
47        len, len_with_null);
48
49     lstrcpyA(buf, "foo");
50     len = GetWindowsDirectoryA(buf, len_with_null);
51     ok(lstrcmpA(buf, "foo") != 0, "should touch the buffer\n");
52     ok(len == strlen(buf), "returned length should be equal to the length of string\n");
53     ok(len == len_with_null-1, "GetWindowsDirectoryA returned %d, expected %d\n",
54        len, len_with_null-1);
55 }
56
57 static void test_GetWindowsDirectoryW(void)
58 {
59     UINT len, len_with_null;
60     WCHAR buf[MAX_PATH];
61     static const WCHAR fooW[] = {'f','o','o',0};
62
63     len_with_null = GetWindowsDirectoryW(NULL, 0);
64     if (len_with_null == 0 && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
65     {
66         win_skip("GetWindowsDirectoryW is not implemented\n");
67         return;
68     }
69     ok(len_with_null <= MAX_PATH, "should fit into MAX_PATH\n");
70
71     lstrcpyW(buf, fooW);
72     len = GetWindowsDirectoryW(buf, 1);
73     ok(lstrcmpW(buf, fooW) == 0, "should not touch the buffer\n");
74     ok(len == len_with_null, "GetWindowsDirectoryW returned %d, expected %d\n",
75        len, len_with_null);
76
77     lstrcpyW(buf, fooW);
78     len = GetWindowsDirectoryW(buf, len_with_null - 1);
79     ok(lstrcmpW(buf, fooW) == 0, "should not touch the buffer\n");
80     ok(len == len_with_null, "GetWindowsDirectoryW returned %d, expected %d\n",
81        len, len_with_null);
82
83     lstrcpyW(buf, fooW);
84     len = GetWindowsDirectoryW(buf, len_with_null);
85     ok(lstrcmpW(buf, fooW) != 0, "should touch the buffer\n");
86     ok(len == lstrlenW(buf), "returned length should be equal to the length of string\n");
87     ok(len == len_with_null-1, "GetWindowsDirectoryW returned %d, expected %d\n",
88        len, len_with_null-1);
89 }
90
91
92 /* If you change something in these tests, please do the same
93  * for GetWindowsDirectory tests.
94  */
95 static void test_GetSystemDirectoryA(void)
96 {
97     UINT len, len_with_null;
98     char buf[MAX_PATH];
99
100     len_with_null = GetSystemDirectoryA(NULL, 0);
101     ok(len_with_null <= MAX_PATH, "should fit into MAX_PATH\n");
102
103     lstrcpyA(buf, "foo");
104     len = GetSystemDirectoryA(buf, 1);
105     ok(lstrcmpA(buf, "foo") == 0, "should not touch the buffer\n");
106     ok(len == len_with_null, "GetSystemDirectoryA returned %d, expected %d\n",
107        len, len_with_null);
108
109     lstrcpyA(buf, "foo");
110     len = GetSystemDirectoryA(buf, len_with_null - 1);
111     ok(lstrcmpA(buf, "foo") == 0, "should not touch the buffer\n");
112     ok(len == len_with_null, "GetSystemDirectoryA returned %d, expected %d\n",
113        len, len_with_null);
114
115     lstrcpyA(buf, "foo");
116     len = GetSystemDirectoryA(buf, len_with_null);
117     ok(lstrcmpA(buf, "foo") != 0, "should touch the buffer\n");
118     ok(len == strlen(buf), "returned length should be equal to the length of string\n");
119     ok(len == len_with_null-1, "GetSystemDirectoryW returned %d, expected %d\n",
120        len, len_with_null-1);
121 }
122
123 static void test_GetSystemDirectoryW(void)
124 {
125     UINT len, len_with_null;
126     WCHAR buf[MAX_PATH];
127     static const WCHAR fooW[] = {'f','o','o',0};
128
129     len_with_null = GetSystemDirectoryW(NULL, 0);
130     if (len_with_null == 0 && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
131     {
132         win_skip("GetSystemDirectoryW is not available\n");
133         return;
134     }
135     ok(len_with_null <= MAX_PATH, "should fit into MAX_PATH\n");
136
137     lstrcpyW(buf, fooW);
138     len = GetSystemDirectoryW(buf, 1);
139     ok(lstrcmpW(buf, fooW) == 0, "should not touch the buffer\n");
140     ok(len == len_with_null, "GetSystemDirectoryW returned %d, expected %d\n",
141        len, len_with_null);
142
143     lstrcpyW(buf, fooW);
144     len = GetSystemDirectoryW(buf, len_with_null - 1);
145     ok(lstrcmpW(buf, fooW) == 0, "should not touch the buffer\n");
146     ok(len == len_with_null, "GetSystemDirectoryW returned %d, expected %d\n",
147        len, len_with_null);
148
149     lstrcpyW(buf, fooW);
150     len = GetSystemDirectoryW(buf, len_with_null);
151     ok(lstrcmpW(buf, fooW) != 0, "should touch the buffer\n");
152     ok(len == lstrlenW(buf), "returned length should be equal to the length of string\n");
153     ok(len == len_with_null-1, "GetSystemDirectoryW returned %d, expected %d\n",
154        len, len_with_null-1);
155 }
156
157 static void test_CreateDirectoryA(void)
158 {
159     char tmpdir[MAX_PATH];
160     BOOL ret;
161
162     ret = CreateDirectoryA(NULL, NULL);
163     ok(ret == FALSE && (GetLastError() == ERROR_PATH_NOT_FOUND ||
164                         GetLastError() == ERROR_INVALID_PARAMETER),
165        "CreateDirectoryA(NULL): ret=%d err=%d\n", ret, GetLastError());
166
167     ret = CreateDirectoryA("", NULL);
168     ok(ret == FALSE && (GetLastError() == ERROR_BAD_PATHNAME ||
169                         GetLastError() == ERROR_PATH_NOT_FOUND),
170        "CreateDirectoryA(%s): ret=%d err=%d\n", tmpdir, ret, GetLastError());
171
172     ret = GetSystemDirectoryA(tmpdir, MAX_PATH);
173     ok(ret < MAX_PATH, "System directory should fit into MAX_PATH\n");
174
175     ret = SetCurrentDirectoryA(tmpdir);
176     ok(ret == TRUE, "could not chdir to the System directory\n");
177
178     ret = CreateDirectoryA(".", NULL);
179     ok(ret == FALSE && GetLastError() == ERROR_ALREADY_EXISTS,
180        "CreateDirectoryA(%s): ret=%d err=%d\n", tmpdir, ret, GetLastError());
181
182
183     ret = CreateDirectoryA("..", NULL);
184     ok(ret == FALSE && GetLastError() == ERROR_ALREADY_EXISTS,
185        "CreateDirectoryA(%s): ret=%d err=%d\n", tmpdir, ret, GetLastError());
186
187     GetTempPathA(MAX_PATH, tmpdir);
188     tmpdir[3] = 0; /* truncate the path */
189     ret = CreateDirectoryA(tmpdir, NULL);
190     ok(ret == FALSE && (GetLastError() == ERROR_ALREADY_EXISTS ||
191                         GetLastError() == ERROR_ACCESS_DENIED),
192        "CreateDirectoryA(%s): ret=%d err=%d\n", tmpdir, ret, GetLastError());
193
194     GetTempPathA(MAX_PATH, tmpdir);
195     lstrcatA(tmpdir, "Please Remove Me");
196     ret = CreateDirectoryA(tmpdir, NULL);
197     ok(ret == TRUE,       "CreateDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError());
198
199     ret = CreateDirectoryA(tmpdir, NULL);
200     ok(ret == FALSE && GetLastError() == ERROR_ALREADY_EXISTS,
201        "CreateDirectoryA(%s): ret=%d err=%d\n", tmpdir, ret, GetLastError());
202
203     ret = RemoveDirectoryA(tmpdir);
204     ok(ret == TRUE,
205        "RemoveDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError());
206
207
208     lstrcatA(tmpdir, "?");
209     ret = CreateDirectoryA(tmpdir, NULL);
210     ok(ret == FALSE && (GetLastError() == ERROR_INVALID_NAME ||
211                         GetLastError() == ERROR_PATH_NOT_FOUND),
212        "CreateDirectoryA(%s): ret=%d err=%d\n", tmpdir, ret, GetLastError());
213     RemoveDirectoryA(tmpdir);
214
215     tmpdir[lstrlenA(tmpdir) - 1] = '*';
216     ret = CreateDirectoryA(tmpdir, NULL);
217     ok(ret == FALSE && (GetLastError() == ERROR_INVALID_NAME ||
218                         GetLastError() == ERROR_PATH_NOT_FOUND),
219        "CreateDirectoryA(%s): ret=%d err=%d\n", tmpdir, ret, GetLastError());
220     RemoveDirectoryA(tmpdir);
221
222     GetTempPathA(MAX_PATH, tmpdir);
223     lstrcatA(tmpdir, "Please Remove Me/Please Remove Me");
224     ret = CreateDirectoryA(tmpdir, NULL);
225     ok(ret == FALSE && GetLastError() == ERROR_PATH_NOT_FOUND, 
226        "CreateDirectoryA(%s): ret=%d err=%d\n", tmpdir, ret, GetLastError());
227     RemoveDirectoryA(tmpdir);
228
229     /* Test behavior with a trailing dot.
230      * The directory should be created without the dot.
231      */
232     GetTempPathA(MAX_PATH, tmpdir);
233     lstrcatA(tmpdir, "Please Remove Me.");
234     ret = CreateDirectoryA(tmpdir, NULL);
235     ok(ret == TRUE,
236        "CreateDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError());
237
238     lstrcatA(tmpdir, "/Please Remove Me");
239     ret = CreateDirectoryA(tmpdir, NULL);
240     ok(ret == TRUE,
241        "CreateDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError());
242     ret = RemoveDirectoryA(tmpdir);
243     ok(ret == TRUE,
244        "RemoveDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError());
245
246     GetTempPathA(MAX_PATH, tmpdir);
247     lstrcatA(tmpdir, "Please Remove Me");
248     ret = RemoveDirectoryA(tmpdir);
249     ok(ret == TRUE,
250        "RemoveDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError());
251
252     /* Test behavior with two trailing dots.
253      * The directory should be created without the trailing dots.
254      */
255     GetTempPathA(MAX_PATH, tmpdir);
256     lstrcatA(tmpdir, "Please Remove Me..");
257     ret = CreateDirectoryA(tmpdir, NULL);
258     ok(ret == TRUE,
259        "CreateDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError());
260
261     lstrcatA(tmpdir, "/Please Remove Me");
262     ret = CreateDirectoryA(tmpdir, NULL);
263     ok(ret == TRUE || /* On Win98 */
264        (ret == FALSE && GetLastError() == ERROR_PATH_NOT_FOUND), /* On NT! */
265        "CreateDirectoryA(%s): ret=%d err=%d\n", tmpdir, ret, GetLastError());
266     if (ret == TRUE)
267     {
268         ret = RemoveDirectoryA(tmpdir);
269         ok(ret == TRUE,
270            "RemoveDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError());
271     }
272
273     GetTempPathA(MAX_PATH, tmpdir);
274     lstrcatA(tmpdir, "Please Remove Me");
275     ret = RemoveDirectoryA(tmpdir);
276     ok(ret == TRUE,
277        "RemoveDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError());
278
279     /* Test behavior with a trailing space.
280      * The directory should be created without the trailing space.
281      */
282     GetTempPathA(MAX_PATH, tmpdir);
283     lstrcatA(tmpdir, "Please Remove Me ");
284     ret = CreateDirectoryA(tmpdir, NULL);
285     ok(ret == TRUE,
286        "CreateDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError());
287
288     lstrcatA(tmpdir, "/Please Remove Me");
289     ret = CreateDirectoryA(tmpdir, NULL);
290     ok(ret == TRUE || /* On Win98 */
291        (ret == FALSE && GetLastError() == ERROR_PATH_NOT_FOUND), /* On NT! */
292        "CreateDirectoryA(%s): ret=%d err=%d\n", tmpdir, ret, GetLastError());
293     if (ret == TRUE)
294     {
295         ret = RemoveDirectoryA(tmpdir);
296         ok(ret == TRUE,
297            "RemoveDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError());
298     }
299
300     GetTempPathA(MAX_PATH, tmpdir);
301     lstrcatA(tmpdir, "Please Remove Me");
302     ret = RemoveDirectoryA(tmpdir);
303     ok(ret == TRUE,
304        "RemoveDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError());
305
306     /* Test behavior with a trailing space.
307      * The directory should be created without the trailing spaces.
308      */
309     GetTempPathA(MAX_PATH, tmpdir);
310     lstrcatA(tmpdir, "Please Remove Me  ");
311     ret = CreateDirectoryA(tmpdir, NULL);
312     ok(ret == TRUE,
313        "CreateDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError());
314
315     lstrcatA(tmpdir, "/Please Remove Me");
316     ret = CreateDirectoryA(tmpdir, NULL);
317     ok(ret == TRUE || /* On Win98 */
318        (ret == FALSE && GetLastError() == ERROR_PATH_NOT_FOUND), /* On NT! */
319        "CreateDirectoryA(%s): ret=%d err=%d\n", tmpdir, ret, GetLastError());
320     if (ret == TRUE)
321     {
322         ret = RemoveDirectoryA(tmpdir);
323         ok(ret == TRUE,
324            "RemoveDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError());
325     }
326
327     GetTempPathA(MAX_PATH, tmpdir);
328     lstrcatA(tmpdir, "Please Remove Me");
329     ret = RemoveDirectoryA(tmpdir);
330     ok(ret == TRUE,
331        "RemoveDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError());
332 }
333
334 static void test_CreateDirectoryW(void)
335 {
336     WCHAR tmpdir[MAX_PATH];
337     BOOL ret;
338     static const WCHAR empty_strW[] = { 0 };
339     static const WCHAR tmp_dir_name[] = {'P','l','e','a','s','e',' ','R','e','m','o','v','e',' ','M','e',0};
340     static const WCHAR dotW[] = {'.',0};
341     static const WCHAR slashW[] = {'/',0};
342     static const WCHAR dotdotW[] = {'.','.',0};
343     static const WCHAR questionW[] = {'?',0};
344
345     ret = CreateDirectoryW(NULL, NULL);
346     if (!ret && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
347     {
348         win_skip("CreateDirectoryW is not available\n");
349         return;
350     }
351     ok(ret == FALSE && GetLastError() == ERROR_PATH_NOT_FOUND,
352        "should not create NULL path ret %u err %u\n", ret, GetLastError());
353
354     ret = CreateDirectoryW(empty_strW, NULL);
355     ok(ret == FALSE && GetLastError() == ERROR_PATH_NOT_FOUND,
356        "should not create empty path ret %u err %u\n", ret, GetLastError());
357
358     ret = GetSystemDirectoryW(tmpdir, MAX_PATH);
359     ok(ret < MAX_PATH, "System directory should fit into MAX_PATH\n");
360
361     ret = SetCurrentDirectoryW(tmpdir);
362     ok(ret == TRUE, "could not chdir to the System directory ret %u err %u\n", ret, GetLastError());
363
364     ret = CreateDirectoryW(dotW, NULL);
365     ok(ret == FALSE && GetLastError() == ERROR_ALREADY_EXISTS,
366        "should not create existing path ret %u err %u\n", ret, GetLastError());
367
368     ret = CreateDirectoryW(dotdotW, NULL);
369     ok(ret == FALSE && GetLastError() == ERROR_ALREADY_EXISTS,
370        "should not create existing path ret %u err %u\n", ret, GetLastError());
371
372     GetTempPathW(MAX_PATH, tmpdir);
373     tmpdir[3] = 0; /* truncate the path */
374     ret = CreateDirectoryW(tmpdir, NULL);
375     ok(ret == FALSE && (GetLastError() == ERROR_ACCESS_DENIED || GetLastError() == ERROR_ALREADY_EXISTS),
376        "should deny access to the drive root ret %u err %u\n", ret, GetLastError());
377
378     GetTempPathW(MAX_PATH, tmpdir);
379     lstrcatW(tmpdir, tmp_dir_name);
380     ret = CreateDirectoryW(tmpdir, NULL);
381     ok(ret == TRUE, "CreateDirectoryW should always succeed\n");
382
383     ret = CreateDirectoryW(tmpdir, NULL);
384     ok(ret == FALSE && GetLastError() == ERROR_ALREADY_EXISTS,
385        "should not create existing path ret %u err %u\n", ret, GetLastError());
386
387     ret = RemoveDirectoryW(tmpdir);
388     ok(ret == TRUE, "RemoveDirectoryW should always succeed\n");
389
390     lstrcatW(tmpdir, questionW);
391     ret = CreateDirectoryW(tmpdir, NULL);
392     ok(ret == FALSE && GetLastError() == ERROR_INVALID_NAME,
393        "CreateDirectoryW with ? wildcard name should fail with error 183, ret=%s error=%d\n",
394        ret ? " True" : "False", GetLastError());
395     ret = RemoveDirectoryW(tmpdir);
396     ok(ret == FALSE, "RemoveDirectoryW should have failed\n");
397
398     tmpdir[lstrlenW(tmpdir) - 1] = '*';
399     ret = CreateDirectoryW(tmpdir, NULL);
400     ok(ret == FALSE && GetLastError() == ERROR_INVALID_NAME,
401        "CreateDirectoryW with * wildcard name should fail with error 183, ret=%s error=%d\n",
402        ret ? " True" : "False", GetLastError());
403     ret = RemoveDirectoryW(tmpdir);
404     ok(ret == FALSE, "RemoveDirectoryW should have failed\n");
405     
406     GetTempPathW(MAX_PATH, tmpdir);
407     lstrcatW(tmpdir, tmp_dir_name);
408     lstrcatW(tmpdir, slashW);
409     lstrcatW(tmpdir, tmp_dir_name);
410     ret = CreateDirectoryW(tmpdir, NULL);
411     ok(ret == FALSE && GetLastError() == ERROR_PATH_NOT_FOUND,
412       "CreateDirectoryW with multiple nonexistent directories in path should fail ret %u err %u\n",
413        ret, GetLastError());
414     ret = RemoveDirectoryW(tmpdir);
415     ok(ret == FALSE, "RemoveDirectoryW should have failed\n");
416 }
417
418 static void test_RemoveDirectoryA(void)
419 {
420     char tmpdir[MAX_PATH];
421     BOOL ret;
422
423     GetTempPathA(MAX_PATH, tmpdir);
424     lstrcatA(tmpdir, "Please Remove Me");
425     ret = CreateDirectoryA(tmpdir, NULL);
426     ok(ret == TRUE, "CreateDirectoryA should always succeed\n");
427
428     ret = RemoveDirectoryA(tmpdir);
429     ok(ret == TRUE, "RemoveDirectoryA should always succeed\n");
430
431     lstrcatA(tmpdir, "?");
432     ret = RemoveDirectoryA(tmpdir);
433     ok(ret == FALSE && (GetLastError() == ERROR_INVALID_NAME ||
434                         GetLastError() == ERROR_PATH_NOT_FOUND),
435        "RemoveDirectoryA with ? wildcard name should fail, ret=%s error=%d\n",
436        ret ? " True" : "False", GetLastError());
437
438     tmpdir[lstrlenA(tmpdir) - 1] = '*';
439     ret = RemoveDirectoryA(tmpdir);
440     ok(ret == FALSE && (GetLastError() == ERROR_INVALID_NAME ||
441                         GetLastError() == ERROR_PATH_NOT_FOUND),
442        "RemoveDirectoryA with * wildcard name should fail, ret=%s error=%d\n",
443        ret ? " True" : "False", GetLastError());
444 }
445
446 static void test_RemoveDirectoryW(void)
447 {
448     WCHAR tmpdir[MAX_PATH];
449     BOOL ret;
450     static const WCHAR tmp_dir_name[] = {'P','l','e','a','s','e',' ','R','e','m','o','v','e',' ','M','e',0};
451     static const WCHAR questionW[] = {'?',0};
452
453     GetTempPathW(MAX_PATH, tmpdir);
454     lstrcatW(tmpdir, tmp_dir_name);
455     ret = CreateDirectoryW(tmpdir, NULL);
456     if (!ret && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
457     {
458         win_skip("CreateDirectoryW is not available\n");
459         return;
460     }
461
462     ok(ret == TRUE, "CreateDirectoryW should always succeed\n");
463
464     ret = RemoveDirectoryW(tmpdir);
465     ok(ret == TRUE, "RemoveDirectoryW should always succeed\n");
466
467     lstrcatW(tmpdir, questionW);
468     ret = RemoveDirectoryW(tmpdir);
469     ok(ret == FALSE && GetLastError() == ERROR_INVALID_NAME,
470        "RemoveDirectoryW with wildcard should fail with error 183, ret=%s error=%d\n",
471        ret ? " True" : "False", GetLastError());
472
473     tmpdir[lstrlenW(tmpdir) - 1] = '*';
474     ret = RemoveDirectoryW(tmpdir);
475     ok(ret == FALSE && GetLastError() == ERROR_INVALID_NAME,
476        "RemoveDirectoryW with * wildcard name should fail with error 183, ret=%s error=%d\n",
477        ret ? " True" : "False", GetLastError());
478 }
479
480 static void test_SetCurrentDirectoryA(void)
481 {
482     SetLastError(0);
483     ok( !SetCurrentDirectoryA( "\\some_dummy_dir" ), "SetCurrentDirectoryA succeeded\n" );
484     ok( GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %d\n", GetLastError() );
485     ok( !SetCurrentDirectoryA( "\\some_dummy\\subdir" ), "SetCurrentDirectoryA succeeded\n" );
486     ok( GetLastError() == ERROR_PATH_NOT_FOUND, "wrong error %d\n", GetLastError() );
487 }
488
489 START_TEST(directory)
490 {
491     test_GetWindowsDirectoryA();
492     test_GetWindowsDirectoryW();
493
494     test_GetSystemDirectoryA();
495     test_GetSystemDirectoryW();
496
497     test_CreateDirectoryA();
498     test_CreateDirectoryW();
499
500     test_RemoveDirectoryA();
501     test_RemoveDirectoryW();
502
503     test_SetCurrentDirectoryA();
504 }