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
16a97953
Commit
16a97953
authored
Oct 19, 2015
by
Sebastian Lackner
Committed by
Alexandre Julliard
Oct 20, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add tests for GetPhysicallyInstalledSystemMemory.
Signed-off-by:
Sebastian Lackner
<
sebastian@fds-team.de
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0fe60f83
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
heap.c
dlls/kernel32/tests/heap.c
+35
-0
No files found.
dlls/kernel32/tests/heap.c
View file @
16a97953
...
...
@@ -39,6 +39,7 @@
#define HEAP_VALIDATE_PARAMS 0x40000000
static
BOOL
(
WINAPI
*
pHeapQueryInformation
)(
HANDLE
,
HEAP_INFORMATION_CLASS
,
PVOID
,
SIZE_T
,
PSIZE_T
);
static
BOOL
(
WINAPI
*
pGetPhysicallyInstalledSystemMemory
)(
ULONGLONG
*
);
static
ULONG
(
WINAPI
*
pRtlGetNtGlobalFlags
)(
void
);
struct
heap_layout
...
...
@@ -1145,6 +1146,38 @@ static void test_child_heap( const char *arg )
test_heap_checks
(
expect_heap
);
}
static
void
test_GetPhysicallyInstalledSystemMemory
(
void
)
{
HMODULE
kernel32
=
GetModuleHandleA
(
"kernel32.dll"
);
MEMORYSTATUSEX
memstatus
;
ULONGLONG
total_memory
;
BOOL
ret
;
pGetPhysicallyInstalledSystemMemory
=
(
void
*
)
GetProcAddress
(
kernel32
,
"GetPhysicallyInstalledSystemMemory"
);
if
(
!
pGetPhysicallyInstalledSystemMemory
)
{
skip
(
"GetPhysicallyInstalledSystemMemory is not available
\n
"
);
return
;
}
SetLastError
(
0xdeadbeef
);
ret
=
pGetPhysicallyInstalledSystemMemory
(
NULL
);
ok
(
!
ret
,
"GetPhysicallyInstalledSystemMemory should fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %u
\n
"
,
GetLastError
());
total_memory
=
0
;
ret
=
pGetPhysicallyInstalledSystemMemory
(
&
total_memory
);
ok
(
ret
,
"GetPhysicallyInstalledSystemMemory unexpectedly failed
\n
"
);
ok
(
total_memory
!=
0
,
"expected total_memory != 0
\n
"
);
memstatus
.
dwLength
=
sizeof
(
memstatus
);
ret
=
GlobalMemoryStatusEx
(
&
memstatus
);
ok
(
ret
,
"GlobalMemoryStatusEx unexpectedly failed
\n
"
);
ok
(
total_memory
>=
memstatus
.
ullTotalPhys
/
1024
,
"expected total_memory >= memstatus.ullTotalPhys / 1024
\n
"
);
}
START_TEST
(
heap
)
{
int
argc
;
...
...
@@ -1172,7 +1205,9 @@ START_TEST(heap)
test_sized_HeapReAlloc
(
1
,
(
1
<<
20
));
test_sized_HeapReAlloc
((
1
<<
20
),
(
2
<<
20
));
test_sized_HeapReAlloc
((
1
<<
20
),
1
);
test_HeapQueryInformation
();
test_GetPhysicallyInstalledSystemMemory
();
if
(
pRtlGetNtGlobalFlags
)
{
...
...
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