From: Zebediah Figura zfigura@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/kernel32/tests/file.c | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-)
diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c index 2814ab194b2..6d2a216e39c 100644 --- a/dlls/kernel32/tests/file.c +++ b/dlls/kernel32/tests/file.c @@ -2928,7 +2928,7 @@ static void test_FindFirstFile_wildcards(void) {0, "*.. ", ", '.', '..', '..a', '..a.a', '.a', '.a..a', '.a.a', '.aaa', 'a', 'a..a', 'a.a', 'a.a.a', 'aa', 'aaa', 'aaaa'"}, {1, "*. .", ", '.', '..', 'a', '.a', '..a', 'aa', 'aaa', 'aaaa', '.aaa'"}, {1, "* ..", ", '.', '..', 'a', '.a', '..a', 'aa', 'aaa', 'aaaa', '.aaa'"}, - {1, " *..", ", '.aaa'"}, + {0, " *..", ""}, {0, "..* ", ", '.', '..', '..a', '..a.a'"}, {1, "?", ", '.', '..', 'a'"}, {1, "?.", ", '.', '..', 'a'"}, @@ -2954,23 +2954,26 @@ static void test_FindFirstFile_wildcards(void) correct[0] = incorrect[0] = 0;
handle = FindFirstFileA(tests[i].pattern, &find_data); - if (handle) do { - char* ptr; - char quoted[16]; + if (handle != INVALID_HANDLE_VALUE) + { + do { + char *ptr; + char quoted[16];
- sprintf( quoted, ", '%.10s'", find_data.cFileName ); + sprintf(quoted, ", '%.10s'", find_data.cFileName);
- if ((ptr = strstr(missing, quoted))) - { - int len = strlen(quoted); - while ((ptr[0] = ptr[len]) != 0) - ++ptr; - strcat(correct, quoted); - } - else - strcat(incorrect, quoted); - } while (FindNextFileA(handle, &find_data)); - FindClose(handle); + if ((ptr = strstr(missing, quoted))) + { + int len = strlen(quoted); + while ((ptr[0] = ptr[len]) != 0) + ++ptr; + strcat(correct, quoted); + } + else + strcat(incorrect, quoted); + } while (FindNextFileA(handle, &find_data)); + FindClose(handle); + }
todo_wine_if (tests[i].todo) ok(missing[0] == 0 && incorrect[0] == 0,
From: Zebediah Figura zfigura@codeweavers.com
Makes adding new tests a bit easier...
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ntdll/tests/path.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/tests/path.c b/dlls/ntdll/tests/path.c index a91038bab7b..6b3be9e9541 100644 --- a/dlls/ntdll/tests/path.c +++ b/dlls/ntdll/tests/path.c @@ -580,8 +580,10 @@ static void test_RtlDosPathNameToNtPathName_U(void) continue; }
- ok(!wcscmp(nameW.Buffer, tests[i].nt) || broken(!wcscmp(nameW.Buffer, tests[i].alt_nt)), "%s: Expected %s, got %s.\n", - debugstr_w(tests[i].dos), debugstr_w(tests[i].nt), debugstr_w(nameW.Buffer)); + ok(!wcscmp(nameW.Buffer, tests[i].nt) + || (tests[i].alt_nt && broken(!wcscmp(nameW.Buffer, tests[i].alt_nt))), + "%s: Expected %s, got %s.\n", debugstr_w(tests[i].dos), + debugstr_w(tests[i].nt), debugstr_w(nameW.Buffer));
if (!wcscmp(nameW.Buffer, tests[i].nt)) {
From: Zebediah Figura zfigura@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ntdll/tests/path.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/dlls/ntdll/tests/path.c b/dlls/ntdll/tests/path.c index 6b3be9e9541..5342d101b4f 100644 --- a/dlls/ntdll/tests/path.c +++ b/dlls/ntdll/tests/path.c @@ -436,6 +436,18 @@ static void test_RtlDosPathNameToNtPathName_U(void) {L"c:/", L"\??\c:\", -1}, {L"c:/foo", L"\??\c:\foo", 7}, {L"c:/foo.", L"\??\c:\foo", 7}, + {L"c:/foo ", L"\??\c:\foo", 7}, + {L"c:/foo . .", L"\??\c:\foo", 7}, + {L"c:/foo.a", L"\??\c:\foo.a", 7}, + {L"c:/foo a", L"\??\c:\foo a", 7}, + {L"c:/foo*", L"\??\c:\foo*", 7}, + {L"c:/foo*a", L"\??\c:\foo*a", 7}, + {L"c:/foo?", L"\??\c:\foo?", 7}, + {L"c:/foo?a", L"\??\c:\foo?a", 7}, + {L"c:/foo<", L"\??\c:\foo<", 7}, + {L"c:/foo<a", L"\??\c:\foo<a", 7}, + {L"c:/foo>", L"\??\c:\foo>", 7}, + {L"c:/foo>a", L"\??\c:\foo>a", 7}, {L"c:/foo/", L"\??\c:\foo\", -1}, {L"c:/foo//", L"\??\c:\foo\", -1}, {L"C:/foo", L"\??\C:\foo", 7}, @@ -477,6 +489,7 @@ static void test_RtlDosPathNameToNtPathName_U(void) {L"//./foo/bar", L"\??\foo\bar", 8}, {L"//./foo/.", L"\??\foo", 4}, {L"//./foo/..", L"\??\", -1}, + {L"//./foo. . ", L"\??\foo", 4},
{L"//?", L"\??\", -1}, {L"//?/", L"\??\", -1}, @@ -486,6 +499,7 @@ static void test_RtlDosPathNameToNtPathName_U(void) {L"//?/foo/bar", L"\??\foo\bar", 8}, {L"//?/foo/.", L"\??\foo", 4}, {L"//?/foo/..", L"\??\", -1}, + {L"//?/foo. . ", L"\??\foo", 4},
{L"\\.", L"\??\", -1}, {L"\\.\", L"\??\", -1}, @@ -495,6 +509,7 @@ static void test_RtlDosPathNameToNtPathName_U(void) {L"\\.\foo/bar", L"\??\foo\bar", 8}, {L"\\.\foo/.", L"\??\foo", 4}, {L"\\.\foo/..", L"\??\", -1}, + {L"\\.\foo. . ", L"\??\foo", 4},
{L"\\?", L"\??\", -1}, {L"\\?\", L"\??\", -1}, @@ -511,6 +526,7 @@ static void test_RtlDosPathNameToNtPathName_U(void) {L"\\?\foo\bar",L"\??\foo\bar", 8}, {L"\\?\foo\.", L"\??\foo\.", 8}, {L"\\?\foo\..", L"\??\foo\..", 8}, + {L"\\?\foo. . ", L"\??\foo. . ", 4},
{L"\??", L"\??\C:\??", 7}, {L"\??\", L"\??\C:\??\", -1}, @@ -527,6 +543,7 @@ static void test_RtlDosPathNameToNtPathName_U(void) {L"\??\foo\bar", L"\??\foo\bar", 8}, {L"\??\foo\.", L"\??\foo\.", 8}, {L"\??\foo\..", L"\??\foo\..", 8}, + {L"\??\foo. . ", L"\??\foo. . ", 4},
{L"CONIN$", L"\??\CONIN$", -1, L"\??\C:\windows\CONIN$" /* winxp */ }, {L"CONOUT$", L"\??\CONOUT$", -1, L"\??\C:\windows\CONOUT$" /* winxp */ },
From: Zebediah Figura zfigura@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/kernel32/tests/file.c | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-)
diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c index 6d2a216e39c..6ea9dffde5c 100644 --- a/dlls/kernel32/tests/file.c +++ b/dlls/kernel32/tests/file.c @@ -2930,13 +2930,44 @@ static void test_FindFirstFile_wildcards(void) {1, "* ..", ", '.', '..', 'a', '.a', '..a', 'aa', 'aaa', 'aaaa', '.aaa'"}, {0, " *..", ""}, {0, "..* ", ", '.', '..', '..a', '..a.a'"}, + + {1, "<.<.<", ", '..a', '..a.a', '.a..a', '.a.a', 'a..a', 'a.a.a'"}, + {1, "<.<.", ", '.', '..', '..a', '..a.a', '.a', '.a..a', '.a.a', '.aaa', 'a..a', 'a.a', 'a.a.a'"}, + {1, ".<.<", ", '..a', '..a.a', '.a..a', '.a.a'"}, + {1, "<.<", ", '.', '..', '..a', '..a.a', '.a', '.a..a', '.a.a', '.aaa', 'a..a', 'a.a', 'a.a.a'"}, + {1, ".<", ", '.', '..', '.a', '.aaa'"}, + {1, "<.", ", '.', '..', 'a', '.a', '..a', 'aa', 'aaa', 'aaaa', '.aaa'"}, + {1, "<", ", '.', '..', '..a', '.a', '.aaa', 'a', 'aa', 'aaa', 'aaaa'"}, + {1, "<..<", ", '..a', '.a..a', 'a..a'"}, + {1, "<..", ", '.', '..', 'a', '.a', '..a', 'aa', 'aaa', 'aaaa', '.aaa'"}, + {1, ".<.", ", '.', '..', '.a', '.aaa'"}, + {1, "..<", ", '..a'"}, + {1, "<<", ", '.', '..', '..a', '..a.a', '.a', '.a..a', '.a.a', '.aaa', 'a', 'a..a', 'a.a', 'a.a.a', 'aa', 'aaa', 'aaaa'"}, + {1, "<<.", ", '.', '..', '..a', '..a.a', '.a', '.a..a', '.a.a', '.aaa', 'a', 'a..a', 'a.a', 'a.a.a', 'aa', 'aaa', 'aaaa'"}, + {1, "<. ", ", '.', '..', '..a', '.a', '.aaa', 'a', 'aa', 'aaa', 'aaaa'"}, + {1, "< .", ", '.', '..', 'a', '.a', '..a', 'aa', 'aaa', 'aaaa', '.aaa'"}, + {1, "< . ", ", '.', '..', '..a', '.a', '.aaa', 'a', 'aa', 'aaa', 'aaaa'"}, + {1, "<.. ", ", '.', '..', '..a', '.a', '.aaa', 'a', 'aa', 'aaa', 'aaaa'"}, + {1, "<. .", ", '.', '..', 'a', '.a', '..a', 'aa', 'aaa', 'aaaa', '.aaa'"}, + {1, "< ..", ", '.', '..', 'a', '.a', '..a', 'aa', 'aaa', 'aaaa', '.aaa'"}, + {0, " <..", ""}, + {1, "..< ", ", '..a'"}, + {1, "?", ", '.', '..', 'a'"}, {1, "?.", ", '.', '..', 'a'"}, {1, "?. ", ", '.', '..', 'a'"}, {1, "??.", ", '.', '..', 'a', 'aa'"}, {1, "??. ", ", '.', '..', 'a', 'aa'"}, {1, "???.", ", '.', '..', 'a', 'aa', 'aaa'"}, - {1, "?.??.", ", '.', '..', '.a', 'a', 'a.a'"} + {1, "?.??.", ", '.', '..', '.a', 'a', 'a.a'"}, + + {1, ">", ", '.', '..', 'a'"}, + {1, ">.", ", '.', '..', 'a'"}, + {1, ">. ", ", '.', '..', 'a'"}, + {1, ">>.", ", '.', '..', 'a', 'aa'"}, + {1, ">>. ", ", '.', '..', 'a', 'aa'"}, + {1, ">>>.", ", '.', '..', 'a', 'aa', 'aaa'"}, + {1, ">.>>.", ", '.', '..', '.a', 'a.a'"}, };
CreateDirectoryA("test-dir", NULL);
From: Zebediah Figura zfigura@codeweavers.com
They differ in strange ways, as the tests show, but the basic behaviour of '>' is similar to '?'.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=22635 Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ntdll/unix/file.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index a4c6bf4a137..d6533fedfdd 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -1342,6 +1342,7 @@ static BOOLEAN match_filename( const WCHAR *name, int length, const UNICODE_STRI next_to_retry = name; break; case '?': + case '>': mask++; name++; break;