Commit 3f884c2c authored by Gunnar Dalsnes's avatar Gunnar Dalsnes Committed by Alexandre Julliard

Added a test to make sure that CreateDirectoryA/W does not create

multiple non-existing directories in the path given.
parent 6199da39
......@@ -208,6 +208,14 @@ static void test_CreateDirectoryA(void)
"CreateDirectoryA with * wildcard name should fail, ret=%s error=%ld\n",
ret ? " True" : "False", GetLastError());
ret = RemoveDirectoryA(tmpdir);
GetTempPathA(MAX_PATH, tmpdir);
lstrcatA(tmpdir, "Please Remove Me/Please Remove Me");
ret = CreateDirectoryA(tmpdir, NULL);
ok(ret == FALSE && GetLastError() == ERROR_PATH_NOT_FOUND,
"CreateDirectoryA with multiple non existing directories in path should fail\n");
ret = RemoveDirectoryA(tmpdir);
}
static void test_CreateDirectoryW(void)
......@@ -217,6 +225,7 @@ static void test_CreateDirectoryW(void)
static const WCHAR empty_strW[] = { 0 };
static const WCHAR tmp_dir_name[] = {'P','l','e','a','s','e',' ','R','e','m','o','v','e',' ','M','e',0};
static const WCHAR dotW[] = {'.',0};
static const WCHAR slashW[] = {'/',0};
static const WCHAR dotdotW[] = {'.','.',0};
static const WCHAR questionW[] = {'?',0};
......@@ -269,6 +278,15 @@ static void test_CreateDirectoryW(void)
"CreateDirectoryW with * wildcard name should fail with error 183, ret=%s error=%ld\n",
ret ? " True" : "False", GetLastError());
ret = RemoveDirectoryW(tmpdir);
GetTempPathW(MAX_PATH, tmpdir);
lstrcatW(tmpdir, tmp_dir_name);
lstrcatW(tmpdir, slashW);
lstrcatW(tmpdir, tmp_dir_name);
ret = CreateDirectoryW(tmpdir, NULL);
ok(ret == FALSE && GetLastError() == ERROR_PATH_NOT_FOUND,
"CreateDirectoryW with multiple non existing directories in path should fail\n");
ret = RemoveDirectoryW(tmpdir);
}
static void test_RemoveDirectoryA(void)
......
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