#include <atlfile.h>
#include "atltest.h"
Go to the source code of this file.
◆ START_TEST()
Definition at line 193 of file CAtlFileMapping.cpp.
194{
197}
static void test_SharedMem()
static void test_FileMapping()
◆ test_FileMapping()
static void test_FileMapping |
( |
| ) |
|
|
static |
Definition at line 140 of file CAtlFileMapping.cpp.
141{
144
146
149
150 {
154 return;
155
157
159 ok(
hr ==
S_OK,
"Expected S_OK, got 0x%lx\n",
hr);
161 ok(
test1.GetHandle() !=
NULL,
"Expected handle, got %p\n",
test1.GetHandle());
163
165 ok(
hr ==
S_OK,
"Expected S_OK, got 0x%lx\n",
hr);
167 ok(
test2.GetHandle() !=
NULL,
"Expected handle, got %p\n",
test2.GetHandle());
168
170
172 ok(
hr ==
S_OK,
"Expected S_OK, got 0x%lx\n",
hr);
174 ok(
test1.GetHandle() ==
NULL,
"Expected NULL, got %p\n",
test1.GetHandle());
176
178 ok(
hr ==
S_OK,
"Expected S_OK, got 0x%lx\n",
hr);
180 ok(
test1.GetHandle() !=
NULL,
"Expected handle, got %p\n",
test1.GetHandle());
181 ok(
test1.GetMappingSize() == 0x1000,
"Expected 0x1000, got %lu\n",
test1.GetMappingSize());
182 }
183
184
187 {
189 }
190}
#define INVALID_HANDLE_VALUE
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
_Must_inspect_result_ _Out_ PLARGE_INTEGER FileSize
#define IMAGE_DOS_SIGNATURE
Referenced by START_TEST().
◆ test_SharedMem()
static void test_SharedMem |
( |
| ) |
|
|
static |
Definition at line 22 of file CAtlFileMapping.cpp.
23{
28
33 ok(
test1.GetMappingSize() == 0,
"Expected 0, got %lu\n",
test1.GetMappingSize());
34 ok(
test3.GetMappingSize() == 0,
"Expected 0, got %lu\n",
test3.GetMappingSize());
35
37
38
40 ok(
hr ==
S_OK,
"Expected S_OK, got 0x%lx\n",
hr);
41
42
47 ok(
test1.GetMappingSize() == 123,
"Expected 123, got %lu\n",
test1.GetMappingSize());
48
50 ok(
hr ==
S_OK,
"Expected S_OK, got 0x%lx\n",
hr);
53 ok(
test1.GetMappingSize() == 123,
"Expected 123, got %lu\n",
test1.GetMappingSize());
54
55 bAlreadyExisted = 123;
57 ok(
hr ==
S_OK,
"Expected S_OK, got 0x%lx\n",
hr);
59 ok(
test1.GetHandle() !=
NULL,
"Expected handle, got %p\n",
test1.GetHandle());
60 ok(
test1.GetMappingSize() ==
sizeof(
TestData),
"Expected sizeof(TestData), got %lu\n",
test1.GetMappingSize());
61 ok(bAlreadyExisted ==
FALSE,
"Expected FALSE, got %u\n", bAlreadyExisted);
62
64 {
66 }
67
69 ok(
hr ==
S_OK,
"Expected S_OK, got 0x%lx\n",
hr);
71 ok(
test2.GetHandle() !=
NULL,
"Expected handle, got %p\n",
test2.GetHandle());
72 ok(
test2.GetMappingSize() ==
sizeof(
TestData),
"Expected sizeof(TestData), got %lu\n",
test2.GetMappingSize());
73
74
76 ok(
test1.GetHandle() !=
NULL,
"Expected handle, got %p\n",
test1.GetHandle());
77 ok(
test1.GetMappingSize() ==
sizeof(
TestData),
"Expected sizeof(TestData), got %lu\n",
test1.GetMappingSize());
78
79
80 ok(
test1.GetData() !=
test2.GetData(),
"Expected different ptrs\n");
81 ok(
test1.GetHandle() !=
test2.GetHandle(),
"Expected different handles\n");
82
85 if (t1 && t2)
86 {
87 ok(t1->
data[0] == 0x35353535,
"Expected 0x35353535, got 0x%x\n", t1->
data[0]);
88 ok(t2->
data[0] == 0x35353535,
"Expected 0x35353535, got 0x%x\n", t2->
data[0]);
89
90 t1->
data[0] = 0xbeefbeef;
91 ok(t1->
data[0] == (
int)0xbeefbeef,
"Expected 0xbeefbeef, got 0x%x\n", t1->
data[0]);
92 ok(t2->
data[0] == (
int)0xbeefbeef,
"Expected 0xbeefbeef, got 0x%x\n", t2->
data[0]);
93 }
94
99 ok(
test3.GetMappingSize() ==
sizeof(
TestData),
"Expected sizeof(TestData), got %lu\n",
test3.GetMappingSize());
100
102 ok(
hr ==
S_OK,
"Expected S_OK, got 0x%lx\n",
hr);
104 ok(
test2.GetHandle() ==
NULL,
"Expected NULL, got %p\n",
test2.GetHandle());
105 ok(
test2.GetMappingSize() ==
sizeof(
TestData),
"Expected sizeof(TestData), got %lu\n",
test2.GetMappingSize());
106
107 bAlreadyExisted = 123;
108
112 ok(
test2.GetHandle() ==
NULL,
"Expected NULL, got %p\n",
test2.GetHandle());
113 ok(
test2.GetMappingSize() ==
sizeof(
TestData),
"Expected sizeof(TestData), got %lu\n",
test2.GetMappingSize());
114 ok(bAlreadyExisted ==
TRUE,
"Expected TRUE, got %u\n", bAlreadyExisted);
115
116 bAlreadyExisted = 123;
118 ok(
hr ==
S_OK,
"Expected S_OK, got 0x%lx\n",
hr);
120 ok(
test2.GetHandle() !=
NULL,
"Expected handle, got %p\n",
test2.GetHandle());
121 ok(
test2.GetMappingSize() ==
sizeof(
TestData),
"Expected sizeof(TestData), got %lu\n",
test2.GetMappingSize());
122 ok(bAlreadyExisted ==
TRUE,
"Expected TRUE, got %u\n", bAlreadyExisted);
123
124
125 ok(
test1.GetData() !=
test2.GetData(),
"Expected different ptrs\n");
126 ok(
test1.GetHandle() !=
test2.GetHandle(),
"Expected different handles\n");
127
129 if (t1 && t2)
130 {
131 ok(t1->
data[0] == (
int)0xbeefbeef,
"Expected 0xbeefbeef, got 0x%x\n", t1->
data[0]);
132 ok(t2->
data[0] == (
int)0xbeefbeef,
"Expected 0xbeefbeef, got 0x%x\n", t2->
data[0]);
133
134 t1->
data[0] = 0xdeaddead;
135 ok(t1->
data[0] == (
int)0xdeaddead,
"Expected 0xdeaddead, got 0x%x\n", t1->
data[0]);
136 ok(t2->
data[0] == (
int)0xdeaddead,
"Expected 0xdeaddead, got 0x%x\n", t2->
data[0]);
137 }
138}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
#define ERROR_FILE_NOT_FOUND
#define PAGE_EXECUTE_READ
#define offsetof(TYPE, MEMBER)
#define FILE_MAP_ALL_ACCESS
#define HRESULT_FROM_WIN32(x)
#define ERROR_MAPPED_ALIGNMENT
Referenced by START_TEST().