Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
d4f13811
Commit
d4f13811
authored
Sep 16, 2003
by
Rolf Kalbermatter
Committed by
Alexandre Julliard
Sep 16, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a few todo_wine tests with filenames with wildcards.
parent
55bcaec4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
205 additions
and
5 deletions
+205
-5
directory.c
dlls/kernel/tests/directory.c
+95
-0
file.c
dlls/kernel/tests/file.c
+110
-5
No files found.
dlls/kernel/tests/directory.c
View file @
d4f13811
...
...
@@ -192,6 +192,22 @@ static void test_CreateDirectoryA(void)
ret
=
RemoveDirectoryA
(
tmpdir
);
ok
(
ret
==
TRUE
,
"RemoveDirectoryA should always succeed"
);
todo_wine
{
lstrcatA
(
tmpdir
,
"?"
);
ret
=
CreateDirectoryA
(
tmpdir
,
NULL
);
ok
(
ret
==
FALSE
&&
GetLastError
()
==
ERROR_INVALID_NAME
,
"CreateDirectoryA with ? wildcard name should fail, ret=%s error=%ld"
,
ret
?
" True"
:
"False"
,
GetLastError
());
ret
=
RemoveDirectoryA
(
tmpdir
);
tmpdir
[
lstrlenA
(
tmpdir
)
-
1
]
=
'*'
;
ret
=
CreateDirectoryA
(
tmpdir
,
NULL
);
ok
(
ret
==
FALSE
&&
GetLastError
()
==
ERROR_INVALID_NAME
,
"CreateDirectoryA with * wildcard name should fail, ret=%s error=%ld"
,
ret
?
" True"
:
"False"
,
GetLastError
());
ret
=
RemoveDirectoryA
(
tmpdir
);
}
}
static
void
test_CreateDirectoryW
(
void
)
...
...
@@ -202,6 +218,7 @@ static void test_CreateDirectoryW(void)
static
const
WCHAR
tmp_dir_name
[]
=
{
'P'
,
'l'
,
'e'
,
'a'
,
's'
,
'e'
,
' '
,
'R'
,
'e'
,
'm'
,
'o'
,
'v'
,
'e'
,
' '
,
'M'
,
'e'
,
0
};
static
const
WCHAR
dotW
[]
=
{
'.'
,
0
};
static
const
WCHAR
dotdotW
[]
=
{
'.'
,
'.'
,
0
};
static
const
WCHAR
questionW
[]
=
{
'?'
,
0
};
ret
=
CreateDirectoryW
(
NULL
,
NULL
);
if
(
!
ret
&&
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
)
...
...
@@ -238,6 +255,81 @@ static void test_CreateDirectoryW(void)
ret
=
RemoveDirectoryW
(
tmpdir
);
ok
(
ret
==
TRUE
,
"RemoveDirectoryW should always succeed"
);
todo_wine
{
lstrcatW
(
tmpdir
,
questionW
);
ret
=
CreateDirectoryW
(
tmpdir
,
NULL
);
ok
(
ret
==
FALSE
&&
GetLastError
()
==
ERROR_INVALID_NAME
,
"CreateDirectoryW with ? wildcard name should fail with error 183, ret=%s error=%ld"
,
ret
?
" True"
:
"False"
,
GetLastError
());
ret
=
RemoveDirectoryW
(
tmpdir
);
tmpdir
[
lstrlenW
(
tmpdir
)
-
1
]
=
'*'
;
ret
=
CreateDirectoryW
(
tmpdir
,
NULL
);
ok
(
ret
==
FALSE
&&
GetLastError
()
==
ERROR_INVALID_NAME
,
"CreateDirectoryW with * wildcard name should fail with error 183, ret=%s error=%ld"
,
ret
?
" True"
:
"False"
,
GetLastError
());
ret
=
RemoveDirectoryW
(
tmpdir
);
}
}
static
void
test_RemoveDirectoryA
(
void
)
{
char
tmpdir
[
MAX_PATH
];
BOOL
ret
;
GetTempPathA
(
MAX_PATH
,
tmpdir
);
lstrcatA
(
tmpdir
,
"Please Remove Me"
);
ret
=
CreateDirectoryA
(
tmpdir
,
NULL
);
ok
(
ret
==
TRUE
,
"CreateDirectoryA should always succeed"
);
ret
=
RemoveDirectoryA
(
tmpdir
);
ok
(
ret
==
TRUE
,
"RemoveDirectoryA should always succeed"
);
todo_wine
{
lstrcatA
(
tmpdir
,
"?"
);
ret
=
RemoveDirectoryA
(
tmpdir
);
ok
(
ret
==
FALSE
&&
GetLastError
()
==
ERROR_INVALID_NAME
,
"RemoveDirectoryA with ? wildcard name should fail with error 183, ret=%s error=%ld"
,
ret
?
" True"
:
"False"
,
GetLastError
());
tmpdir
[
lstrlenA
(
tmpdir
)
-
1
]
=
'*'
;
ret
=
RemoveDirectoryA
(
tmpdir
);
ok
(
ret
==
FALSE
&&
GetLastError
()
==
ERROR_INVALID_NAME
,
"RemoveDirectoryA with * wildcard name should fail with error 183, ret=%s error=%ld"
,
ret
?
" True"
:
"False"
,
GetLastError
());
}
}
static
void
test_RemoveDirectoryW
(
void
)
{
WCHAR
tmpdir
[
MAX_PATH
];
BOOL
ret
;
static
const
WCHAR
tmp_dir_name
[]
=
{
'P'
,
'l'
,
'e'
,
'a'
,
's'
,
'e'
,
' '
,
'R'
,
'e'
,
'm'
,
'o'
,
'v'
,
'e'
,
' '
,
'M'
,
'e'
,
0
};
static
const
WCHAR
questionW
[]
=
{
'?'
,
0
};
GetTempPathW
(
MAX_PATH
,
tmpdir
);
lstrcatW
(
tmpdir
,
tmp_dir_name
);
ret
=
CreateDirectoryW
(
tmpdir
,
NULL
);
ok
(
ret
==
TRUE
,
"CreateDirectoryW should always succeed"
);
ret
=
RemoveDirectoryW
(
tmpdir
);
ok
(
ret
==
TRUE
,
"RemoveDirectoryW should always succeed"
);
todo_wine
{
lstrcatW
(
tmpdir
,
questionW
);
ret
=
RemoveDirectoryW
(
tmpdir
);
ok
(
ret
==
FALSE
&&
GetLastError
()
==
ERROR_INVALID_NAME
,
"RemoveDirectoryW with wildcard should fail with error 183, ret=%s error=%ld"
,
ret
?
" True"
:
"False"
,
GetLastError
());
tmpdir
[
lstrlenW
(
tmpdir
)
-
1
]
=
'*'
;
ret
=
RemoveDirectoryW
(
tmpdir
);
ok
(
ret
==
FALSE
&&
GetLastError
()
==
ERROR_INVALID_NAME
,
"RemoveDirectoryW with * wildcard name should fail with error 183, ret=%s error=%ld"
,
ret
?
" True"
:
"False"
,
GetLastError
());
}
}
START_TEST
(
directory
)
...
...
@@ -250,4 +342,7 @@ START_TEST(directory)
test_CreateDirectoryA
();
test_CreateDirectoryW
();
test_RemoveDirectoryA
();
test_RemoveDirectoryW
();
}
dlls/kernel/tests/file.c
View file @
d4f13811
...
...
@@ -28,7 +28,6 @@
#include "winbase.h"
#include "winerror.h"
LPCSTR
filename
=
"testfile.xxx"
;
LPCSTR
sillytext
=
"en larvig liten text dx
\033
gx hej 84 hej 4484 !
\001\033
bla bl
\n
a.. bla bla."
...
...
@@ -263,10 +262,13 @@ static void test__lcreat( void )
ok
(
DeleteFileA
(
filename
)
!=
0
,
"DeleteFile failed (%ld)"
,
GetLastError
(
)
);
filehandle
=
_lcreat
(
slashname
,
0
);
/* illegal name */
if
(
HFILE_ERROR
==
filehandle
)
ok
(
0
,
"couldn't create file
\"
%s
\"
(err=%ld)"
,
slashname
,
GetLastError
());
else
{
if
(
HFILE_ERROR
!=
filehandle
||
GetLastError
()
!=
ERROR_INVALID_NAME
)
{
todo_wine
{
ok
(
0
,
"creating file
\"
%s
\"
should fail with error 123, (err=%ld)"
,
slashname
,
GetLastError
());
}
_lclose
(
filehandle
);
find
=
FindFirstFileA
(
slashname
,
&
search_results
);
if
(
INVALID_HANDLE_VALUE
==
find
)
...
...
@@ -648,6 +650,109 @@ static void test_DeleteFileW( void )
"DeleteFileW(
\"\"
) returned ret=%d error=%ld"
,
ret
,
GetLastError
());
}
#define IsDotDir(x) ((x[0] == '.') && ((x[1] == 0) || ((x[1] == '.') && (x[2] == 0))))
void
test_MoveFileA
(
void
)
{
char
tempdir
[
MAX_PATH
];
char
source
[
MAX_PATH
],
dest
[
MAX_PATH
];
static
const
char
prefix
[]
=
"pfx"
;
DWORD
ret
;
ret
=
GetTempPathA
(
MAX_PATH
,
tempdir
);
ok
(
ret
!=
0
,
"GetTempPathA error %ld"
,
GetLastError
());
ok
(
ret
<
MAX_PATH
,
"temp path should fit into MAX_PATH"
);
ret
=
GetTempFileNameA
(
tempdir
,
prefix
,
0
,
source
);
ok
(
ret
!=
0
,
"GetTempFileNameA error %ld"
,
GetLastError
());
ret
=
GetTempFileNameA
(
tempdir
,
prefix
,
0
,
dest
);
ok
(
ret
!=
0
,
"GetTempFileNameA error %ld"
,
GetLastError
());
ret
=
MoveFileA
(
source
,
dest
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_FILE_EXISTS
,
"MoveFileA: unexpected error %ld
\n
"
,
GetLastError
());
ret
=
DeleteFileA
(
dest
);
ok
(
ret
,
"DeleteFileA: error %ld
\n
"
,
GetLastError
());
ret
=
MoveFileA
(
source
,
dest
);
ok
(
ret
,
"MoveFileA: failed, error %ld
\n
"
,
GetLastError
());
lstrcatA
(
tempdir
,
"Remove Me"
);
ret
=
CreateDirectoryA
(
tempdir
,
NULL
);
ok
(
ret
==
TRUE
,
"CreateDirectoryA failed"
);
lstrcpyA
(
source
,
dest
);
lstrcpyA
(
dest
,
tempdir
);
lstrcatA
(
dest
,
"
\\
wild?.*"
);
ret
=
MoveFileA
(
source
,
dest
);
todo_wine
{
ok
(
!
ret
,
"MoveFileA: shouldn't move to wildcard file"
);
ok
(
GetLastError
()
==
ERROR_INVALID_NAME
,
"MoveFileA: with wildcards, unexpected error %ld
\n
"
,
GetLastError
());
if
(
ret
||
(
GetLastError
()
!=
ERROR_INVALID_NAME
))
{
WIN32_FIND_DATAA
fd
;
char
temppath
[
MAX_PATH
];
HANDLE
hFind
;
lstrcpyA
(
temppath
,
tempdir
);
lstrcatA
(
temppath
,
"
\\
*.*"
);
hFind
=
FindFirstFileA
(
temppath
,
&
fd
);
if
(
INVALID_HANDLE_VALUE
!=
hFind
)
{
LPSTR
lpName
;
do
{
lpName
=
fd
.
cAlternateFileName
;
if
(
!
lpName
[
0
])
lpName
=
fd
.
cFileName
;
ok
(
!
IsDotDir
(
lpName
),
"MoveFileA: wildcards file created!"
);
}
while
(
FindNextFileA
(
hFind
,
&
fd
));
FindClose
(
hFind
);
}
}
}
ret
=
DeleteFileA
(
source
);
ok
(
ret
,
"DeleteFileA: error %ld
\n
"
,
GetLastError
());
ret
=
DeleteFileA
(
dest
);
ok
(
!
ret
,
"DeleteFileA: error %ld
\n
"
,
GetLastError
());
ret
=
RemoveDirectoryA
(
tempdir
);
ok
(
ret
,
"DeleteDirectoryA: error %ld
\n
"
,
GetLastError
());
}
void
test_MoveFileW
(
void
)
{
WCHAR
temp_path
[
MAX_PATH
];
WCHAR
source
[
MAX_PATH
],
dest
[
MAX_PATH
];
static
const
WCHAR
prefix
[]
=
{
'p'
,
'f'
,
'x'
,
0
};
DWORD
ret
;
ret
=
GetTempPathW
(
MAX_PATH
,
temp_path
);
if
(
ret
==
0
&&
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
)
return
;
ok
(
ret
!=
0
,
"GetTempPathW error %ld"
,
GetLastError
());
ok
(
ret
<
MAX_PATH
,
"temp path should fit into MAX_PATH"
);
ret
=
GetTempFileNameW
(
temp_path
,
prefix
,
0
,
source
);
ok
(
ret
!=
0
,
"GetTempFileNameW error %ld"
,
GetLastError
());
ret
=
GetTempFileNameW
(
temp_path
,
prefix
,
0
,
dest
);
ok
(
ret
!=
0
,
"GetTempFileNameW error %ld"
,
GetLastError
());
ret
=
MoveFileW
(
source
,
dest
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_FILE_EXISTS
,
"CopyFileW: unexpected error %ld
\n
"
,
GetLastError
());
ret
=
DeleteFileW
(
source
);
ok
(
ret
,
"DeleteFileW: error %ld
\n
"
,
GetLastError
());
ret
=
DeleteFileW
(
dest
);
ok
(
ret
,
"DeleteFileW: error %ld
\n
"
,
GetLastError
());
}
#define PATTERN_OFFSET 0x10
void
test_offset_in_overlapped_structure
(
void
)
...
...
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