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
bd2df081
Commit
bd2df081
authored
Jun 19, 2006
by
Saulius Krasuckas
Committed by
Alexandre Julliard
Jun 19, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lz32: Rename function aliases to real (ASCII) function names.
parent
6c4c4e35
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
61 deletions
+59
-61
lzexpand_main.c
dlls/lz32/tests/lzexpand_main.c
+59
-61
No files found.
dlls/lz32/tests/lzexpand_main.c
View file @
bd2df081
...
@@ -52,7 +52,7 @@ static const DWORD uncompressed_data_size = sizeof(uncompressed_data) - 1;
...
@@ -52,7 +52,7 @@ static const DWORD uncompressed_data_size = sizeof(uncompressed_data) - 1;
static
char
*
buf
;
static
char
*
buf
;
static
void
test_
lzopenfile
(
void
)
static
void
test_
LZOpenFileA
(
void
)
{
{
OFSTRUCT
test
;
OFSTRUCT
test
;
DWORD
retval
;
DWORD
retval
;
...
@@ -60,41 +60,40 @@ static void test_lzopenfile(void)
...
@@ -60,41 +60,40 @@ static void test_lzopenfile(void)
char
expected
[
MAX_PATH
];
char
expected
[
MAX_PATH
];
char
filled_0xA5
[
OFS_MAXPATHNAME
];
char
filled_0xA5
[
OFS_MAXPATHNAME
];
/* Check for nonexistent file. */
/* Check for nonexistent file. */
file
=
LZOpenFile
(
"badfilename_"
,
&
test
,
OF_READ
);
file
=
LZOpenFile
A
(
"badfilename_"
,
&
test
,
OF_READ
);
ok
(
file
==
LZERROR_BADINHANDLE
,
ok
(
file
==
LZERROR_BADINHANDLE
,
"LZOpenFile succeeded on nonexistent file
\n
"
);
"LZOpenFile
A
succeeded on nonexistent file
\n
"
);
LZClose
(
file
);
LZClose
(
file
);
/* Create an empty file. */
/* Create an empty file. */
file
=
LZOpenFile
(
filename_
,
&
test
,
OF_CREATE
);
file
=
LZOpenFile
A
(
filename_
,
&
test
,
OF_CREATE
);
ok
(
file
>=
0
,
"LZOpenFile failed on creation
\n
"
);
ok
(
file
>=
0
,
"LZOpenFile
A
failed on creation
\n
"
);
LZClose
(
file
);
LZClose
(
file
);
retval
=
GetFileAttributes
(
filename_
);
retval
=
GetFileAttributes
A
(
filename_
);
ok
(
retval
!=
INVALID_FILE_ATTRIBUTES
,
"GetFileAttributes: error %ld
\n
"
,
ok
(
retval
!=
INVALID_FILE_ATTRIBUTES
,
"GetFileAttributes
A
: error %ld
\n
"
,
GetLastError
());
GetLastError
());
/* Check various opening options. */
/* Check various opening options. */
file
=
LZOpenFile
(
filename_
,
&
test
,
OF_READ
);
file
=
LZOpenFile
A
(
filename_
,
&
test
,
OF_READ
);
ok
(
file
>=
0
,
"LZOpenFile failed on read
\n
"
);
ok
(
file
>=
0
,
"LZOpenFile
A
failed on read
\n
"
);
LZClose
(
file
);
LZClose
(
file
);
file
=
LZOpenFile
(
filename_
,
&
test
,
OF_WRITE
);
file
=
LZOpenFile
A
(
filename_
,
&
test
,
OF_WRITE
);
ok
(
file
>=
0
,
"LZOpenFile failed on write
\n
"
);
ok
(
file
>=
0
,
"LZOpenFile
A
failed on write
\n
"
);
LZClose
(
file
);
LZClose
(
file
);
file
=
LZOpenFile
(
filename_
,
&
test
,
OF_READWRITE
);
file
=
LZOpenFile
A
(
filename_
,
&
test
,
OF_READWRITE
);
ok
(
file
>=
0
,
"LZOpenFile failed on read/write
\n
"
);
ok
(
file
>=
0
,
"LZOpenFile
A
failed on read/write
\n
"
);
LZClose
(
file
);
LZClose
(
file
);
file
=
LZOpenFile
(
filename_
,
&
test
,
OF_EXIST
);
file
=
LZOpenFile
A
(
filename_
,
&
test
,
OF_EXIST
);
ok
(
file
>=
0
,
"LZOpenFile failed on read/write
\n
"
);
ok
(
file
>=
0
,
"LZOpenFile
A
failed on read/write
\n
"
);
LZClose
(
file
);
LZClose
(
file
);
/* If the file "foo.xxx" does not exist, LZOpenFile should then
/* If the file "foo.xxx" does not exist, LZOpenFile
A
should then
check for the file "foo.xx_" and open that -- at least on some
check for the file "foo.xx_" and open that -- at least on some
operating systems. Doesn't seem to on my copy of Win98.
operating systems. Doesn't seem to on my copy of Win98.
*/
*/
retval
=
GetCurrentDirectory
(
MAX_PATH
,
expected
);
retval
=
GetCurrentDirectory
A
(
MAX_PATH
,
expected
);
ok
(
retval
>
0
,
"GetCurrentDirectory returned %ld, GLE=0x%lx
\n
"
,
ok
(
retval
>
0
,
"GetCurrentDirectory
A
returned %ld, GLE=0x%lx
\n
"
,
retval
,
GetLastError
());
retval
,
GetLastError
());
lstrcatA
(
expected
,
"
\\
"
);
lstrcatA
(
expected
,
"
\\
"
);
lstrcatA
(
expected
,
filename
);
lstrcatA
(
expected
,
filename
);
...
@@ -106,38 +105,37 @@ static void test_lzopenfile(void)
...
@@ -106,38 +105,37 @@ static void test_lzopenfile(void)
SetLastError
(
0xfaceabee
);
SetLastError
(
0xfaceabee
);
/* Try to open compressed file. */
/* Try to open compressed file. */
file
=
LZOpenFile
(
filename
,
&
test
,
OF_EXIST
);
file
=
LZOpenFile
A
(
filename
,
&
test
,
OF_EXIST
);
if
(
file
!=
LZERROR_BADINHANDLE
)
{
/* NT */
if
(
file
!=
LZERROR_BADINHANDLE
)
{
ok
(
test
.
cBytes
==
sizeof
(
OFSTRUCT
),
ok
(
test
.
cBytes
==
sizeof
(
OFSTRUCT
),
"LZOpenFile set test.cBytes to %d
\n
"
,
test
.
cBytes
);
"LZOpenFile
A
set test.cBytes to %d
\n
"
,
test
.
cBytes
);
ok
(
test
.
nErrCode
==
0
,
ok
(
test
.
nErrCode
==
0
,
"LZOpenFileA set test.nErrCode to %d
\n
"
,
"LZOpenFile set test.nErrCode to %d
\n
"
,
test
.
nErrCode
);
test
.
nErrCode
);
ok
(
lstrcmpA
(
test
.
szPathName
,
expected
)
==
0
,
ok
(
lstrcmpA
(
test
.
szPathName
,
expected
)
==
0
,
"LZOpenFile
returned '%s', but was expected to return '%s'
\n
"
,
"LZOpenFile
A returned '%s', but was expected to return '%s'
\n
"
,
test
.
szPathName
,
expected
);
test
.
szPathName
,
expected
);
LZClose
(
file
);
LZClose
(
file
);
}
else
{
/* 9x */
}
else
{
ok
(
test
.
cBytes
==
0xA5
,
ok
(
test
.
cBytes
==
0xA5
,
"LZOpenFile set test.cBytes to %d
\n
"
,
test
.
cBytes
);
"LZOpenFile
A
set test.cBytes to %d
\n
"
,
test
.
cBytes
);
ok
(
test
.
nErrCode
==
ERROR_FILE_NOT_FOUND
,
ok
(
test
.
nErrCode
==
ERROR_FILE_NOT_FOUND
,
"LZOpenFile set test.nErrCode to %d
\n
"
,
test
.
nErrCode
);
"LZOpenFile
A
set test.nErrCode to %d
\n
"
,
test
.
nErrCode
);
ok
(
strncmp
(
test
.
szPathName
,
filled_0xA5
,
OFS_MAXPATHNAME
)
==
0
,
ok
(
strncmp
(
test
.
szPathName
,
filled_0xA5
,
OFS_MAXPATHNAME
)
==
0
,
"LZOpenFile
returned '%s', but was expected to return '%s'
\n
"
,
"LZOpenFile
A returned '%s', but was expected to return '%s'
\n
"
,
test
.
szPathName
,
filled_0xA5
);
test
.
szPathName
,
filled_0xA5
);
}
}
/* Delete the file then make sure it doesn't exist anymore. */
/* Delete the file then make sure it doesn't exist anymore. */
file
=
LZOpenFile
(
filename_
,
&
test
,
OF_DELETE
);
file
=
LZOpenFile
A
(
filename_
,
&
test
,
OF_DELETE
);
ok
(
file
>=
0
,
"LZOpenFile failed on delete
\n
"
);
ok
(
file
>=
0
,
"LZOpenFile
A
failed on delete
\n
"
);
LZClose
(
file
);
LZClose
(
file
);
retval
=
GetFileAttributes
(
filename_
);
retval
=
GetFileAttributes
A
(
filename_
);
ok
(
retval
==
INVALID_FILE_ATTRIBUTES
,
ok
(
retval
==
INVALID_FILE_ATTRIBUTES
,
"GetFileAttributes succeeded on deleted file
\n
"
);
"GetFileAttributesA succeeded on deleted file
\n
"
);
}
}
static
void
test_
lzr
ead
(
void
)
static
void
test_
LZR
ead
(
void
)
{
{
HANDLE
file
;
HANDLE
file
;
DWORD
ret
;
DWORD
ret
;
...
@@ -146,15 +144,15 @@ static void test_lzread(void)
...
@@ -146,15 +144,15 @@ static void test_lzread(void)
BOOL
retok
;
BOOL
retok
;
/* Create the compressed file. */
/* Create the compressed file. */
file
=
CreateFile
(
filename_
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_NEW
,
0
,
0
);
file
=
CreateFile
A
(
filename_
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_NEW
,
0
,
0
);
ok
(
file
!=
INVALID_HANDLE_VALUE
,
"Could not create test file
\n
"
);
ok
(
file
!=
INVALID_HANDLE_VALUE
,
"Could not create test file
\n
"
);
retok
=
WriteFile
(
file
,
compressed_file
,
compressed_file_size
,
&
ret
,
0
);
retok
=
WriteFile
(
file
,
compressed_file
,
compressed_file_size
,
&
ret
,
0
);
ok
(
retok
,
"WriteFile: error %ld
\n
"
,
GetLastError
());
ok
(
retok
,
"WriteFile: error %ld
\n
"
,
GetLastError
());
ok
(
ret
==
compressed_file_size
,
"Wrote wrong number of bytes with WriteFile?
\n
"
);
ok
(
ret
==
compressed_file_size
,
"Wrote wrong number of bytes with WriteFile?
\n
"
);
CloseHandle
(
file
);
CloseHandle
(
file
);
cfile
=
LZOpenFile
(
filename_
,
&
test
,
OF_READ
);
cfile
=
LZOpenFile
A
(
filename_
,
&
test
,
OF_READ
);
ok
(
cfile
>
0
,
"LZOpenFile failed
\n
"
);
ok
(
cfile
>
0
,
"LZOpenFile
A
failed
\n
"
);
ret
=
LZRead
(
cfile
,
buf
,
uncompressed_data_size
);
ret
=
LZRead
(
cfile
,
buf
,
uncompressed_data_size
);
ok
(
ret
==
uncompressed_data_size
,
"Read wrong number of bytes
\n
"
);
ok
(
ret
==
uncompressed_data_size
,
"Read wrong number of bytes
\n
"
);
...
@@ -171,11 +169,11 @@ static void test_lzread(void)
...
@@ -171,11 +169,11 @@ static void test_lzread(void)
LZClose
(
cfile
);
LZClose
(
cfile
);
ret
=
DeleteFile
(
filename_
);
ret
=
DeleteFile
A
(
filename_
);
ok
(
ret
,
"DeleteFile: error %ld
\n
"
,
GetLastError
());
ok
(
ret
,
"DeleteFile
A
: error %ld
\n
"
,
GetLastError
());
}
}
static
void
test_
lzc
opy
(
void
)
static
void
test_
LZC
opy
(
void
)
{
{
HANDLE
file
;
HANDLE
file
;
DWORD
ret
;
DWORD
ret
;
...
@@ -184,18 +182,18 @@ static void test_lzcopy(void)
...
@@ -184,18 +182,18 @@ static void test_lzcopy(void)
BOOL
retok
;
BOOL
retok
;
/* Create the compressed file. */
/* Create the compressed file. */
file
=
CreateFile
(
filename_
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_NEW
,
0
,
0
);
file
=
CreateFile
A
(
filename_
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_NEW
,
0
,
0
);
ok
(
file
!=
INVALID_HANDLE_VALUE
,
ok
(
file
!=
INVALID_HANDLE_VALUE
,
"CreateFile: error %ld
\n
"
,
GetLastError
());
"CreateFile
A
: error %ld
\n
"
,
GetLastError
());
retok
=
WriteFile
(
file
,
compressed_file
,
compressed_file_size
,
&
ret
,
0
);
retok
=
WriteFile
(
file
,
compressed_file
,
compressed_file_size
,
&
ret
,
0
);
ok
(
retok
,
"WriteFile error %ld
\n
"
,
GetLastError
());
ok
(
retok
,
"WriteFile error %ld
\n
"
,
GetLastError
());
ok
(
ret
==
compressed_file_size
,
"Wrote wrong number of bytes
\n
"
);
ok
(
ret
==
compressed_file_size
,
"Wrote wrong number of bytes
\n
"
);
CloseHandle
(
file
);
CloseHandle
(
file
);
source
=
LZOpenFile
(
filename_
,
&
stest
,
OF_READ
);
source
=
LZOpenFile
A
(
filename_
,
&
stest
,
OF_READ
);
ok
(
source
>=
0
,
"LZOpenFile failed on compressed file
\n
"
);
ok
(
source
>=
0
,
"LZOpenFile
A
failed on compressed file
\n
"
);
dest
=
LZOpenFile
(
filename2
,
&
dtest
,
OF_CREATE
);
dest
=
LZOpenFile
A
(
filename2
,
&
dtest
,
OF_CREATE
);
ok
(
dest
>=
0
,
"LZOpenFile failed on creating new file %d
\n
"
,
dest
);
ok
(
dest
>=
0
,
"LZOpenFile
A
failed on creating new file %d
\n
"
,
dest
);
ret
=
LZCopy
(
source
,
dest
);
ret
=
LZCopy
(
source
,
dest
);
ok
(
ret
>
0
,
"LZCopy error
\n
"
);
ok
(
ret
>
0
,
"LZCopy error
\n
"
);
...
@@ -203,10 +201,10 @@ static void test_lzcopy(void)
...
@@ -203,10 +201,10 @@ static void test_lzcopy(void)
LZClose
(
source
);
LZClose
(
source
);
LZClose
(
dest
);
LZClose
(
dest
);
file
=
CreateFile
(
filename2
,
GENERIC_READ
,
0
,
NULL
,
OPEN_EXISTING
,
file
=
CreateFile
A
(
filename2
,
GENERIC_READ
,
0
,
NULL
,
OPEN_EXISTING
,
0
,
0
);
0
,
0
);
ok
(
file
!=
INVALID_HANDLE_VALUE
,
ok
(
file
!=
INVALID_HANDLE_VALUE
,
"CreateFile: error %ld
\n
"
,
GetLastError
());
"CreateFile
A
: error %ld
\n
"
,
GetLastError
());
retok
=
ReadFile
(
file
,
buf
,
uncompressed_data_size
*
2
,
&
ret
,
0
);
retok
=
ReadFile
(
file
,
buf
,
uncompressed_data_size
*
2
,
&
ret
,
0
);
ok
(
retok
&&
ret
==
uncompressed_data_size
,
"ReadFile: error %ld
\n
"
,
GetLastError
());
ok
(
retok
&&
ret
==
uncompressed_data_size
,
"ReadFile: error %ld
\n
"
,
GetLastError
());
...
@@ -215,17 +213,17 @@ static void test_lzcopy(void)
...
@@ -215,17 +213,17 @@ static void test_lzcopy(void)
"buffer contents mismatch
\n
"
);
"buffer contents mismatch
\n
"
);
CloseHandle
(
file
);
CloseHandle
(
file
);
ret
=
DeleteFile
(
filename_
);
ret
=
DeleteFile
A
(
filename_
);
ok
(
ret
,
"DeleteFile: error %ld
\n
"
,
GetLastError
());
ok
(
ret
,
"DeleteFile
A
: error %ld
\n
"
,
GetLastError
());
ret
=
DeleteFile
(
filename2
);
ret
=
DeleteFile
A
(
filename2
);
ok
(
ret
,
"DeleteFile: error %ld
\n
"
,
GetLastError
());
ok
(
ret
,
"DeleteFile
A
: error %ld
\n
"
,
GetLastError
());
}
}
START_TEST
(
lzexpand_main
)
START_TEST
(
lzexpand_main
)
{
{
buf
=
malloc
(
uncompressed_data_size
*
2
);
buf
=
malloc
(
uncompressed_data_size
*
2
);
test_
lzopenfile
();
test_
LZOpenFileA
();
test_
lzr
ead
();
test_
LZR
ead
();
test_
lzc
opy
();
test_
LZC
opy
();
free
(
buf
);
free
(
buf
);
}
}
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