Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
078689ad
Commit
078689ad
authored
Jan 15, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Print the failure position in the message sequence.
parent
2d15dd54
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
36 deletions
+40
-36
msg.c
dlls/user32/tests/msg.c
+40
-36
No files found.
dlls/user32/tests/msg.c
View file @
078689ad
...
...
@@ -1836,6 +1836,7 @@ static void flush_sequence(void)
static
void
dump_sequence
(
const
struct
message
*
expected
,
const
char
*
context
,
const
char
*
file
,
int
line
)
{
const
struct
recvd_message
*
actual
=
sequence
;
unsigned
int
count
=
0
;
trace_
(
file
,
line
)(
"Failed sequence %s:
\n
"
,
context
);
while
(
expected
->
message
&&
actual
->
message
)
...
...
@@ -1844,18 +1845,18 @@ static void dump_sequence(const struct message *expected, const char *context, c
{
if
(
expected
->
flags
&
hook
)
{
trace_
(
file
,
line
)(
" expected: hook %04x - actual: %s
\n
"
,
expected
->
message
,
actual
->
output
);
trace_
(
file
,
line
)(
"
%u:
expected: hook %04x - actual: %s
\n
"
,
count
,
expected
->
message
,
actual
->
output
);
}
else
if
(
expected
->
flags
&
winevent_hook
)
{
trace_
(
file
,
line
)(
" expected: winevent %04x - actual: %s
\n
"
,
expected
->
message
,
actual
->
output
);
trace_
(
file
,
line
)(
"
%u:
expected: winevent %04x - actual: %s
\n
"
,
count
,
expected
->
message
,
actual
->
output
);
}
else
{
trace_
(
file
,
line
)(
" expected: msg %04x - actual: %s
\n
"
,
expected
->
message
,
actual
->
output
);
trace_
(
file
,
line
)(
"
%u:
expected: msg %04x - actual: %s
\n
"
,
count
,
expected
->
message
,
actual
->
output
);
}
}
...
...
@@ -1872,6 +1873,7 @@ static void dump_sequence(const struct message *expected, const char *context, c
expected
++
;
actual
++
;
}
count
++
;
}
/* optional trailing messages */
...
...
@@ -1893,6 +1895,7 @@ static void ok_sequence_(const struct message *expected_list, const char *contex
const
struct
message
*
expected
=
expected_list
;
const
struct
recvd_message
*
actual
;
int
failcount
=
0
,
dump
=
0
;
unsigned
int
count
=
0
;
add_message
(
&
end_of_sequence
);
...
...
@@ -1910,15 +1913,15 @@ static void ok_sequence_(const struct message *expected_list, const char *contex
failcount
++
;
if
(
strcmp
(
winetest_platform
,
"wine"
))
dump
++
;
ok_
(
file
,
line
)
(
FALSE
,
"%s: in msg 0x%04x expecting wParam 0x%lx got 0x%lx
\n
"
,
contex
t
,
expected
->
message
,
expected
->
wParam
,
actual
->
wParam
);
"%s:
%u:
in msg 0x%04x expecting wParam 0x%lx got 0x%lx
\n
"
,
context
,
coun
t
,
expected
->
message
,
expected
->
wParam
,
actual
->
wParam
);
}
}
else
{
ok_
(
file
,
line
)(
expected
->
wParam
==
actual
->
wParam
,
"%s: in msg 0x%04x expecting wParam 0x%lx got 0x%lx
\n
"
,
context
,
expected
->
message
,
expected
->
wParam
,
actual
->
wParam
);
"%s:
%u:
in msg 0x%04x expecting wParam 0x%lx got 0x%lx
\n
"
,
context
,
count
,
expected
->
message
,
expected
->
wParam
,
actual
->
wParam
);
if
(
expected
->
wParam
!=
actual
->
wParam
)
dump
++
;
}
...
...
@@ -1931,15 +1934,15 @@ static void ok_sequence_(const struct message *expected_list, const char *contex
failcount
++
;
if
(
strcmp
(
winetest_platform
,
"wine"
))
dump
++
;
ok_
(
file
,
line
)
(
FALSE
,
"%s: in msg 0x%04x expecting lParam 0x%lx got 0x%lx
\n
"
,
contex
t
,
expected
->
message
,
expected
->
lParam
,
actual
->
lParam
);
"%s:
%u:
in msg 0x%04x expecting lParam 0x%lx got 0x%lx
\n
"
,
context
,
coun
t
,
expected
->
message
,
expected
->
lParam
,
actual
->
lParam
);
}
}
else
{
ok_
(
file
,
line
)(
expected
->
lParam
==
actual
->
lParam
,
"%s: in msg 0x%04x expecting lParam 0x%lx got 0x%lx
\n
"
,
context
,
expected
->
message
,
expected
->
lParam
,
actual
->
lParam
);
"%s:
%u:
in msg 0x%04x expecting lParam 0x%lx got 0x%lx
\n
"
,
context
,
count
,
expected
->
message
,
expected
->
lParam
,
actual
->
lParam
);
if
(
expected
->
lParam
!=
actual
->
lParam
)
dump
++
;
}
}
...
...
@@ -1949,41 +1952,41 @@ static void ok_sequence_(const struct message *expected_list, const char *contex
failcount
++
;
if
(
strcmp
(
winetest_platform
,
"wine"
))
dump
++
;
ok_
(
file
,
line
)
(
FALSE
,
"%s: the msg 0x%04x should %shave been sent by DefWindowProc
\n
"
,
context
,
expected
->
message
,
(
expected
->
flags
&
defwinproc
)
?
""
:
"NOT "
);
"%s:
%u:
the msg 0x%04x should %shave been sent by DefWindowProc
\n
"
,
context
,
count
,
expected
->
message
,
(
expected
->
flags
&
defwinproc
)
?
""
:
"NOT "
);
}
}
else
{
ok_
(
file
,
line
)
((
expected
->
flags
&
defwinproc
)
==
(
actual
->
flags
&
defwinproc
),
"%s: the msg 0x%04x should %shave been sent by DefWindowProc
\n
"
,
contex
t
,
expected
->
message
,
(
expected
->
flags
&
defwinproc
)
?
""
:
"NOT "
);
"%s:
%u:
the msg 0x%04x should %shave been sent by DefWindowProc
\n
"
,
context
,
coun
t
,
expected
->
message
,
(
expected
->
flags
&
defwinproc
)
?
""
:
"NOT "
);
if
((
expected
->
flags
&
defwinproc
)
!=
(
actual
->
flags
&
defwinproc
))
dump
++
;
}
ok_
(
file
,
line
)
((
expected
->
flags
&
beginpaint
)
==
(
actual
->
flags
&
beginpaint
),
"%s: the msg 0x%04x should %shave been sent by BeginPaint
\n
"
,
contex
t
,
expected
->
message
,
(
expected
->
flags
&
beginpaint
)
?
""
:
"NOT "
);
"%s:
%u:
the msg 0x%04x should %shave been sent by BeginPaint
\n
"
,
context
,
coun
t
,
expected
->
message
,
(
expected
->
flags
&
beginpaint
)
?
""
:
"NOT "
);
if
((
expected
->
flags
&
beginpaint
)
!=
(
actual
->
flags
&
beginpaint
))
dump
++
;
ok_
(
file
,
line
)
((
expected
->
flags
&
(
sent
|
posted
))
==
(
actual
->
flags
&
(
sent
|
posted
)),
"%s: the msg 0x%04x should have been %s
\n
"
,
contex
t
,
expected
->
message
,
(
expected
->
flags
&
posted
)
?
"posted"
:
"sent"
);
"%s:
%u:
the msg 0x%04x should have been %s
\n
"
,
context
,
coun
t
,
expected
->
message
,
(
expected
->
flags
&
posted
)
?
"posted"
:
"sent"
);
if
((
expected
->
flags
&
(
sent
|
posted
))
!=
(
actual
->
flags
&
(
sent
|
posted
)))
dump
++
;
ok_
(
file
,
line
)
((
expected
->
flags
&
parent
)
==
(
actual
->
flags
&
parent
),
"%s: the msg 0x%04x was expected in %s
\n
"
,
contex
t
,
expected
->
message
,
(
expected
->
flags
&
parent
)
?
"parent"
:
"child"
);
"%s:
%u:
the msg 0x%04x was expected in %s
\n
"
,
context
,
coun
t
,
expected
->
message
,
(
expected
->
flags
&
parent
)
?
"parent"
:
"child"
);
if
((
expected
->
flags
&
parent
)
!=
(
actual
->
flags
&
parent
))
dump
++
;
ok_
(
file
,
line
)
((
expected
->
flags
&
hook
)
==
(
actual
->
flags
&
hook
),
"%s: the msg 0x%04x should have been sent by a hook
\n
"
,
contex
t
,
expected
->
message
);
"%s:
%u:
the msg 0x%04x should have been sent by a hook
\n
"
,
context
,
coun
t
,
expected
->
message
);
if
((
expected
->
flags
&
hook
)
!=
(
actual
->
flags
&
hook
))
dump
++
;
ok_
(
file
,
line
)
((
expected
->
flags
&
winevent_hook
)
==
(
actual
->
flags
&
winevent_hook
),
"%s: the msg 0x%04x should have been sent by a winevent hook
\n
"
,
contex
t
,
expected
->
message
);
"%s:
%u:
the msg 0x%04x should have been sent by a winevent hook
\n
"
,
context
,
coun
t
,
expected
->
message
);
if
((
expected
->
flags
&
winevent_hook
)
!=
(
actual
->
flags
&
winevent_hook
))
dump
++
;
expected
++
;
...
...
@@ -1997,19 +2000,20 @@ static void ok_sequence_(const struct message *expected_list, const char *contex
failcount
++
;
todo_wine
{
if
(
strcmp
(
winetest_platform
,
"wine"
))
dump
++
;
ok_
(
file
,
line
)
(
FALSE
,
"%s: the msg 0x%04x was expected, but got msg 0x%04x instead
\n
"
,
contex
t
,
expected
->
message
,
actual
->
message
);
ok_
(
file
,
line
)
(
FALSE
,
"%s:
%u:
the msg 0x%04x was expected, but got msg 0x%04x instead
\n
"
,
context
,
coun
t
,
expected
->
message
,
actual
->
message
);
}
goto
done
;
}
else
{
ok_
(
file
,
line
)
(
FALSE
,
"%s: the msg 0x%04x was expected, but got msg 0x%04x instead
\n
"
,
contex
t
,
expected
->
message
,
actual
->
message
);
ok_
(
file
,
line
)
(
FALSE
,
"%s:
%u:
the msg 0x%04x was expected, but got msg 0x%04x instead
\n
"
,
context
,
coun
t
,
expected
->
message
,
actual
->
message
);
dump
++
;
expected
++
;
actual
++
;
}
count
++
;
}
/* skip all optional trailing messages */
...
...
@@ -2023,8 +2027,8 @@ static void ok_sequence_(const struct message *expected_list, const char *contex
if
(
expected
->
message
||
actual
->
message
)
{
failcount
++
;
if
(
strcmp
(
winetest_platform
,
"wine"
))
dump
++
;
ok_
(
file
,
line
)
(
FALSE
,
"%s: the msg sequence is not complete: expected %04x - actual %04x
\n
"
,
contex
t
,
expected
->
message
,
actual
->
message
);
ok_
(
file
,
line
)
(
FALSE
,
"%s:
%u:
the msg sequence is not complete: expected %04x - actual %04x
\n
"
,
context
,
coun
t
,
expected
->
message
,
actual
->
message
);
}
}
}
...
...
@@ -2033,8 +2037,8 @@ static void ok_sequence_(const struct message *expected_list, const char *contex
if
(
expected
->
message
||
actual
->
message
)
{
dump
++
;
ok_
(
file
,
line
)
(
FALSE
,
"%s: the msg sequence is not complete: expected %04x - actual %04x
\n
"
,
contex
t
,
expected
->
message
,
actual
->
message
);
ok_
(
file
,
line
)
(
FALSE
,
"%s:
%u:
the msg sequence is not complete: expected %04x - actual %04x
\n
"
,
context
,
coun
t
,
expected
->
message
,
actual
->
message
);
}
}
if
(
todo
&&
!
failcount
)
/* succeeded yet marked todo */
...
...
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