Commit bbafba6d authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

ntdll/tests: Add more tests for RtlGetFullPathName_U().

parent ee5c46a5
...@@ -266,6 +266,7 @@ static void test_RtlGetFullPathName_U(void) ...@@ -266,6 +266,7 @@ static void test_RtlGetFullPathName_U(void)
static const struct test tests[] = static const struct test tests[] =
{ {
{ "c:/test", "c:\\test", "test"}, { "c:/test", "c:\\test", "test"},
{ "c:/test/", "c:\\test\\", NULL},
{ "c:/test ", "c:\\test", "test"}, { "c:/test ", "c:\\test", "test"},
{ "c:/test.", "c:\\test", "test"}, { "c:/test.", "c:\\test", "test"},
{ "c:/test .... .. ", "c:\\test", "test"}, { "c:/test .... .. ", "c:\\test", "test"},
...@@ -287,22 +288,61 @@ static void test_RtlGetFullPathName_U(void) ...@@ -287,22 +288,61 @@ static void test_RtlGetFullPathName_U(void)
{ "c:/test../file", "c:\\test.\\file", "file", { "c:/test../file", "c:\\test.\\file", "file",
"c:\\test..\\file", "file"}, /* vista */ "c:\\test..\\file", "file"}, /* vista */
{ "c:\\test", "c:\\test", "test"}, { "c:\\test", "c:\\test", "test"},
{ NULL, NULL, NULL} { "C:\\test", "C:\\test", "test"},
{ "c:/", "c:\\", NULL},
{ "c:.", "C:\\windows", "windows"},
{ "c:foo", "C:\\windows\\foo", "foo"},
{ "c:foo/bar", "C:\\windows\\foo\\bar", "bar"},
{ "c:./foo", "C:\\windows\\foo", "foo"},
{ "\\foo", "C:\\foo", "foo"},
{ "foo", "C:\\windows\\foo", "foo"},
{ ".", "C:\\windows", "windows"},
{ "..", "C:\\", NULL},
{ "...", "C:\\windows\\", NULL},
{ "./foo", "C:\\windows\\foo", "foo"},
{ "foo/..", "C:\\windows", "windows"},
{ "AUX", "\\\\.\\AUX", NULL},
{ "COM1", "\\\\.\\COM1", NULL},
{ "?<>*\"|:", "C:\\windows\\?<>*\"|:", "?<>*\"|:"},
{ "\\\\foo", "\\\\foo", NULL},
{ "//foo", "\\\\foo", NULL},
{ "\\/foo", "\\\\foo", NULL},
{ "//", "\\\\", NULL},
{ "//foo/", "\\\\foo\\", NULL},
{ "//.", "\\\\.\\", NULL},
{ "//./", "\\\\.\\", NULL},
{ "//.//", "\\\\.\\", NULL},
{ "//./foo", "\\\\.\\foo", "foo"},
{ "//./foo/", "\\\\.\\foo\\", NULL},
{ "//./foo/bar", "\\\\.\\foo\\bar", "bar"},
{ "//./foo/.", "\\\\.\\foo", "foo"},
{ "//./foo/..", "\\\\.\\", NULL},
{ "//?/", "\\\\?\\", NULL},
{ "//?//", "\\\\?\\", NULL},
{ "//?/foo", "\\\\?\\foo", "foo"},
{ "//?/foo/", "\\\\?\\foo\\", NULL},
{ "//?/foo/bar", "\\\\?\\foo\\bar", "bar"},
{ "//?/foo/.", "\\\\?\\foo", "foo"},
{ "//?/foo/..", "\\\\?\\", NULL},
/* RtlGetFullPathName_U() can't understand the global namespace prefix */
{ "\\??\\foo", "C:\\??\\foo", "foo"},
{ 0 }
}; };
const struct test *test; const struct test *test;
WCHAR pathbufW[2*MAX_PATH], rbufferW[MAX_PATH]; WCHAR pathbufW[2*MAX_PATH], rbufferW[MAX_PATH];
CHAR rbufferA[MAX_PATH], rfileA[MAX_PATH]; char rbufferA[MAX_PATH], rfileA[MAX_PATH], curdir[MAX_PATH];
ULONG ret; ULONG ret;
WCHAR *file_part; WCHAR *file_part;
DWORD reslen; DWORD reslen;
UINT len; UINT len;
if (!pRtlGetFullPathName_U) GetCurrentDirectoryA(sizeof(curdir), curdir);
{ SetCurrentDirectoryA("C:\\windows\\");
win_skip("RtlGetFullPathName_U is not available\n");
return;
}
file_part = (WCHAR *)0xdeadbeef; file_part = (WCHAR *)0xdeadbeef;
lstrcpyW(rbufferW, deadbeefW); lstrcpyW(rbufferW, deadbeefW);
...@@ -348,6 +388,8 @@ static void test_RtlGetFullPathName_U(void) ...@@ -348,6 +388,8 @@ static void test_RtlGetFullPathName_U(void)
ok( !test->rfile, "Got NULL expected \"%s\"\n", test->rfile ); ok( !test->rfile, "Got NULL expected \"%s\"\n", test->rfile );
} }
} }
SetCurrentDirectoryA(curdir);
} }
static void test_RtlDosPathNameToNtPathName_U_WithStatus(void) static void test_RtlDosPathNameToNtPathName_U_WithStatus(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