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
22ddd114
Commit
22ddd114
authored
Dec 26, 2005
by
James Hawkins
Committed by
Alexandre Julliard
Dec 26, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Clean up the SHFileOperation tests.
- Make sure to create all the files used by the new tests. - Add a couple more SHFileOperation tests. - Fix some of the old tests.
parent
35a92c86
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
7 deletions
+46
-7
shlfileop.c
dlls/shell32/tests/shlfileop.c
+46
-7
No files found.
dlls/shell32/tests/shlfileop.c
View file @
22ddd114
...
...
@@ -75,8 +75,12 @@ static void init_shfo_tests(void)
createTestFile
(
"test1.txt"
);
createTestFile
(
"test2.txt"
);
createTestFile
(
"test3.txt"
);
createTestFile
(
"test_5.txt"
);
CreateDirectoryA
(
"test4.txt"
,
NULL
);
CreateDirectoryA
(
"testdir2"
,
NULL
);
CreateDirectoryA
(
"testdir2
\\
nested"
,
NULL
);
createTestFile
(
"testdir2
\\
one.txt"
);
createTestFile
(
"testdir2
\\
nested
\\
two.txt"
);
}
/* cleans after tests */
...
...
@@ -85,17 +89,22 @@ static void clean_after_shfo_tests(void)
DeleteFileA
(
"test1.txt"
);
DeleteFileA
(
"test2.txt"
);
DeleteFileA
(
"test3.txt"
);
DeleteFileA
(
"test_5.txt"
);
DeleteFileA
(
"test4.txt
\\
test1.txt"
);
DeleteFileA
(
"test4.txt
\\
test2.txt"
);
DeleteFileA
(
"test4.txt
\\
test3.txt"
);
RemoveDirectoryA
(
"test4.txt"
);
DeleteFileA
(
"testdir2
\\
one.txt"
);
DeleteFileA
(
"testdir2
\\
test1.txt"
);
DeleteFileA
(
"testdir2
\\
test2.txt"
);
DeleteFileA
(
"testdir2
\\
test3.txt"
);
DeleteFileA
(
"testdir2
\\
test4.txt
\\
test1.txt"
);
DeleteFileA
(
"testdir2
\\
nested
\\
two.txt"
);
RemoveDirectoryA
(
"testdir2
\\
test4.txt"
);
RemoveDirectoryA
(
"testdir2
\\
nested"
);
RemoveDirectoryA
(
"testdir2"
);
DeleteFileA
(
"nonexistent
\\
test2.txt"
);
DeleteFileA
(
"nonexistent
\\
notreal
\\
test2.txt"
);
RemoveDirectoryA
(
"nonexistent
\\
notreal"
);
RemoveDirectoryA
(
"nonexistent"
);
}
...
...
@@ -180,8 +189,8 @@ static void test_delete(void)
{
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
(
"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 */
...
...
@@ -191,8 +200,8 @@ static void test_delete(void)
{
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
(
"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 */
...
...
@@ -251,9 +260,9 @@ static void test_delete(void)
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
"
);
}
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 */
...
...
@@ -332,6 +341,22 @@ static void test_rename(void)
ok
(
file_exists
(
"test1.txt"
),
"Expected test1.txt to exist
\n
"
);
ok
(
file_exists
(
"test2.txt"
),
"Expected test2.txt to exist
\n
"
);
/* pFrom doesn't exist */
shfo
.
pFrom
=
"idontexist
\0
"
;
shfo
.
pTo
=
"newfile
\0
"
;
retval
=
SHFileOperationA
(
&
shfo
);
ok
(
retval
==
1026
,
"Expected 1026, got %ld
\n
"
,
retval
);
ok
(
!
file_exists
(
"newfile"
),
"Expected newfile to not exist
\n
"
);
/* pTo already exist */
shfo
.
pFrom
=
"test1.txt
\0
"
;
shfo
.
pTo
=
"test2.txt
\0
"
;
retval
=
SHFileOperationA
(
&
shfo
);
todo_wine
{
ok
(
retval
==
ERROR_ALREADY_EXISTS
,
"Expected ERROR_ALREADY_EXISTS, got %ld
\n
"
,
retval
);
}
/* pFrom is valid, but pTo is empty */
shfo
.
pFrom
=
"test1.txt
\0
"
;
shfo
.
pTo
=
"
\0
"
;
...
...
@@ -541,6 +566,18 @@ static void test_copy(void)
ok
(
DeleteFile
(
"testdir2
\\
b.txt"
),
"Expected testdir2
\\
b.txt to exist
\n
"
);
ok
(
RemoveDirectory
(
"testdir2
\\
c.txt"
),
"Expected testdir2
\\
c.txt to exist
\n
"
);
/* try many dest files without FOF_MULTIDESTFILES flag */
shfo
.
pFrom
=
"test1.txt
\0
test2.txt
\0
test3.txt
\0
"
;
shfo
.
pTo
=
"a.txt
\0
b.txt
\0
c.txt
\0
"
;
shfo
.
fAnyOperationsAborted
=
FALSE
;
shfo
.
fFlags
&=
~
FOF_MULTIDESTFILES
;
retval
=
SHFileOperation
(
&
shfo
);
todo_wine
{
ok
(
retval
==
ERROR_CANCELLED
,
"Expected ERROR_CANCELLED, got %ld
\n
"
,
retval
);
}
ok
(
!
file_exists
(
"a.txt"
),
"Expected a.txt to not exist
\n
"
);
/* try a glob */
shfo
.
pFrom
=
"test?.txt
\0
"
;
shfo
.
pTo
=
"testdir2
\0
"
;
...
...
@@ -660,7 +697,8 @@ static void test_copy(void)
retval
=
SHFileOperation
(
&
shfo
);
todo_wine
{
ok
(
retval
==
113
,
"Expected 113, got %ld
\n
"
,
retval
);
ok
(
retval
==
ERROR_NO_MORE_SEARCH_HANDLES
,
"Expected ERROR_NO_MORE_SEARCH_HANDLES, got %ld
\n
"
,
retval
);
ok
(
!
shfo
.
fAnyOperationsAborted
,
"Expected no operations to be aborted
\n
"
);
ok
(
DeleteFile
(
"b.txt"
),
"Expected b.txt to exist
\n
"
);
}
...
...
@@ -730,6 +768,7 @@ static void test_copy(void)
retval
=
SHFileOperation
(
&
shfo
);
ok
(
retval
==
1026
,
"Expected 1026, got %ld
\n
"
,
retval
);
ok
(
!
file_exists
(
"nonexistent
\\
e.txt"
),
"Expected nonexistent
\\
e.txt to not exist
\n
"
);
ok
(
!
file_exists
(
"nonexistent"
),
"Expected nonexistent to not exist
\n
"
);
}
/* tests the FO_MOVE action */
...
...
@@ -883,7 +922,7 @@ static void test_move(void)
{
ok
(
retval
==
ERROR_CANCELLED
,
"Expected ERROR_CANCELLED, got %ld
\n
"
,
retval
);
}
ok
(
!
file_exists
(
"dir1"
),
"Expected dir1 to exist
\n
"
);
ok
(
!
file_exists
(
"dir1"
),
"Expected dir1 to
not
exist
\n
"
);
/* try to overwrite an existing file */
shfo
.
pTo
=
"test3.txt
\0
"
;
...
...
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