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
1b5873ac
Commit
1b5873ac
authored
Aug 31, 2008
by
Jeff Zaroyko
Committed by
Alexandre Julliard
Sep 03, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Add some tests for DeleteFile.
parent
a251a8f1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
file.c
dlls/kernel32/tests/file.c
+34
-0
No files found.
dlls/kernel32/tests/file.c
View file @
1b5873ac
...
...
@@ -2,6 +2,7 @@
* Unit tests for file functions in Wine
*
* Copyright (c) 2002, 2004 Jakob Eriksson
* Copyright (c) 2008 Jeff Zaroyko
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -841,6 +842,10 @@ static void test_DeleteFileA( void )
static
void
test_DeleteFileW
(
void
)
{
BOOL
ret
;
WCHAR
pathW
[
MAX_PATH
];
WCHAR
pathsubW
[
MAX_PATH
];
static
const
WCHAR
dirW
[]
=
{
'd'
,
'e'
,
'l'
,
'e'
,
't'
,
'e'
,
'f'
,
'i'
,
'l'
,
'e'
,
0
};
static
const
WCHAR
subdirW
[]
=
{
'\\'
,
's'
,
'u'
,
'b'
,
0
};
static
const
WCHAR
emptyW
[]
=
{
'\0'
};
ret
=
DeleteFileW
(
NULL
);
...
...
@@ -852,6 +857,35 @@ static void test_DeleteFileW( void )
ret
=
DeleteFileW
(
emptyW
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_PATH_NOT_FOUND
,
"DeleteFileW(
\"\"
) returned ret=%d error=%d
\n
"
,
ret
,
GetLastError
());
/* test DeleteFile on empty directory */
ret
=
GetTempPathW
(
MAX_PATH
,
pathW
);
if
(
ret
+
sizeof
(
dirW
)
/
sizeof
(
WCHAR
)
-
1
+
sizeof
(
subdirW
)
/
sizeof
(
WCHAR
)
-
1
>=
MAX_PATH
)
{
ok
(
0
,
"MAX_PATH exceeded in constructing paths"
);
return
;
}
lstrcatW
(
pathW
,
dirW
);
lstrcpyW
(
pathsubW
,
pathW
);
lstrcatW
(
pathsubW
,
subdirW
);
ret
=
CreateDirectoryW
(
pathW
,
NULL
);
ok
(
ret
==
TRUE
,
"couldn't create directory deletefile
\n
"
);
ret
=
DeleteFileW
(
pathW
);
todo_wine
ok
(
ret
==
FALSE
,
"DeleteFile should fail for empty directories
\n
"
);
ret
=
RemoveDirectoryW
(
pathW
);
todo_wine
ok
(
ret
==
TRUE
,
"expected to remove directory deletefile
\n
"
);
/* test DeleteFile on non-empty directory */
ret
=
CreateDirectoryW
(
pathW
,
NULL
);
ok
(
ret
==
TRUE
,
"couldn't create directory deletefile
\n
"
);
ret
=
CreateDirectoryW
(
pathsubW
,
NULL
);
ok
(
ret
==
TRUE
,
"couldn't create directory deletefile
\\
sub
\n
"
);
ret
=
DeleteFileW
(
pathW
);
todo_wine
ok
(
ret
==
FALSE
,
"DeleteFile should fail for non-empty directories
\n
"
);
ret
=
RemoveDirectoryW
(
pathsubW
);
ok
(
ret
==
TRUE
,
"expected to remove directory deletefile
\\
sub
\n
"
);
ret
=
RemoveDirectoryW
(
pathW
);
ok
(
ret
==
TRUE
,
"expected to remove directory deletefile
\n
"
);
}
#define IsDotDir(x) ((x[0] == '.') && ((x[1] == 0) || ((x[1] == '.') && (x[2] == 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