Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
c1742366
Commit
c1742366
authored
Jan 14, 2002
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integrated test script for winetest into the make test
infrastructure. Added a few tests for the new wine.pm functions.
parent
9384184a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
22 deletions
+44
-22
.cvsignore
programs/winetest/.cvsignore
+0
-1
Makefile.in
programs/winetest/Makefile.in
+4
-0
.cvsignore
programs/winetest/tests/.cvsignore
+1
-0
wine.pl
programs/winetest/tests/wine.pl
+39
-21
No files found.
programs/winetest/.cvsignore
View file @
c1742366
Makefile
Makefile
Makefile.perl
wine.c
wine.c
winetest.spec.c
winetest.spec.c
programs/winetest/Makefile.in
View file @
c1742366
...
@@ -12,6 +12,10 @@ C_SRCS = winetest.c
...
@@ -12,6 +12,10 @@ C_SRCS = winetest.c
EXTRA_OBJS
=
wine.o
EXTRA_OBJS
=
wine.o
EXTRASUBDIRS
=
include tests
PLTESTS
=
\
tests/wine.pl
@MAKE_PROG_RULES@
@MAKE_PROG_RULES@
...
...
programs/winetest/tests/.cvsignore
0 → 100644
View file @
c1742366
wine.ok
programs/winetest/test.pl
→
programs/winetest/test
s/wine
.pl
View file @
c1742366
#
#
###############################################################
# Test
script for the winetest program
# Test
s for wine.pm module functions
#
#
use
wine
;
use
wine
;
$
wine::
debug
=
0
;
################################################################
################################################################
# Declarations for functions we use in this script
# Declarations for functions we use in this script
...
@@ -26,47 +24,67 @@ wine::declare( "kernel32",
...
@@ -26,47 +24,67 @@ wine::declare( "kernel32",
# Test string arguments
# Test string arguments
$atom
=
GlobalAddAtomA
(
"foo"
);
$atom
=
GlobalAddAtomA
(
"foo"
);
assert
(
$atom
>=
0xc000
&&
$atom
<=
0xffff
);
ok
(
$atom
>=
0xc000
&&
$atom
<=
0xffff
);
assert
(
!
defined
(
$
wine::
err
)
);
ok
(
!
defined
(
$
wine::
err
)
);
# Test integer and string reference arguments
# Test integer and string reference arguments
$buffer
=
"xxxxxx"
;
$buffer
=
"xxxxxx"
;
$ret
=
GlobalGetAtomNameA
(
$atom
,
\
$buffer
,
length
(
buffer
)
);
$ret
=
GlobalGetAtomNameA
(
$atom
,
\
$buffer
,
length
(
buffer
)
);
assert
(
!
defined
(
$
wine::
err
)
);
ok
(
!
defined
(
$
wine::
err
)
);
assert
(
$ret
==
3
);
ok
(
$ret
==
3
);
assert
(
lc
$buffer
eq
"foo\000xx"
);
ok
(
lc
$buffer
eq
"foo\000xx"
);
# Test integer reference
# Test integer reference
$code
=
0
;
$code
=
0
;
$ret
=
GetExitCodeThread
(
GetCurrentThread
(),
\
$code
);
$ret
=
GetExitCodeThread
(
GetCurrentThread
(),
\
$code
);
assert
(
!
defined
(
$
wine::
err
)
);
ok
(
!
defined
(
$
wine::
err
)
);
assert
(
$ret
);
ok
(
$ret
);
assert
(
$code
==
0x103
);
ok
(
$code
==
0x103
);
# Test string return value
# Test string return value
$str
=
lstrcatA
(
"foo\0foo"
,
"bar"
);
$str
=
lstrcatA
(
"foo\0foo"
,
"bar"
);
assert
(
!
defined
(
$
wine::
err
)
);
ok
(
!
defined
(
$
wine::
err
)
);
assert
(
$str
eq
"foobar"
);
ok
(
$str
eq
"foobar"
);
################################################################
################################################################
# Test last error handling
# Test last error handling
SetLastError
(
123
);
SetLastError
(
123
);
$ret
=
GetLastError
();
$ret
=
GetLastError
();
assert
(
$ret
==
123
);
ok
(
$ret
==
123
);
################################################################
################################################################
# Test various error cases
# Test various error cases
eval
{
SetLastError
(
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
);
};
eval
{
SetLastError
(
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
);
};
assert
(
$@
=~
/Too many arguments at/
);
ok
(
$@
=~
/Too many arguments at/
);
my
$funcptr
=
GetProcAddress
(
GetModuleHandleA
(
"kernel32"
),
"SetLastError"
);
my
$funcptr
=
GetProcAddress
(
GetModuleHandleA
(
"kernel32"
),
"SetLastError"
);
assert
(
$funcptr
);
ok
(
$funcptr
);
eval
{
wine::
call_wine_API
(
$funcptr
,
10
,
$
wine::
debug
,
0
);
};
eval
{
wine::
call_wine_API
(
$funcptr
,
10
,
$
wine::
debug
-
1
,
0
);
};
assert
(
$@
=~
/Bad return type 10 at/
);
ok
(
$@
=~
/Bad return type 10 at/
);
eval
{
foobar
(
1
,
2
,
3
);
};
eval
{
foobar
(
1
,
2
,
3
);
};
assert
(
$@
=~
/Function 'foobar' not declared at/
);
ok
(
$@
=~
/Function 'foobar' not declared at/
);
################################################################
# Test assert
assert
(
1
,
"cannot fail"
);
eval
{
assert
(
0
,
"this must fail"
);
};
ok
(
$@
=~
/Assertion failed/
);
ok
(
$@
=~
/this must fail/
);
################################################################
# Test todo blocks
todo_wine
{
ok
(
$
wine::
platform
ne
"wine"
,
"Must fail only on Wine"
);
};
print
"OK\n"
;
todo
(
$
wine::
platform
,
sub
{
ok
(
0
,
"Failure must be ignored inside todo"
);
}
);
todo
(
$
wine::
platform
.
"xxx"
,
sub
{
ok
(
1
,
"Success must not cause error inside todo for other platform"
);
}
);
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