[PATCH] kernel32/tests: Add tests for FindFirstFileA with invalid characters.

Vijay Kiran Kamuju infyquest at gmail.com
Mon Mar 25 10:42:15 CDT 2019


I will remove some of the tests, can you suggest which new characters
tests are interesting.

On Mon, Mar 25, 2019 at 4:16 PM Alexandre Julliard <julliard at winehq.org> wrote:
>
> Vijay Kiran Kamuju <infyquest at gmail.com> writes:
>
> > Includes testcases by Vincent Pelletier.
> > Mark some test as todo.
> >
> > From: Michael Müller <michael at fds-team.de>
> >
> > Signed-off-by: Vijay Kiran Kamuju <infyquest at 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 at winehq.org



More information about the wine-devel mailing list