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
4108fd0f
Commit
4108fd0f
authored
Jan 18, 2010
by
Andrew Nguyen
Committed by
Alexandre Julliard
Jan 18, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add tests for IsBadReadPtr.
parent
56416b09
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
1 deletion
+26
-1
virtual.c
dlls/kernel32/tests/virtual.c
+26
-1
No files found.
dlls/kernel32/tests/virtual.c
View file @
4108fd0f
...
...
@@ -872,11 +872,35 @@ static void test_CreateFileMapping(void)
CloseHandle
(
handle
);
}
static
void
test_IsBadReadPtr
(
void
)
{
BOOL
ret
;
void
*
ptr
=
(
void
*
)
0xdeadbeef
;
char
stackvar
;
ret
=
IsBadReadPtr
(
NULL
,
0
);
ok
(
ret
==
FALSE
,
"Expected IsBadReadPtr to return FALSE, got %d
\n
"
,
ret
);
ret
=
IsBadReadPtr
(
NULL
,
1
);
ok
(
ret
==
TRUE
,
"Expected IsBadReadPtr to return TRUE, got %d
\n
"
,
ret
);
ret
=
IsBadReadPtr
(
ptr
,
0
);
ok
(
ret
==
FALSE
,
"Expected IsBadReadPtr to return FALSE, got %d
\n
"
,
ret
);
ret
=
IsBadReadPtr
(
ptr
,
1
);
ok
(
ret
==
TRUE
,
"Expected IsBadReadPtr to return TRUE, got %d
\n
"
,
ret
);
ret
=
IsBadReadPtr
(
&
stackvar
,
0
);
ok
(
ret
==
FALSE
,
"Expected IsBadReadPtr to return FALSE, got %d
\n
"
,
ret
);
ret
=
IsBadReadPtr
(
&
stackvar
,
sizeof
(
char
));
ok
(
ret
==
FALSE
,
"Expected IsBadReadPtr to return FALSE, got %d
\n
"
,
ret
);
}
static
void
test_BadPtr
(
void
)
{
void
*
ptr
=
(
void
*
)
1
;
/* We assume address 1 is not mapped. */
ok
(
IsBadReadPtr
(
ptr
,
1
),
"IsBadReadPtr(1) failed.
\n
"
);
ok
(
IsBadWritePtr
(
ptr
,
1
),
"IsBadWritePtr(1) failed.
\n
"
);
ok
(
IsBadCodePtr
(
ptr
),
"IsBadCodePtr(1) failed.
\n
"
);
}
...
...
@@ -1220,6 +1244,7 @@ START_TEST(virtual)
test_MapViewOfFile
();
test_NtMapViewOfSection
();
test_CreateFileMapping
();
test_IsBadReadPtr
();
test_BadPtr
();
test_write_watch
();
}
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