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
02c3bb76
Commit
02c3bb76
authored
Jun 29, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Jun 30, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Clean up and fix a few failing tests in win9x.
parent
10a1b948
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
19 deletions
+63
-19
misc.c
dlls/comctl32/tests/misc.c
+63
-19
No files found.
dlls/comctl32/tests/misc.c
View file @
02c3bb76
...
...
@@ -42,8 +42,6 @@ static HMODULE hComctl32 = 0;
FreeLibrary(hComctl32); \
}
#define expect(expected, got) ok(expected == got, "expected %d, got %d\n", expected,got)
static
BOOL
InitFunctionPtrs
(
void
)
{
hComctl32
=
LoadLibraryA
(
"comctl32.dll"
);
...
...
@@ -96,21 +94,29 @@ static void test_GetPtrAW(void)
count
=
0
;
count
=
pStr_GetPtrA
(
source
,
NULL
,
0
);
ok
(
count
==
sourcelen
,
"Expected count to be %d, it was %d
\n
"
,
sourcelen
,
count
);
ok
(
count
==
sourcelen
||
broken
(
count
==
sourcelen
-
1
),
/* win9x */
"Expected count to be %d, it was %d
\n
"
,
sourcelen
,
count
);
count
=
0
;
strcpy
(
dest
,
desttest
);
count
=
pStr_GetPtrA
(
source
,
dest
,
0
);
ok
(
count
==
sourcelen
,
"Expected count to be %d, it was %d
\n
"
,
sourcelen
,
count
);
ok
(
count
==
sourcelen
||
broken
(
count
==
0
),
/* win9x */
"Expected count to be %d, it was %d
\n
"
,
sourcelen
,
count
);
ok
(
!
lstrcmp
(
dest
,
desttest
),
"Expected destination to not have changed
\n
"
);
count
=
0
;
count
=
pStr_GetPtrA
(
source
,
NULL
,
destsize
);
ok
(
count
==
sourcelen
,
"Expected count to be %d, it was %d
\n
"
,
sourcelen
,
count
);
ok
(
count
==
sourcelen
||
broken
(
count
==
sourcelen
-
1
),
/* win9x */
"Expected count to be %d, it was %d
\n
"
,
sourcelen
,
count
);
count
=
0
;
count
=
pStr_GetPtrA
(
source
,
dest
,
destsize
);
ok
(
count
==
sourcelen
,
"Expected count to be %d, it was %d
\n
"
,
sourcelen
,
count
);
ok
(
count
==
sourcelen
||
broken
(
count
==
sourcelen
-
1
),
/* win9x */
"Expected count to be %d, it was %d
\n
"
,
sourcelen
,
count
);
ok
(
!
lstrcmp
(
source
,
dest
),
"Expected source and destination to be the same
\n
"
);
count
=
-
1
;
...
...
@@ -122,7 +128,9 @@ static void test_GetPtrAW(void)
count
=
0
;
destsize
=
15
;
count
=
pStr_GetPtrA
(
source
,
dest
,
destsize
);
ok
(
count
==
15
,
"Expected count to be 15, it was %d
\n
"
,
count
);
ok
(
count
==
15
||
broken
(
count
==
14
),
/* win9x */
"Expected count to be 15, it was %d
\n
"
,
count
);
ok
(
!
memcmp
(
source
,
dest
,
14
),
"Expected first part of source and destination to be the same
\n
"
);
ok
(
dest
[
14
]
==
'\0'
,
"Expected destination to be cut-off and 0 terminated
\n
"
);
}
...
...
@@ -130,21 +138,57 @@ static void test_GetPtrAW(void)
static
void
test_Alloc
(
void
)
{
PCHAR
p
=
pAlloc
(
0
);
ok
(
p
!=
NULL
,
"p=%p
\n
"
,
p
);
ok
(
pFree
(
p
),
"
\n
"
);
PCHAR
p
;
BOOL
res
;
DWORD
size
,
min
;
/* allocate size 0 */
p
=
pAlloc
(
0
);
ok
(
p
!=
NULL
,
"Expected non-NULL ptr
\n
"
);
/* get the minimum size */
min
=
pGetSize
(
p
);
/* free the block */
res
=
pFree
(
p
);
ok
(
res
==
TRUE
,
"Expected TRUE, got %d
\n
"
,
res
);
/* allocate size 1 */
p
=
pAlloc
(
1
);
ok
(
p
!=
NULL
,
"
\n
"
);
*
p
=
'\0'
;
expect
(
1
,
pGetSize
(
p
));
ok
(
p
!=
NULL
,
"Expected non-NULL ptr
\n
"
);
/* get the allocated size */
size
=
pGetSize
(
p
);
ok
(
size
==
1
||
broken
(
size
==
min
),
/* win9x */
"Expected 1, got %d
\n
"
,
size
);
/* reallocate the block */
p
=
pReAlloc
(
p
,
2
);
ok
(
p
!=
NULL
,
"
\n
"
);
expect
(
2
,
pGetSize
(
p
));
ok
(
pFree
(
p
),
"
\n
"
);
ok
(
pFree
(
NULL
),
"
\n
"
);
ok
(
p
!=
NULL
,
"Expected non-NULL ptr
\n
"
);
/* get the new size */
size
=
pGetSize
(
p
);
ok
(
size
==
2
||
broken
(
size
==
min
),
/* win9x */
"Expected 2, got %d
\n
"
,
size
);
/* free the block */
res
=
pFree
(
p
);
ok
(
res
==
TRUE
,
"Expected TRUE, got %d
\n
"
,
res
);
/* free a NULL ptr */
res
=
pFree
(
NULL
);
ok
(
res
==
TRUE
||
broken
(
res
==
FALSE
),
/* win9x */
"Expected TRUE, got %d
\n
"
,
res
);
/* reallocate a NULL ptr */
p
=
pReAlloc
(
NULL
,
2
);
ok
(
p
!=
NULL
,
"
\n
"
);
ok
(
pFree
(
p
),
"
\n
"
);
ok
(
p
!=
NULL
,
"Expectd non-NULL ptr
\n
"
);
res
=
pFree
(
p
);
ok
(
res
==
TRUE
,
"Expected TRUE, got %d
\n
"
,
res
);
}
START_TEST
(
misc
)
...
...
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