Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
d3c3bc1d
Commit
d3c3bc1d
authored
Dec 22, 2005
by
James Hawkins
Committed by
Alexandre Julliard
Dec 22, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Add tests for SHFileOperation's FO_DELETE command.
parent
e998da5e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
83 additions
and
0 deletions
+83
-0
shlfileop.c
dlls/shell32/tests/shlfileop.c
+83
-0
No files found.
dlls/shell32/tests/shlfileop.c
View file @
d3c3bc1d
...
...
@@ -171,6 +171,89 @@ static void test_delete(void)
ok
(
!
file_exists
(
"test4.txt"
),
"Directory should be removed
\n
"
);
}
ok
(
file_exists
(
"test2.txt"
),
"This file should not be removed
\n
"
);
/* FOF_FILESONLY does not delete a dir matching a wildcard */
init_shfo_tests
();
shfo
.
fFlags
|=
FOF_FILESONLY
;
shfo
.
pFrom
=
"*.txt
\0
"
;
todo_wine
{
ok
(
!
SHFileOperation
(
&
shfo
),
"Failed to delete files
\n
"
);
ok
(
!
file_exists
(
"test1.txt"
),
"test1.txt should be removed
\n
"
);
}
ok
(
!
file_exists
(
"test_5.txt"
),
"test_5.txt should be removed
\n
"
);
ok
(
file_exists
(
"test4.txt"
),
"test4.txt should not be removed
\n
"
);
/* FOF_FILESONLY only deletes a dir if explicitly specified */
init_shfo_tests
();
shfo
.
pFrom
=
"test_?.txt
\0
test4.txt
\0
"
;
todo_wine
{
ok
(
!
SHFileOperation
(
&
shfo
),
"Failed to delete files
\n
"
);
ok
(
!
file_exists
(
"test4.txt"
),
"test4.txt should be removed
\n
"
);
}
ok
(
!
file_exists
(
"test_5.txt"
),
"test_5.txt should be removed
\n
"
);
ok
(
file_exists
(
"test1.txt"
),
"test1.txt should not be removed
\n
"
);
/* try to delete an invalid filename */
init_shfo_tests
();
shfo
.
pFrom
=
"
\0
"
;
shfo
.
fFlags
&=
~
FOF_FILESONLY
;
shfo
.
fAnyOperationsAborted
=
FALSE
;
ret
=
SHFileOperation
(
&
shfo
);
todo_wine
{
ok
(
ret
==
ERROR_ACCESS_DENIED
,
"Expected ERROR_ACCESS_DENIED, got %ld
\n
"
,
ret
);
}
ok
(
!
shfo
.
fAnyOperationsAborted
,
"Expected no aborted operations
\n
"
);
ok
(
file_exists
(
"test1.txt"
),
"Expected test1.txt to exist
\n
"
);
/* try an invalid function */
init_shfo_tests
();
shfo
.
pFrom
=
"test1.txt
\0
"
;
shfo
.
wFunc
=
0
;
ret
=
SHFileOperation
(
&
shfo
);
todo_wine
{
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %ld
\n
"
,
ret
);
}
ok
(
file_exists
(
"test1.txt"
),
"Expected test1.txt to exist
\n
"
);
/* try an invalid list, only one null terminator */
init_shfo_tests
();
shfo
.
pFrom
=
""
;
shfo
.
wFunc
=
FO_DELETE
;
ret
=
SHFileOperation
(
&
shfo
);
todo_wine
{
ok
(
ret
==
ERROR_ACCESS_DENIED
,
"Expected ERROR_ACCESS_DENIED, got %ld
\n
"
,
ret
);
}
ok
(
file_exists
(
"test1.txt"
),
"Expected test1.txt to exist
\n
"
);
/* delete a dir, and then a file inside the dir, same as
* deleting a nonexistent file
*/
init_shfo_tests
();
shfo
.
pFrom
=
"testdir2
\0
testdir2
\\
one.txt
\0
"
;
ret
=
SHFileOperation
(
&
shfo
);
todo_wine
{
ok
(
ret
==
ERROR_PATH_NOT_FOUND
,
"Expected ERROR_PATH_NOT_FOUND, got %ld
\n
"
,
ret
);
ok
(
!
file_exists
(
"testdir2"
),
"Expected testdir2 to not exist
\n
"
);
}
ok
(
!
file_exists
(
"testdir2
\\
one.txt"
),
"Expected testdir2
\\
one.txt to not exist
\n
"
);
/* try the FOF_NORECURSION flag, continues deleting subdirs */
init_shfo_tests
();
shfo
.
pFrom
=
"testdir2
\0
"
;
shfo
.
fFlags
|=
FOF_NORECURSION
;
ret
=
SHFileOperation
(
&
shfo
);
todo_wine
{
ok
(
ret
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %ld
\n
"
,
ret
);
}
ok
(
!
file_exists
(
"testdir2
\\
one.txt"
),
"Expected testdir2
\\
one.txt to not exist
\n
"
);
ok
(
!
file_exists
(
"testdir2
\\
nested"
),
"Expected testdir2
\\
nested to exist
\n
"
);
}
/* tests the FO_RENAME action */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment