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
02baf6c6
Commit
02baf6c6
authored
Sep 25, 2006
by
Saulius Krasuckas
Committed by
Alexandre Julliard
Sep 26, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lz32/tests: Try to open nonexisting compressed files.
parent
1efb87a0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
168 additions
and
0 deletions
+168
-0
lzexpand_main.c
dlls/lz32/tests/lzexpand_main.c
+168
-0
No files found.
dlls/lz32/tests/lzexpand_main.c
View file @
02baf6c6
...
...
@@ -233,6 +233,91 @@ static void test_LZOpenFileA_existing_compressed(void)
delete_file
(
_terminated_
);
}
static
void
test_LZOpenFileA_nonexisting_compressed
(
void
)
{
OFSTRUCT
test
;
INT
file
;
char
expected
[
MAX_PATH
];
char
filled_0xA5
[
OFS_MAXPATHNAME
];
/* Try to open nonexisting compressed files: */
memset
(
&
filled_0xA5
,
0xA5
,
OFS_MAXPATHNAME
);
memset
(
&
test
,
0xA5
,
sizeof
(
test
));
full_file_path_name_in_a_CWD
(
filename_
,
expected
,
FALSE
);
/* a, using 8.3-conformant file name. */
file
=
LZOpenFileA
(
filename
,
&
test
,
OF_EXIST
);
/* If the file "foo.xxx" does not exist, LZOpenFileA should then
check for the file "foo.xx_" and open that -- at least on some
operating systems. Doesn't seem to on my copy of Win98.
*/
ok
(
file
==
LZERROR_BADINHANDLE
,
"LZOpenFileA succeeded on nonexistent file
\n
"
);
todo_wine
ok
(
test
.
cBytes
==
0xA5
,
"LZOpenFileA set test.cBytes to %d
\n
"
,
test
.
cBytes
);
ok
(
test
.
nErrCode
==
ERROR_FILE_NOT_FOUND
,
"LZOpenFileA set test.nErrCode to %d
\n
"
,
test
.
nErrCode
);
ok
(
lstrcmpA
(
test
.
szPathName
,
expected
)
==
0
||
strncmp
(
test
.
szPathName
,
filled_0xA5
,
OFS_MAXPATHNAME
)
==
0
,
/* Win9x */
"LZOpenFileA returned '%s', but was expected to return '%s' or '%s'
\n
"
,
test
.
szPathName
,
expected
,
filled_0xA5
);
memset
(
&
filled_0xA5
,
0xA5
,
OFS_MAXPATHNAME
);
memset
(
&
test
,
0xA5
,
sizeof
(
test
));
full_file_path_name_in_a_CWD
(
dotless_
,
expected
,
FALSE
);
/* b, using dotless file name. */
file
=
LZOpenFileA
(
dotless
,
&
test
,
OF_EXIST
);
ok
(
file
==
LZERROR_BADINHANDLE
,
"LZOpenFileA succeeded on nonexistent file
\n
"
);
todo_wine
ok
(
test
.
cBytes
==
0xA5
,
"LZOpenFileA set test.cBytes to %d
\n
"
,
test
.
cBytes
);
ok
(
test
.
nErrCode
==
ERROR_FILE_NOT_FOUND
,
"LZOpenFileA set test.nErrCode to %d
\n
"
,
test
.
nErrCode
);
ok
(
lstrcmpA
(
test
.
szPathName
,
expected
)
==
0
||
strncmp
(
test
.
szPathName
,
filled_0xA5
,
OFS_MAXPATHNAME
)
==
0
,
/* Win9x */
"LZOpenFileA returned '%s', but was expected to return '%s' or '%s'
\n
"
,
test
.
szPathName
,
expected
,
filled_0xA5
);
memset
(
&
filled_0xA5
,
0xA5
,
OFS_MAXPATHNAME
);
memset
(
&
test
,
0xA5
,
sizeof
(
test
));
full_file_path_name_in_a_CWD
(
extless_
,
expected
,
FALSE
);
/* c, using extensionless file name. */
file
=
LZOpenFileA
(
extless
,
&
test
,
OF_EXIST
);
ok
(
file
==
LZERROR_BADINHANDLE
,
"LZOpenFileA succeeded on nonexistent file
\n
"
);
todo_wine
ok
(
test
.
cBytes
==
0xA5
,
"LZOpenFileA set test.cBytes to %d
\n
"
,
test
.
cBytes
);
ok
(
test
.
nErrCode
==
ERROR_FILE_NOT_FOUND
,
"LZOpenFileA set test.nErrCode to %d
\n
"
,
test
.
nErrCode
);
ok
(
lstrcmpA
(
test
.
szPathName
,
expected
)
==
0
||
strncmp
(
test
.
szPathName
,
filled_0xA5
,
OFS_MAXPATHNAME
)
==
0
,
/* Win9x */
"LZOpenFileA returned '%s', but was expected to return '%s' or '%s'
\n
"
,
test
.
szPathName
,
expected
,
filled_0xA5
);
memset
(
&
filled_0xA5
,
0xA5
,
OFS_MAXPATHNAME
);
memset
(
&
test
,
0xA5
,
sizeof
(
test
));
full_file_path_name_in_a_CWD
(
_terminated_
,
expected
,
FALSE
);
/* d, using underscore-terminated file name. */
file
=
LZOpenFileA
(
_terminated
,
&
test
,
OF_EXIST
);
ok
(
file
==
LZERROR_BADINHANDLE
,
"LZOpenFileA succeeded on nonexistent file
\n
"
);
todo_wine
ok
(
test
.
cBytes
==
0xA5
,
"LZOpenFileA set test.cBytes to %d
\n
"
,
test
.
cBytes
);
ok
(
test
.
nErrCode
==
ERROR_FILE_NOT_FOUND
,
"LZOpenFileA set test.nErrCode to %d
\n
"
,
test
.
nErrCode
);
ok
(
lstrcmpA
(
test
.
szPathName
,
expected
)
==
0
||
strncmp
(
test
.
szPathName
,
filled_0xA5
,
OFS_MAXPATHNAME
)
==
0
,
/* Win9x */
"LZOpenFileA returned '%s', but was expected to return '%s' or '%s'
\n
"
,
test
.
szPathName
,
expected
,
filled_0xA5
);
}
static
void
test_LZOpenFileA
(
void
)
{
OFSTRUCT
test
;
...
...
@@ -281,6 +366,7 @@ static void test_LZOpenFileA(void)
"GetFileAttributesA succeeded on deleted file
\n
"
);
test_LZOpenFileA_existing_compressed
();
test_LZOpenFileA_nonexisting_compressed
();
}
static
void
test_LZRead
(
void
)
...
...
@@ -478,6 +564,87 @@ static void test_LZOpenFileW_existing_compressed(void)
delete_fileW
(
_terminatedW_
);
}
static
void
test_LZOpenFileW_nonexisting_compressed
(
void
)
{
OFSTRUCT
test
;
INT
file
;
char
expected
[
MAX_PATH
];
char
filled_0xA5
[
OFS_MAXPATHNAME
];
/* Try to open nonexisting compressed files: */
memset
(
&
filled_0xA5
,
0xA5
,
OFS_MAXPATHNAME
);
memset
(
&
test
,
0xA5
,
sizeof
(
test
));
full_file_path_name_in_a_CWD
(
filename_
,
expected
,
FALSE
);
/* a, using 8.3-conformant file name. */
file
=
LZOpenFileW
(
filenameW
,
&
test
,
OF_EXIST
);
/* If the file "foo.xxx" does not exist, LZOpenFileA should then
check for the file "foo.xx_" and open that -- at least on some
operating systems. Doesn't seem to on my copy of Win98.
*/
ok
(
file
==
LZERROR_BADINHANDLE
,
"LZOpenFileW succeeded on nonexistent file
\n
"
);
todo_wine
ok
(
test
.
cBytes
==
0xA5
,
"LZOpenFileW set test.cBytes to %d
\n
"
,
test
.
cBytes
);
ok
(
test
.
nErrCode
==
ERROR_FILE_NOT_FOUND
,
"LZOpenFileW set test.nErrCode to %d
\n
"
,
test
.
nErrCode
);
ok
(
lstrcmpA
(
test
.
szPathName
,
expected
)
==
0
,
"LZOpenFileW returned '%s', but was expected to return '%s' or '%s'
\n
"
,
test
.
szPathName
,
expected
,
filled_0xA5
);
memset
(
&
filled_0xA5
,
0xA5
,
OFS_MAXPATHNAME
);
memset
(
&
test
,
0xA5
,
sizeof
(
test
));
full_file_path_name_in_a_CWD
(
dotless_
,
expected
,
FALSE
);
/* b, using dotless file name. */
file
=
LZOpenFileW
(
dotlessW
,
&
test
,
OF_EXIST
);
ok
(
file
==
LZERROR_BADINHANDLE
,
"LZOpenFileW succeeded on nonexistent file
\n
"
);
todo_wine
ok
(
test
.
cBytes
==
0xA5
,
"LZOpenFileW set test.cBytes to %d
\n
"
,
test
.
cBytes
);
ok
(
test
.
nErrCode
==
ERROR_FILE_NOT_FOUND
,
"LZOpenFileW set test.nErrCode to %d
\n
"
,
test
.
nErrCode
);
ok
(
lstrcmpA
(
test
.
szPathName
,
expected
)
==
0
,
"LZOpenFileW returned '%s', but was expected to return '%s' or '%s'
\n
"
,
test
.
szPathName
,
expected
,
filled_0xA5
);
memset
(
&
filled_0xA5
,
0xA5
,
OFS_MAXPATHNAME
);
memset
(
&
test
,
0xA5
,
sizeof
(
test
));
full_file_path_name_in_a_CWD
(
extless_
,
expected
,
FALSE
);
/* c, using extensionless file name. */
file
=
LZOpenFileW
(
extlessW
,
&
test
,
OF_EXIST
);
ok
(
file
==
LZERROR_BADINHANDLE
,
"LZOpenFileW succeeded on nonexistent file
\n
"
);
todo_wine
ok
(
test
.
cBytes
==
0xA5
,
"LZOpenFileW set test.cBytes to %d
\n
"
,
test
.
cBytes
);
ok
(
test
.
nErrCode
==
ERROR_FILE_NOT_FOUND
,
"LZOpenFileW set test.nErrCode to %d
\n
"
,
test
.
nErrCode
);
ok
(
lstrcmpA
(
test
.
szPathName
,
expected
)
==
0
,
"LZOpenFileW returned '%s', but was expected to return '%s' or '%s'
\n
"
,
test
.
szPathName
,
expected
,
filled_0xA5
);
memset
(
&
filled_0xA5
,
0xA5
,
OFS_MAXPATHNAME
);
memset
(
&
test
,
0xA5
,
sizeof
(
test
));
full_file_path_name_in_a_CWD
(
_terminated_
,
expected
,
FALSE
);
/* d, using underscore-terminated file name. */
file
=
LZOpenFileW
(
_terminatedW
,
&
test
,
OF_EXIST
);
ok
(
file
==
LZERROR_BADINHANDLE
,
"LZOpenFileW succeeded on nonexistent file
\n
"
);
todo_wine
ok
(
test
.
cBytes
==
0xA5
,
"LZOpenFileA set test.cBytes to %d
\n
"
,
test
.
cBytes
);
ok
(
test
.
nErrCode
==
ERROR_FILE_NOT_FOUND
,
"LZOpenFileA set test.nErrCode to %d
\n
"
,
test
.
nErrCode
);
ok
(
lstrcmpA
(
test
.
szPathName
,
expected
)
==
0
,
"LZOpenFileA returned '%s', but was expected to return '%s' or '%s'
\n
"
,
test
.
szPathName
,
expected
,
filled_0xA5
);
}
static
void
test_LZOpenFileW
(
void
)
{
OFSTRUCT
test
;
...
...
@@ -529,6 +696,7 @@ static void test_LZOpenFileW(void)
"GetFileAttributesW succeeded on deleted file
\n
"
);
test_LZOpenFileW_existing_compressed
();
test_LZOpenFileW_nonexisting_compressed
();
}
...
...
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