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
43c0ce16
Commit
43c0ce16
authored
Feb 13, 2007
by
Felix Nawothnig
Committed by
Alexandre Julliard
Feb 14, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Add tests for Alloc() and friends.
parent
feb4abf1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
misc.c
dlls/comctl32/tests/misc.c
+32
-0
No files found.
dlls/comctl32/tests/misc.c
View file @
43c0ce16
...
...
@@ -23,6 +23,11 @@
#include "wine/test.h"
static
PVOID
(
WINAPI
*
pAlloc
)(
LONG
);
static
PVOID
(
WINAPI
*
pReAlloc
)(
PVOID
,
LONG
);
static
BOOL
(
WINAPI
*
pFree
)(
PVOID
);
static
LONG
(
WINAPI
*
pGetSize
)(
PVOID
);
static
INT
(
WINAPI
*
pStr_GetPtrA
)(
LPCSTR
,
LPSTR
,
INT
);
static
BOOL
(
WINAPI
*
pStr_SetPtrA
)(
LPSTR
,
LPCSTR
);
static
INT
(
WINAPI
*
pStr_GetPtrW
)(
LPCWSTR
,
LPWSTR
,
INT
);
...
...
@@ -37,6 +42,8 @@ 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"
);
...
...
@@ -47,6 +54,11 @@ static BOOL InitFunctionPtrs(void)
return
FALSE
;
}
COMCTL32_GET_PROC
(
71
,
Alloc
);
COMCTL32_GET_PROC
(
72
,
ReAlloc
);
COMCTL32_GET_PROC
(
73
,
Free
);
COMCTL32_GET_PROC
(
74
,
GetSize
);
COMCTL32_GET_PROC
(
233
,
Str_GetPtrA
)
COMCTL32_GET_PROC
(
234
,
Str_SetPtrA
)
COMCTL32_GET_PROC
(
235
,
Str_GetPtrW
)
...
...
@@ -116,12 +128,32 @@ 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
"
);
p
=
pAlloc
(
1
);
ok
(
p
!=
NULL
,
"
\n
"
);
*
p
=
'\0'
;
expect
(
1
,
pGetSize
(
p
));
p
=
pReAlloc
(
p
,
2
);
ok
(
p
!=
NULL
,
"
\n
"
);
expect
(
2
,
pGetSize
(
p
));
ok
(
pFree
(
p
),
"
\n
"
);
ok
(
pFree
(
NULL
),
"
\n
"
);
p
=
pReAlloc
(
NULL
,
2
);
ok
(
p
!=
NULL
,
"
\n
"
);
ok
(
pFree
(
p
),
"
\n
"
);
}
START_TEST
(
misc
)
{
if
(
!
InitFunctionPtrs
())
return
;
test_GetPtrAW
();
test_Alloc
();
FreeLibrary
(
hComctl32
);
}
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