We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4ff474f commit b2605baCopy full SHA for b2605ba
test/utils/utils_linux.cpp
@@ -169,3 +169,19 @@ TEST_F(test, utils_open) {
169
EXPECT_EQ(utils_file_open(NULL), -1);
170
EXPECT_EQ(utils_file_open_or_create(NULL), -1);
171
}
172
+
173
+TEST_F(test, utils_align_ptr_up_size_down) {
174
+ uintptr_t ptr = 0x4000;
175
+ size_t size = 0x8000;
176
+ size_t alignment = 0x4000;
177
+ utils_align_ptr_up_size_down((void **)&ptr, &size, alignment);
178
+ EXPECT_EQ(ptr, 0x4000);
179
+ EXPECT_EQ(size, 0x8000);
180
181
+ ptr = 0x4001;
182
+ size = 0x8000;
183
+ alignment = 0x4000;
184
185
+ EXPECT_EQ(ptr, 0x8000);
186
+ EXPECT_EQ(size, 0x4001);
187
+}
0 commit comments