Commit e8d36ff9 authored by Alexandre Julliard's avatar Alexandre Julliard

kernel32/tests: Print some more details on directory test failures.

parent 69a8066b
......@@ -339,27 +339,32 @@ static void test_CreateDirectoryW(void)
ret = CreateDirectoryW(NULL, NULL);
if (!ret && GetLastError()==ERROR_CALL_NOT_IMPLEMENTED)
return;
ok(ret == FALSE && GetLastError() == ERROR_PATH_NOT_FOUND, "should not create NULL path\n");
ok(ret == FALSE && GetLastError() == ERROR_PATH_NOT_FOUND,
"should not create NULL path ret %u err %u\n", ret, GetLastError());
ret = CreateDirectoryW(empty_strW, NULL);
ok(ret == FALSE && GetLastError() == ERROR_PATH_NOT_FOUND, "should not create empty path\n");
ok(ret == FALSE && GetLastError() == ERROR_PATH_NOT_FOUND,
"should not create empty path ret %u err %u\n", ret, GetLastError());
ret = GetSystemDirectoryW(tmpdir, MAX_PATH);
ok(ret < MAX_PATH, "System directory should fit into MAX_PATH\n");
ret = SetCurrentDirectoryW(tmpdir);
ok(ret == TRUE, "could not chdir to the System directory\n");
ok(ret == TRUE, "could not chdir to the System directory ret %u err %u\n", ret, GetLastError());
ret = CreateDirectoryW(dotW, NULL);
ok(ret == FALSE && GetLastError() == ERROR_ALREADY_EXISTS, "should not create existing path\n");
ok(ret == FALSE && GetLastError() == ERROR_ALREADY_EXISTS,
"should not create existing path ret %u err %u\n", ret, GetLastError());
ret = CreateDirectoryW(dotdotW, NULL);
ok(ret == FALSE && GetLastError() == ERROR_ALREADY_EXISTS, "should not create existing path\n");
ok(ret == FALSE && GetLastError() == ERROR_ALREADY_EXISTS,
"should not create existing path ret %u err %u\n", ret, GetLastError());
GetTempPathW(MAX_PATH, tmpdir);
tmpdir[3] = 0; /* truncate the path */
ret = CreateDirectoryW(tmpdir, NULL);
ok(ret == FALSE && GetLastError() == ERROR_ACCESS_DENIED, "should deny access to the drive root\n");
ok(ret == FALSE && GetLastError() == ERROR_ACCESS_DENIED,
"should deny access to the drive root ret %u err %u\n", ret, GetLastError());
GetTempPathW(MAX_PATH, tmpdir);
lstrcatW(tmpdir, tmp_dir_name);
......@@ -367,7 +372,8 @@ static void test_CreateDirectoryW(void)
ok(ret == TRUE, "CreateDirectoryW should always succeed\n");
ret = CreateDirectoryW(tmpdir, NULL);
ok(ret == FALSE && GetLastError() == ERROR_ALREADY_EXISTS, "should not create existing path\n");
ok(ret == FALSE && GetLastError() == ERROR_ALREADY_EXISTS,
"should not create existing path ret %u err %u\n", ret, GetLastError());
ret = RemoveDirectoryW(tmpdir);
ok(ret == TRUE, "RemoveDirectoryW should always succeed\n");
......@@ -391,8 +397,9 @@ static void test_CreateDirectoryW(void)
lstrcatW(tmpdir, slashW);
lstrcatW(tmpdir, tmp_dir_name);
ret = CreateDirectoryW(tmpdir, NULL);
ok(ret == FALSE && GetLastError() == ERROR_PATH_NOT_FOUND,
"CreateDirectoryW with multiple nonexistent directories in path should fail\n");
ok(ret == FALSE && GetLastError() == ERROR_PATH_NOT_FOUND,
"CreateDirectoryW with multiple nonexistent directories in path should fail ret %u err %u\n",
ret, GetLastError());
ret = RemoveDirectoryW(tmpdir);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment