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
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
56 deletions
+54
-56
lzexpand_main.c
dlls/lz32/tests/lzexpand_main.c
+54
-56
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;
static
char
*
buf
;
static
void
test_
lzopenfile
(
void
)
static
void
test_
LZOpenFileA
(
void
)
{
OFSTRUCT
test
;
DWORD
retval
;
...
...
@@ -60,41 +60,40 @@ static void test_lzopenfile(void)
char
expected
[
MAX_PATH
];
char
filled_0xA5
[
OFS_MAXPATHNAME
];
/* Check for nonexistent file. */
file
=
LZOpenFile
(
"badfilename_"
,
&
test
,
OF_READ
);
file
=
LZOpenFile
A
(
"badfilename_"
,
&
test
,
OF_READ
);
ok
(
file
==
LZERROR_BADINHANDLE
,
"LZOpenFile succeeded on nonexistent file
\n
"
);
"LZOpenFile
A
succeeded on nonexistent file
\n
"
);
LZClose
(
file
);
/* Create an empty file. */
file
=
LZOpenFile
(
filename_
,
&
test
,
OF_CREATE
);
ok
(
file
>=
0
,
"LZOpenFile failed on creation
\n
"
);
file
=
LZOpenFile
A
(
filename_
,
&
test
,
OF_CREATE
);
ok
(
file
>=
0
,
"LZOpenFile
A
failed on creation
\n
"
);
LZClose
(
file
);
retval
=
GetFileAttributes
(
filename_
);
ok
(
retval
!=
INVALID_FILE_ATTRIBUTES
,
"GetFileAttributes: error %ld
\n
"
,
retval
=
GetFileAttributes
A
(
filename_
);
ok
(
retval
!=
INVALID_FILE_ATTRIBUTES
,
"GetFileAttributes
A
: error %ld
\n
"
,
GetLastError
());
/* Check various opening options. */
file
=
LZOpenFile
(
filename_
,
&
test
,
OF_READ
);
ok
(
file
>=
0
,
"LZOpenFile failed on read
\n
"
);
file
=
LZOpenFile
A
(
filename_
,
&
test
,
OF_READ
);
ok
(
file
>=
0
,
"LZOpenFile
A
failed on read
\n
"
);
LZClose
(
file
);
file
=
LZOpenFile
(
filename_
,
&
test
,
OF_WRITE
);
ok
(
file
>=
0
,
"LZOpenFile failed on write
\n
"
);
file
=
LZOpenFile
A
(
filename_
,
&
test
,
OF_WRITE
);
ok
(
file
>=
0
,
"LZOpenFile
A
failed on write
\n
"
);
LZClose
(
file
);
file
=
LZOpenFile
(
filename_
,
&
test
,
OF_READWRITE
);
ok
(
file
>=
0
,
"LZOpenFile failed on read/write
\n
"
);
file
=
LZOpenFile
A
(
filename_
,
&
test
,
OF_READWRITE
);
ok
(
file
>=
0
,
"LZOpenFile
A
failed on read/write
\n
"
);
LZClose
(
file
);
file
=
LZOpenFile
(
filename_
,
&
test
,
OF_EXIST
);
ok
(
file
>=
0
,
"LZOpenFile failed on read/write
\n
"
);
file
=
LZOpenFile
A
(
filename_
,
&
test
,
OF_EXIST
);
ok
(
file
>=
0
,
"LZOpenFile
A
failed on read/write
\n
"
);
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
operating systems. Doesn't seem to on my copy of Win98.
*/
retval
=
GetCurrentDirectory
(
MAX_PATH
,
expected
);
ok
(
retval
>
0
,
"GetCurrentDirectory returned %ld, GLE=0x%lx
\n
"
,
retval
=
GetCurrentDirectory
A
(
MAX_PATH
,
expected
);
ok
(
retval
>
0
,
"GetCurrentDirectory
A
returned %ld, GLE=0x%lx
\n
"
,
retval
,
GetLastError
());
lstrcatA
(
expected
,
"
\\
"
);
lstrcatA
(
expected
,
filename
);
...
...
@@ -106,38 +105,37 @@ static void test_lzopenfile(void)
SetLastError
(
0xfaceabee
);
/* Try to open compressed file. */
file
=
LZOpenFile
(
filename
,
&
test
,
OF_EXIST
);
if
(
file
!=
LZERROR_BADINHANDLE
)
{
/* NT */
file
=
LZOpenFile
A
(
filename
,
&
test
,
OF_EXIST
);
if
(
file
!=
LZERROR_BADINHANDLE
)
{
ok
(
test
.
cBytes
==
sizeof
(
OFSTRUCT
),
"LZOpenFile set test.cBytes to %d
\n
"
,
test
.
cBytes
);
ok
(
test
.
nErrCode
==
0
,
"LZOpenFile set test.nErrCode to %d
\n
"
,
test
.
nErrCode
);
"LZOpenFile
A
set test.cBytes to %d
\n
"
,
test
.
cBytes
);
ok
(
test
.
nErrCode
==
0
,
"LZOpenFileA set test.nErrCode to %d
\n
"
,
test
.
nErrCode
);
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
);
LZClose
(
file
);
}
else
{
/* 9x */
}
else
{
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
,
"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
,
"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
);
}
/* Delete the file then make sure it doesn't exist anymore. */
file
=
LZOpenFile
(
filename_
,
&
test
,
OF_DELETE
);
ok
(
file
>=
0
,
"LZOpenFile failed on delete
\n
"
);
file
=
LZOpenFile
A
(
filename_
,
&
test
,
OF_DELETE
);
ok
(
file
>=
0
,
"LZOpenFile
A
failed on delete
\n
"
);
LZClose
(
file
);
retval
=
GetFileAttributes
(
filename_
);
retval
=
GetFileAttributes
A
(
filename_
);
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
;
DWORD
ret
;
...
...
@@ -146,15 +144,15 @@ static void test_lzread(void)
BOOL
retok
;
/* 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
"
);
retok
=
WriteFile
(
file
,
compressed_file
,
compressed_file_size
,
&
ret
,
0
);
ok
(
retok
,
"WriteFile: error %ld
\n
"
,
GetLastError
());
ok
(
ret
==
compressed_file_size
,
"Wrote wrong number of bytes with WriteFile?
\n
"
);
CloseHandle
(
file
);
cfile
=
LZOpenFile
(
filename_
,
&
test
,
OF_READ
);
ok
(
cfile
>
0
,
"LZOpenFile failed
\n
"
);
cfile
=
LZOpenFile
A
(
filename_
,
&
test
,
OF_READ
);
ok
(
cfile
>
0
,
"LZOpenFile
A
failed
\n
"
);
ret
=
LZRead
(
cfile
,
buf
,
uncompressed_data_size
);
ok
(
ret
==
uncompressed_data_size
,
"Read wrong number of bytes
\n
"
);
...
...
@@ -171,11 +169,11 @@ static void test_lzread(void)
LZClose
(
cfile
);
ret
=
DeleteFile
(
filename_
);
ok
(
ret
,
"DeleteFile: error %ld
\n
"
,
GetLastError
());
ret
=
DeleteFile
A
(
filename_
);
ok
(
ret
,
"DeleteFile
A
: error %ld
\n
"
,
GetLastError
());
}
static
void
test_
lzc
opy
(
void
)
static
void
test_
LZC
opy
(
void
)
{
HANDLE
file
;
DWORD
ret
;
...
...
@@ -184,18 +182,18 @@ static void test_lzcopy(void)
BOOL
retok
;
/* 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
,
"CreateFile: error %ld
\n
"
,
GetLastError
());
"CreateFile
A
: error %ld
\n
"
,
GetLastError
());
retok
=
WriteFile
(
file
,
compressed_file
,
compressed_file_size
,
&
ret
,
0
);
ok
(
retok
,
"WriteFile error %ld
\n
"
,
GetLastError
());
ok
(
ret
==
compressed_file_size
,
"Wrote wrong number of bytes
\n
"
);
CloseHandle
(
file
);
source
=
LZOpenFile
(
filename_
,
&
stest
,
OF_READ
);
ok
(
source
>=
0
,
"LZOpenFile failed on compressed file
\n
"
);
dest
=
LZOpenFile
(
filename2
,
&
dtest
,
OF_CREATE
);
ok
(
dest
>=
0
,
"LZOpenFile failed on creating new file %d
\n
"
,
dest
);
source
=
LZOpenFile
A
(
filename_
,
&
stest
,
OF_READ
);
ok
(
source
>=
0
,
"LZOpenFile
A
failed on compressed file
\n
"
);
dest
=
LZOpenFile
A
(
filename2
,
&
dtest
,
OF_CREATE
);
ok
(
dest
>=
0
,
"LZOpenFile
A
failed on creating new file %d
\n
"
,
dest
);
ret
=
LZCopy
(
source
,
dest
);
ok
(
ret
>
0
,
"LZCopy error
\n
"
);
...
...
@@ -203,10 +201,10 @@ static void test_lzcopy(void)
LZClose
(
source
);
LZClose
(
dest
);
file
=
CreateFile
(
filename2
,
GENERIC_READ
,
0
,
NULL
,
OPEN_EXISTING
,
file
=
CreateFile
A
(
filename2
,
GENERIC_READ
,
0
,
NULL
,
OPEN_EXISTING
,
0
,
0
);
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
);
ok
(
retok
&&
ret
==
uncompressed_data_size
,
"ReadFile: error %ld
\n
"
,
GetLastError
());
...
...
@@ -215,17 +213,17 @@ static void test_lzcopy(void)
"buffer contents mismatch
\n
"
);
CloseHandle
(
file
);
ret
=
DeleteFile
(
filename_
);
ok
(
ret
,
"DeleteFile: error %ld
\n
"
,
GetLastError
());
ret
=
DeleteFile
(
filename2
);
ok
(
ret
,
"DeleteFile: error %ld
\n
"
,
GetLastError
());
ret
=
DeleteFile
A
(
filename_
);
ok
(
ret
,
"DeleteFile
A
: error %ld
\n
"
,
GetLastError
());
ret
=
DeleteFile
A
(
filename2
);
ok
(
ret
,
"DeleteFile
A
: error %ld
\n
"
,
GetLastError
());
}
START_TEST
(
lzexpand_main
)
{
buf
=
malloc
(
uncompressed_data_size
*
2
);
test_
lzopenfile
();
test_
lzr
ead
();
test_
lzc
opy
();
test_
LZOpenFileA
();
test_
LZR
ead
();
test_
LZC
opy
();
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