kernel32/tests: Correctly skip tests when the Unicode directory functions are not available.

This commit is contained in:
Andrew Nguyen 2009-05-18 04:24:20 -05:00 committed by Alexandre Julliard
parent 77fa32a832
commit 4f7f110c5e
1 changed files with 17 additions and 5 deletions

View File

@ -61,8 +61,11 @@ static void test_GetWindowsDirectoryW(void)
static const WCHAR fooW[] = {'f','o','o',0}; static const WCHAR fooW[] = {'f','o','o',0};
len_with_null = GetWindowsDirectoryW(NULL, 0); len_with_null = GetWindowsDirectoryW(NULL, 0);
if (len_with_null==0 && GetLastError()==ERROR_CALL_NOT_IMPLEMENTED) if (len_with_null == 0 && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
{
win_skip("GetWindowsDirectoryW is not implemented\n");
return; return;
}
ok(len_with_null <= MAX_PATH, "should fit into MAX_PATH\n"); ok(len_with_null <= MAX_PATH, "should fit into MAX_PATH\n");
lstrcpyW(buf, fooW); lstrcpyW(buf, fooW);
@ -124,8 +127,11 @@ static void test_GetSystemDirectoryW(void)
static const WCHAR fooW[] = {'f','o','o',0}; static const WCHAR fooW[] = {'f','o','o',0};
len_with_null = GetSystemDirectoryW(NULL, 0); len_with_null = GetSystemDirectoryW(NULL, 0);
if (len_with_null==0 && GetLastError()==ERROR_CALL_NOT_IMPLEMENTED) if (len_with_null == 0 && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
{
win_skip("GetSystemDirectoryW is not available\n");
return; return;
}
ok(len_with_null <= MAX_PATH, "should fit into MAX_PATH\n"); ok(len_with_null <= MAX_PATH, "should fit into MAX_PATH\n");
lstrcpyW(buf, fooW); lstrcpyW(buf, fooW);
@ -337,8 +343,11 @@ static void test_CreateDirectoryW(void)
static const WCHAR questionW[] = {'?',0}; static const WCHAR questionW[] = {'?',0};
ret = CreateDirectoryW(NULL, NULL); ret = CreateDirectoryW(NULL, NULL);
if (!ret && GetLastError()==ERROR_CALL_NOT_IMPLEMENTED) if (!ret && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
{
win_skip("CreateDirectoryW is not available\n");
return; return;
}
ok(ret == FALSE && GetLastError() == ERROR_PATH_NOT_FOUND, ok(ret == FALSE && GetLastError() == ERROR_PATH_NOT_FOUND,
"should not create NULL path ret %u err %u\n", ret, GetLastError()); "should not create NULL path ret %u err %u\n", ret, GetLastError());
@ -441,8 +450,11 @@ static void test_RemoveDirectoryW(void)
GetTempPathW(MAX_PATH, tmpdir); GetTempPathW(MAX_PATH, tmpdir);
lstrcatW(tmpdir, tmp_dir_name); lstrcatW(tmpdir, tmp_dir_name);
ret = CreateDirectoryW(tmpdir, NULL); ret = CreateDirectoryW(tmpdir, NULL);
if (!ret && GetLastError()==ERROR_CALL_NOT_IMPLEMENTED) if (!ret && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
return; {
win_skip("CreateDirectoryW is not available\n");
return;
}
ok(ret == TRUE, "CreateDirectoryW should always succeed\n"); ok(ret == TRUE, "CreateDirectoryW should always succeed\n");