Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Akihiro Sagawa
wine
Commits
10350c19
Commit
10350c19
authored
15 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
user32/tests: Print a more useful line number in check_class and check_instance tests.
parent
0caa310c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/user32/tests/class.c
+23
-17
23 additions, 17 deletions
dlls/user32/tests/class.c
with
23 additions
and
17 deletions
dlls/user32/tests/class.c
+
23
−
17
View file @
10350c19
...
...
@@ -234,42 +234,48 @@ static void test_styles(void)
check_style
(
"#32772"
,
1
,
0
,
0
);
/* icon title */
}
static
void
check_class
(
HINSTANCE
inst
,
const
char
*
name
,
const
char
*
menu_name
)
static
void
check_class
_
(
int
line
,
HINSTANCE
inst
,
const
char
*
name
,
const
char
*
menu_name
)
{
WNDCLASS
wc
;
UINT
atom
=
GetClassInfo
(
inst
,
name
,
&
wc
);
ok
(
atom
,
"Class %s %p not found
\n
"
,
name
,
inst
);
ok
_
(
__FILE__
,
line
)
(
atom
,
"Class %s %p not found
\n
"
,
name
,
inst
);
if
(
atom
)
{
if
(
wc
.
lpszMenuName
&&
menu_name
)
ok
(
!
strcmp
(
menu_name
,
wc
.
lpszMenuName
),
"Wrong name %s/%s for class %s %p
\n
"
,
wc
.
lpszMenuName
,
menu_name
,
name
,
inst
);
ok_
(
__FILE__
,
line
)(
!
strcmp
(
menu_name
,
wc
.
lpszMenuName
),
"Wrong name %s/%s for class %s %p
\n
"
,
wc
.
lpszMenuName
,
menu_name
,
name
,
inst
);
else
ok
(
!
menu_name
==
!
wc
.
lpszMenuName
,
"Wrong name %p/%p for class %s %p
\n
"
,
wc
.
lpszMenuName
,
menu_name
,
name
,
inst
);
ok
_
(
__FILE__
,
line
)
(
!
menu_name
==
!
wc
.
lpszMenuName
,
"Wrong name %p/%p for class %s %p
\n
"
,
wc
.
lpszMenuName
,
menu_name
,
name
,
inst
);
}
}
#define check_class(inst,name,menu) check_class_(__LINE__,inst,name,menu)
static
void
check_instance
(
const
char
*
name
,
HINSTANCE
inst
,
HINSTANCE
info_inst
,
HINSTANCE
gcl_inst
)
static
void
check_instance_
(
int
line
,
const
char
*
name
,
HINSTANCE
inst
,
HINSTANCE
info_inst
,
HINSTANCE
gcl_inst
)
{
WNDCLASSA
wc
;
HWND
hwnd
;
ok
(
GetClassInfo
(
inst
,
name
,
&
wc
),
"Couldn't find class %s inst %p
\n
"
,
name
,
inst
);
ok
(
wc
.
hInstance
==
info_inst
,
"Wrong info instance %p/%p for class %s
\n
"
,
wc
.
hInstance
,
info_inst
,
name
);
ok
_
(
__FILE__
,
line
)
(
GetClassInfo
(
inst
,
name
,
&
wc
),
"Couldn't find class %s inst %p
\n
"
,
name
,
inst
);
ok
_
(
__FILE__
,
line
)
(
wc
.
hInstance
==
info_inst
,
"Wrong info instance %p/%p for class %s
\n
"
,
wc
.
hInstance
,
info_inst
,
name
);
hwnd
=
CreateWindowExA
(
0
,
name
,
"test_window"
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
inst
,
0
);
ok
(
hwnd
!=
NULL
,
"Couldn't create window for class %s inst %p
\n
"
,
name
,
inst
);
ok
(
(
HINSTANCE
)
GetClassLongPtrA
(
hwnd
,
GCLP_HMODULE
)
==
gcl_inst
,
"Wrong GCL instance %p/%p for class %s
\n
"
,
ok
_
(
__FILE__
,
line
)
(
hwnd
!=
NULL
,
"Couldn't create window for class %s inst %p
\n
"
,
name
,
inst
);
ok
_
(
__FILE__
,
line
)
(
(
HINSTANCE
)
GetClassLongPtrA
(
hwnd
,
GCLP_HMODULE
)
==
gcl_inst
,
"Wrong GCL instance %p/%p for class %s
\n
"
,
(
HINSTANCE
)
GetClassLongPtrA
(
hwnd
,
GCLP_HMODULE
),
gcl_inst
,
name
);
ok
(
(
HINSTANCE
)
GetWindowLongPtrA
(
hwnd
,
GWLP_HINSTANCE
)
==
inst
,
"Wrong GWL instance %p/%p for window %s
\n
"
,
ok
_
(
__FILE__
,
line
)
(
(
HINSTANCE
)
GetWindowLongPtrA
(
hwnd
,
GWLP_HINSTANCE
)
==
inst
,
"Wrong GWL instance %p/%p for window %s
\n
"
,
(
HINSTANCE
)
GetWindowLongPtrA
(
hwnd
,
GWLP_HINSTANCE
),
inst
,
name
);
ok
(
!
UnregisterClassA
(
name
,
inst
),
"UnregisterClassA should fail while exists a class window
\n
"
);
ok
(
GetLastError
()
==
ERROR_CLASS_HAS_WINDOWS
,
"GetLastError() should be set to ERROR_CLASS_HAS_WINDOWS not %d
\n
"
,
GetLastError
());
ok_
(
__FILE__
,
line
)(
!
UnregisterClassA
(
name
,
inst
),
"UnregisterClassA should fail while exists a class window
\n
"
);
ok_
(
__FILE__
,
line
)(
GetLastError
()
==
ERROR_CLASS_HAS_WINDOWS
,
"GetLastError() should be set to ERROR_CLASS_HAS_WINDOWS not %d
\n
"
,
GetLastError
());
DestroyWindow
(
hwnd
);
}
#define check_instance(name,inst,info_inst,gcl_inst) check_instance_(__LINE__,name,inst,info_inst,gcl_inst)
struct
class_info
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment