https://git.reactos.org/?p=reactos.git;a=commitdiff;h=dbe1d36e5b0b2823166b6…
commit dbe1d36e5b0b2823166b6cb7b0f621fdcf192c67
Author: Doug Lyons <douglyons(a)douglyons.com>
AuthorDate: Sun Dec 8 08:23:22 2019 -0600
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sat Jan 11 14:20:33 2020 +0100
[CMD_APITEST] Add more regression tests for attrib
---
modules/rostests/apitests/cmd/cmd.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/modules/rostests/apitests/cmd/cmd.c b/modules/rostests/apitests/cmd/cmd.c
index 2d1a33c53b7..00e527f9c35 100644
--- a/modules/rostests/apitests/cmd/cmd.c
+++ b/modules/rostests/apitests/cmd/cmd.c
@@ -162,6 +162,10 @@ static const TEST_ENTRY s_attrib_entries[] =
{ __LINE__, 0, "attrib /S attr-te*.txt", TRUE, FALSE, " H "
},
{ __LINE__, 0, "attrib /S -H attr-te*.txt", FALSE, FALSE },
{ __LINE__, 0, "attrib /S attr-te*.txt", TRUE, FALSE, NULL, NULL,
" H " },
+ { __LINE__, 0, "attrib /S +H", FALSE, FALSE },
+ { __LINE__, 0, "attrib /S attr-test.txt", TRUE, FALSE, " H "
},
+ { __LINE__, 0, "attrib /S -H", FALSE, FALSE },
+ { __LINE__, 0, "attrib /S attr-test.txt", TRUE, FALSE, NULL, NULL,
" H " },
{ __LINE__, 0, "cmd /c if exist attr-test.txt attrib -H attr-test.txt"
},
{ __LINE__, 0, "cmd /c if exist attr-test.txt del /Q attr-test.txt"
},
@@ -285,6 +289,34 @@ static const TEST_ENTRY s_attrib_entries[] =
{ __LINE__, 0, "attrib /S /D -H attr-dir\\dir1", FALSE, FALSE },
{ __LINE__, 0, "attrib /S /D -H attr-dir", FALSE, FALSE },
{ __LINE__, 0, "cmd /c if exist attr-dir rmdir /s /q attr-dir" },
+
+ /* /S attr-dir, attr-dir\\dir1\\file.txt */
+ { __LINE__, 0, "cmd /c if exist attr-dir rmdir /s /q attr-dir" },
+ { __LINE__, 0, "cmd /c mkdir attr-dir", FALSE, FALSE },
+ { __LINE__, 0, "attrib /S /D attr-dir", TRUE, FALSE, NULL, NULL,
" H " },
+ { __LINE__, 0, "cmd /c if exist attr-dir echo OK", TRUE, FALSE,
"OK" },
+ { __LINE__, 0, "cmd /c mkdir attr-dir\\dir1", FALSE, FALSE },
+ { __LINE__, 0, "cmd /c if exist attr-dir\\dir1 echo OK", TRUE, FALSE,
"OK" },
+ { __LINE__, 0, "cmd /c copy NUL attr-dir\\dir1\\attr-test.txt ", TRUE,
FALSE },
+ { __LINE__, 0, "attrib attr-dir\\dir1\\attr-test.txt", TRUE, FALSE,
NULL, NULL, " H " },
+ { __LINE__, 0, "attrib /S +H attr-dir\\dir1\\attr-test.txt", FALSE,
FALSE },
+ { __LINE__, 0, "attrib /S attr-test.txt", TRUE, FALSE, " H "
},
+ { __LINE__, 0, "attrib /S -H attr-dir\\dir1\\attr-test.txt", FALSE,
FALSE },
+ { __LINE__, 0, "attrib /S attr-test.txt", TRUE, FALSE, NULL, NULL,
" H " },
+ { __LINE__, 0, "attrib /S +H attr-test.txt", FALSE, FALSE },
+ { __LINE__, 0, "attrib /S attr-test.txt", TRUE, FALSE, " H "
},
+ { __LINE__, 0, "attrib /S -H attr-test.txt", FALSE, FALSE },
+ { __LINE__, 0, "attrib /S attr-test.txt", TRUE, FALSE, NULL, NULL,
" H " },
+ { __LINE__, 0, "attrib /S +H", FALSE, FALSE },
+ { __LINE__, 0, "attrib /S attr-test.txt", TRUE, FALSE, " H "
},
+ { __LINE__, 0, "attrib /S attr-tes*.*", TRUE, FALSE, " H "
},
+ { __LINE__, 0, "attrib /S -H", FALSE, FALSE },
+ { __LINE__, 0, "attrib /S attr-test.txt", TRUE, FALSE, NULL, NULL,
" H " },
+ { __LINE__, 0, "attrib /S attr-tes*.*", TRUE, FALSE, NULL, NULL,
" H " },
+ { __LINE__, 0, "cmd /c if exist attr-dir/dir1/test.txt attrib -H
attr-dir/dir1/test.txt" },
+ { __LINE__, 0, "cmd /c if exist attr-dir/dir1/test.txt del /Q
attr-dir/dir1/test.txt" },
+ { __LINE__, 0, "cmd /c if exist attr-dir rmdir /s /q attr-dir" },
+
};
static BOOL MyDuplicateHandle(HANDLE hFile, PHANDLE phFile, BOOL bInherit)