Vijay Kiran Kamuju <infyquest(a)gmail.com> writes:
Includes testcases by Vincent Pelletier. Mark some test as todo.
From: Michael Müller <michael(a)fds-team.de>
Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com> --- dlls/kernel32/tests/file.c | 109 ++++++++++++++++++++++++++++++++++++- 1 file changed, 108 insertions(+), 1 deletion(-)
diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c index 33b17aa327..0aa1bff177 100644 --- a/dlls/kernel32/tests/file.c +++ b/dlls/kernel32/tests/file.c @@ -2543,11 +2543,86 @@ static char get_windows_drive(void) return windowsdir[0]; }
+struct +{ + const char *path; + BOOL expected; + BOOL todo; +} +static const invalid_char_tests[] = +{ + { "./test-dir", TRUE }, + { "./test-dir/", FALSE }, + { ".\\test-dir", TRUE }, + { ".\\test-dir\\", FALSE }, + { "/>test-dir", FALSE }, + { "<\"test->dir", FALSE }, + { "<test->dir", FALSE }, + { "><test->dir", FALSE }, + { ">>test-dir", FALSE }, + { ">test->dir", FALSE }, + { ">test-dir", FALSE }, + { "\"test-dir\"", FALSE }, + { "\"test-file\"", FALSE }, + { "test-/>dir", FALSE }, + { "test-dir/", FALSE }, + { "test-dir//", FALSE }, + { "test-dir/:", FALSE }, + { "test-dir/<", TRUE, TRUE }, + { "test-dir/>", TRUE, TRUE }, + { "test-dir/\"", TRUE, TRUE }, + { "test-dir/\\", FALSE }, + { "test-dir/|", FALSE }, + { "test-dir<", TRUE, TRUE }, + { "test-dir</", FALSE }, + { "test-dir<<", TRUE, TRUE }, + { "test-dir<<<><><>\"\"\"\"<<<>", TRUE, TRUE }, + { "test-dir<>", TRUE, TRUE }, + { "test-dir<\"", TRUE, TRUE }, + { "test-dir>", TRUE, TRUE }, + { "test-dir>/", FALSE }, + { "test-dir><", TRUE, TRUE }, + { "test-dir>>", TRUE, TRUE }, + { "test-dir>\"", TRUE, TRUE }, + { "test-dir\"", TRUE, TRUE }, + { "test-dir\"/", FALSE }, + { "test-dir\"<", TRUE, TRUE }, + { "test-dir\">", TRUE, TRUE }, + { "test-dir\"\"", TRUE, TRUE }, + { "test-dir\"\"\"\"\"", TRUE, TRUE }, + { "test-dir\\", FALSE }, + { "test-dir\\/", FALSE }, + { "test-dir\\<", TRUE, TRUE }, + { "test-dir\\>", TRUE, TRUE }, + { "test-dir\\\"", TRUE, TRUE }, + { "test-dir\\\\", FALSE }, + { "test-file/", FALSE }, + { "test-file/<", FALSE }, + { "test-file/>", FALSE }, + { "test-file/\"", FALSE }, + { "test-file<", TRUE, TRUE }, + { "test-file<<", TRUE, TRUE }, + { "test-file<>", TRUE, TRUE }, + { "test-file<\"", TRUE, TRUE }, + { "test-file>", TRUE, TRUE }, + { "test-file><", TRUE, TRUE }, + { "test-file>>", TRUE, TRUE }, + { "test-file>\"", TRUE, TRUE }, + { "test-file\"", TRUE, TRUE }, + { "test-file\"<", TRUE, TRUE }, + { "test-file\">", TRUE, TRUE }, + { "test-file\"\"", TRUE, TRUE }, + { "test-file\\", FALSE }, + { "test-file\\<", FALSE }, + { "test-file\\>", FALSE }, + { "test-file\\\"", FALSE }, +};
These look like they are testing the same thing over and over again. I doubt you need all these combinations of the same few chars; testing some other characters instead would be more interesting. -- Alexandre Julliard julliard(a)winehq.org