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
4c90416d
Commit
4c90416d
authored
Dec 04, 2003
by
Dimitrie O. Paun
Committed by
Alexandre Julliard
Dec 04, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More tests for {Local,Global}{,Re}Alloc() calls.
Cleanup of the Heap*() tests.
parent
628e27ad
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
13 deletions
+48
-13
heap.c
dlls/kernel/tests/heap.c
+48
-13
No files found.
dlls/kernel/tests/heap.c
View file @
4c90416d
...
...
@@ -21,24 +21,59 @@
#include <stdarg.h>
#include <stdlib.h>
#include "ntstatus.h"
#include "windef.h"
#include "winbase.h"
#include "wine/test.h"
#include "winnt.h"
#include "winnls.h"
#include "winreg.h"
#include "winternl.h"
static
void
test_realloc
(
void
)
START_TEST
(
heap
)
{
void
*
mem
=
NULL
;
void
*
mem
;
HGLOBAL
gbl
;
SIZE_T
size
;
mem
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
mem
,
10
);
ok
(
mem
==
NULL
,
"memory allocated"
);
}
/* Heap*() functions */
mem
=
HeapAlloc
(
GetProcessHeap
(),
0
,
0
);
ok
(
mem
!=
NULL
,
"memory not allocated for size 0"
);
mem
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
NULL
,
10
);
ok
(
mem
==
NULL
,
"memory allocated by HeapReAlloc"
);
/* Global*() functions */
gbl
=
GlobalAlloc
(
GMEM_MOVEABLE
,
0
);
ok
(
gbl
!=
NULL
,
"global memory not allocated for size 0"
);
gbl
=
GlobalReAlloc
(
gbl
,
10
,
GMEM_MOVEABLE
);
ok
(
gbl
!=
NULL
,
"Can't realloc global memory"
);
size
=
GlobalSize
(
gbl
);
ok
(
size
>=
10
&&
size
<=
16
,
"Memory not resized to size 10, instead size=%ld"
,
size
);
gbl
=
GlobalReAlloc
(
gbl
,
0
,
GMEM_MOVEABLE
);
ok
(
gbl
==
NULL
,
"GlobalReAlloc should fail on size 0, instead size=%ld"
,
size
);
size
=
GlobalSize
(
gbl
);
ok
(
size
==
0
,
"Memory not resized to size 0, instead size=%ld"
,
size
);
ok
(
GlobalFree
(
gbl
)
==
NULL
,
"Memory not freed"
);
size
=
GlobalSize
(
gbl
);
ok
(
size
==
0
,
"Memory should have been freed, size=%ld"
,
size
);
gbl
=
GlobalReAlloc
(
0
,
10
,
GMEM_MOVEABLE
);
ok
(
gbl
==
NULL
,
"global realloc allocated memory"
);
/* Local*() functions */
gbl
=
LocalAlloc
(
GMEM_MOVEABLE
,
0
);
ok
(
gbl
!=
NULL
,
"global memory not allocated for size 0"
);
gbl
=
LocalReAlloc
(
gbl
,
10
,
GMEM_MOVEABLE
);
ok
(
gbl
!=
NULL
,
"Can't realloc global memory"
);
size
=
LocalSize
(
gbl
);
ok
(
size
>=
10
&&
size
<=
16
,
"Memory not resized to size 10, instead size=%ld"
,
size
);
gbl
=
LocalReAlloc
(
gbl
,
0
,
GMEM_MOVEABLE
);
ok
(
gbl
==
NULL
,
"LocalReAlloc should fail on size 0, instead size=%ld"
,
size
);
size
=
LocalSize
(
gbl
);
ok
(
size
==
0
,
"Memory not resized to size 0, instead size=%ld"
,
size
);
ok
(
LocalFree
(
gbl
)
==
NULL
,
"Memory not freed"
);
size
=
LocalSize
(
gbl
);
ok
(
size
==
0
,
"Memory should have been freed, size=%ld"
,
size
);
gbl
=
LocalReAlloc
(
0
,
10
,
GMEM_MOVEABLE
);
ok
(
gbl
==
NULL
,
"global realloc allocated memory"
);
START_TEST
(
heap
)
{
test_realloc
();
}
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