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
2b1c4ba1
Commit
2b1c4ba1
authored
Aug 04, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Fix some test failures on win9x.
parent
13645a7b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
18 deletions
+36
-18
resource.c
dlls/user32/tests/resource.c
+5
-2
static.c
dlls/user32/tests/static.c
+7
-3
text.c
dlls/user32/tests/text.c
+24
-13
No files found.
dlls/user32/tests/resource.c
View file @
2b1c4ba1
...
...
@@ -42,9 +42,12 @@ static void test_LoadStringW(void)
the string at the pointer returned by LoadStringW when called with buflen = 0 */
SetLastError
(
0xdeadbeef
);
length1
=
LoadStringW
(
hInst
,
2
,
(
WCHAR
*
)
&
resourcepointer
,
0
);
/* get pointer to resource. */
if
(
!
length1
&&
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
)
if
(
!
length1
)
{
win_skip
(
"LoadStringW not implemented
\n
"
);
if
(
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
)
win_skip
(
"LoadStringW not implemented
\n
"
);
else
win_skip
(
"LoadStringW does not return a pointer to the resource
\n
"
);
return
;
}
length2
=
LoadStringW
(
hInst
,
2
,
returnedstringw
,
sizeof
(
returnedstringw
)
/
sizeof
(
WCHAR
));
/* get resource string */
...
...
dlls/user32/tests/static.c
View file @
2b1c4ba1
...
...
@@ -33,12 +33,12 @@
static
HWND
hMainWnd
;
#define expect_eq(expr, value, type, fmt) { type val = expr; ok(val == (value), #expr " expected "
#fmt " got " #
fmt "\n", (value), val); }
#define expect_eq(expr, value, type, fmt) { type val = expr; ok(val == (value), #expr " expected "
fmt " got "
fmt "\n", (value), val); }
#define expect_rect(r, _left, _top, _right, _bottom) ok(r.left == _left && r.top == _top && \
r.bottom == _bottom && r.right == _right, "Invalid rect (%d,%d) (%d,%d) vs (%d,%d) (%d,%d)\n", \
r.left, r.top, r.right, r.bottom, _left, _top, _right, _bottom);
int
g_nReceivedColorStatic
=
0
;
static
int
g_nReceivedColorStatic
=
0
;
static
HWND
build_static
(
DWORD
style
)
{
...
...
@@ -63,7 +63,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpara
return
DefWindowProc
(
hwnd
,
msg
,
wparam
,
lparam
);
}
void
test_updates
(
int
style
,
int
flags
)
static
void
test_updates
(
int
style
,
int
flags
)
{
RECT
r1
=
{
20
,
20
,
30
,
30
};
HWND
hStatic
=
build_static
(
style
);
...
...
@@ -89,6 +89,10 @@ void test_updates(int style, int flags)
if
(
flags
&
TODO_COUNT
)
todo_wine
{
expect_eq
(
g_nReceivedColorStatic
,
exp
,
int
,
"%d"
);
}
else
if
(
style
==
SS_ICON
||
style
==
SS_BITMAP
)
ok
(
g_nReceivedColorStatic
==
exp
||
broken
(
g_nReceivedColorStatic
==
0
),
/* win9x */
"expected %u got %u
\n
"
,
exp
,
g_nReceivedColorStatic
);
else
expect_eq
(
g_nReceivedColorStatic
,
exp
,
int
,
"%d"
);
DestroyWindow
(
hStatic
);
...
...
dlls/user32/tests/text.c
View file @
2b1c4ba1
...
...
@@ -110,21 +110,21 @@ static void test_DrawTextCalcRect(void)
SetRect
(
&
rect
,
10
,
10
,
100
,
100
);
textheight
=
DrawTextExA
(
hdc
,
text
,
0
,
&
rect
,
DT_CALCRECT
,
NULL
);
ok
(
!
(
rect
.
left
==
rect
.
right
&&
rect
.
bottom
==
rect
.
top
),
"rectangle should NOT be empty.
\n
"
);
"rectangle should NOT be empty got %d,%d-%d,%d
\n
"
,
rect
.
left
,
rect
.
top
,
rect
.
right
,
rect
.
bottom
);
SetRect
(
&
rect
,
10
,
10
,
100
,
100
);
SetLastError
(
0
);
textheight
=
DrawTextExA
(
hdc
,
emptystring
,
-
1
,
&
rect
,
DT_CALCRECT
,
NULL
);
ok
(
(
rect
.
left
==
rect
.
right
&&
rect
.
bottom
==
rect
.
top
),
"rectangle should be empty.
\n
"
);
"rectangle should be empty got %d,%d-%d,%d
\n
"
,
rect
.
left
,
rect
.
top
,
rect
.
right
,
rect
.
bottom
);
SetRect
(
&
rect
,
10
,
10
,
100
,
100
);
SetLastError
(
0
);
textheight
=
DrawTextExA
(
hdc
,
NULL
,
-
1
,
&
rect
,
DT_CALCRECT
,
NULL
);
ok
(
(
rect
.
left
==
rect
.
right
&&
rect
.
bottom
==
rect
.
top
),
"rectangle should be empty.
\n
"
);
"rectangle should be empty got %d,%d-%d,%d
\n
"
,
rect
.
left
,
rect
.
top
,
rect
.
right
,
rect
.
bottom
);
SetRect
(
&
rect
,
10
,
10
,
100
,
100
);
textheight
=
DrawTextExA
(
hdc
,
NULL
,
0
,
&
rect
,
DT_CALCRECT
,
NULL
);
ok
(
!
(
rect
.
left
==
rect
.
right
&&
rect
.
bottom
==
rect
.
top
),
"rectangle should NOT be empty.
\n
"
);
"rectangle should NOT be empty got %d,%d-%d,%d
\n
"
,
rect
.
left
,
rect
.
top
,
rect
.
right
,
rect
.
bottom
);
/* Wide char versions */
SetRect
(
&
rect
,
10
,
10
,
100
,
100
);
...
...
@@ -132,19 +132,23 @@ static void test_DrawTextCalcRect(void)
textheight
=
DrawTextExW
(
hdc
,
textW
,
0
,
&
rect
,
DT_CALCRECT
,
NULL
);
if
(
GetLastError
()
!=
ERROR_CALL_NOT_IMPLEMENTED
)
{
ok
(
!
(
rect
.
left
==
rect
.
right
&&
rect
.
bottom
==
rect
.
top
),
"rectangle should NOT be empty.
\n
"
);
"rectangle should NOT be empty got %d,%d-%d,%d
\n
"
,
rect
.
left
,
rect
.
top
,
rect
.
right
,
rect
.
bottom
);
SetRect
(
&
rect
,
10
,
10
,
100
,
100
);
textheight
=
DrawTextExW
(
hdc
,
emptystringW
,
-
1
,
&
rect
,
DT_CALCRECT
,
NULL
);
ok
(
(
rect
.
left
==
rect
.
right
&&
rect
.
bottom
==
rect
.
top
),
"rectangle should be empty.
\n
"
);
"rectangle should be empty got %d,%d-%d,%d
\n
"
,
rect
.
left
,
rect
.
top
,
rect
.
right
,
rect
.
bottom
);
SetRect
(
&
rect
,
10
,
10
,
100
,
100
);
textheight
=
DrawTextExW
(
hdc
,
NULL
,
-
1
,
&
rect
,
DT_CALCRECT
,
NULL
);
ok
(
!
(
rect
.
left
==
rect
.
right
&&
rect
.
bottom
==
rect
.
top
),
"rectangle should NOT be empty.
\n
"
);
"rectangle should NOT be empty got %d,%d-%d,%d
\n
"
,
rect
.
left
,
rect
.
top
,
rect
.
right
,
rect
.
bottom
);
SetRect
(
&
rect
,
10
,
10
,
100
,
100
);
textheight
=
DrawTextExW
(
hdc
,
NULL
,
0
,
&
rect
,
DT_CALCRECT
,
NULL
);
ok
(
!
(
rect
.
left
==
rect
.
right
&&
rect
.
bottom
==
rect
.
top
),
"rectangle should NOT be empty.
\n
"
);
"rectangle should NOT be empty got %d,%d-%d,%d
\n
"
,
rect
.
left
,
rect
.
top
,
rect
.
right
,
rect
.
bottom
);
}
/* More test cases from bug 12226 */
...
...
@@ -158,11 +162,18 @@ static void test_DrawTextCalcRect(void)
SetRect
(
&
rect
,
0
,
0
,
0
,
0
);
textheight
=
DrawTextW
(
hdc
,
emptystringW
,
-
1
,
&
rect
,
DT_CALCRECT
|
DT_LEFT
|
DT_SINGLELINE
);
todo_wine
ok
(
textheight
,
"DrawTextW error %u
\n
"
,
GetLastError
());
ok
(
0
==
rect
.
left
,
"expected 0, got %d
\n
"
,
rect
.
left
);
ok
(
0
==
rect
.
right
,
"expected 0, got %d
\n
"
,
rect
.
right
);
ok
(
0
==
rect
.
top
,
"expected 0, got %d
\n
"
,
rect
.
top
);
todo_wine
ok
(
rect
.
bottom
,
"rect.bottom should not be 0
\n
"
);
if
(
!
textheight
&&
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
)
{
win_skip
(
"DrawTextW not implemented
\n
"
);
}
else
{
todo_wine
ok
(
textheight
,
"DrawTextW error %u
\n
"
,
GetLastError
());
ok
(
0
==
rect
.
left
,
"expected 0, got %d
\n
"
,
rect
.
left
);
ok
(
0
==
rect
.
right
,
"expected 0, got %d
\n
"
,
rect
.
right
);
ok
(
0
==
rect
.
top
,
"expected 0, got %d
\n
"
,
rect
.
top
);
todo_wine
ok
(
rect
.
bottom
,
"rect.bottom should not be 0
\n
"
);
}
SelectObject
(
hdc
,
hOldFont
);
ret
=
DeleteObject
(
hFont
);
...
...
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