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
356b06fa
Commit
356b06fa
authored
Jan 26, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add tests for tail checking on large heap blocks.
parent
bf975d1f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
1 deletion
+46
-1
heap.c
dlls/kernel32/tests/heap.c
+46
-1
No files found.
dlls/kernel32/tests/heap.c
View file @
356b06fa
...
...
@@ -488,7 +488,7 @@ static void test_heap_checks( DWORD flags )
{
BYTE
old
,
*
p
,
*
p2
;
BOOL
ret
;
SIZE_T
size
;
SIZE_T
size
,
large_size
=
800
*
1024
+
37
;
if
(
flags
&
HEAP_PAGE_ALLOCS
)
return
;
/* no tests for that case yet */
trace
(
"testing heap flags %08x
\n
"
,
flags
);
...
...
@@ -595,6 +595,51 @@ static void test_heap_checks( DWORD flags )
ret
=
HeapValidate
(
GetProcessHeap
(),
0
,
NULL
);
ok
(
ret
,
"HeapValidate failed
\n
"
);
}
/* now test large blocks */
p
=
HeapAlloc
(
GetProcessHeap
(),
0
,
large_size
);
ok
(
p
!=
NULL
,
"HeapAlloc failed
\n
"
);
ret
=
HeapValidate
(
GetProcessHeap
(),
0
,
p
);
ok
(
ret
,
"HeapValidate failed
\n
"
);
size
=
HeapSize
(
GetProcessHeap
(),
0
,
p
);
ok
(
size
==
large_size
,
"Wrong size %lu
\n
"
,
size
);
ok
(
p
[
large_size
-
2
]
==
0
,
"wrong data %x
\n
"
,
p
[
large_size
-
2
]
);
ok
(
p
[
large_size
-
1
]
==
0
,
"wrong data %x
\n
"
,
p
[
large_size
-
1
]
);
if
(
flags
&
HEAP_TAIL_CHECKING_ENABLED
)
{
/* Windows doesn't do tail checking on large blocks */
ok
(
p
[
large_size
]
==
0xab
||
broken
(
p
[
large_size
]
==
0
),
"wrong data %x
\n
"
,
p
[
large_size
]
);
ok
(
p
[
large_size
+
1
]
==
0xab
||
broken
(
p
[
large_size
+
1
]
==
0
),
"wrong data %x
\n
"
,
p
[
large_size
+
1
]
);
ok
(
p
[
large_size
+
2
]
==
0xab
||
broken
(
p
[
large_size
+
2
]
==
0
),
"wrong data %x
\n
"
,
p
[
large_size
+
2
]
);
if
(
p
[
large_size
]
==
0xab
)
{
p
[
large_size
]
=
0xcc
;
ret
=
HeapValidate
(
GetProcessHeap
(),
0
,
p
);
ok
(
!
ret
,
"HeapValidate succeeded
\n
"
);
/* other calls only check when HEAP_VALIDATE is set */
if
(
flags
&
HEAP_VALIDATE
)
{
size
=
HeapSize
(
GetProcessHeap
(),
0
,
p
);
ok
(
size
==
~
(
SIZE_T
)
0
,
"Wrong size %lu
\n
"
,
size
);
p2
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
p
,
large_size
-
3
);
ok
(
p2
==
NULL
,
"HeapReAlloc succeeded
\n
"
);
ret
=
HeapFree
(
GetProcessHeap
(),
0
,
p
);
ok
(
!
ret
,
"HeapFree succeeded
\n
"
);
}
p
[
large_size
]
=
0xab
;
}
}
ret
=
HeapFree
(
GetProcessHeap
(),
0
,
p
);
ok
(
ret
,
"HeapFree failed
\n
"
);
}
static
void
test_debug_heap
(
const
char
*
argv0
,
DWORD
flags
)
...
...
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