| 9 | #include "base/memory.h" |
| 10 | |
| 11 | TEST(Memory, AlignedAlloc) |
| 12 | { |
| 13 | void* a = base_aligned_alloc(9, 8); |
| 14 | void* b = base_aligned_alloc(1, 16); |
| 15 | void* c = base_aligned_alloc(16, 16); |
| 16 | void* d = base_aligned_alloc(17, 16); |
| 17 | void* e = base_aligned_alloc(33, 32); |
| 18 | EXPECT_EQ(0, (((size_t)a) % 8)); |
| 19 | EXPECT_EQ(0, (((size_t)b) % 16)); |
| 20 | EXPECT_EQ(0, (((size_t)c) % 16)); |
| 21 | EXPECT_EQ(0, (((size_t)d) % 16)); |
| 22 | EXPECT_EQ(0, (((size_t)e) % 32)); |
| 23 | base_aligned_free(a); |
| 24 | base_aligned_free(b); |
| 25 | base_aligned_free(c); |
| 26 | base_aligned_free(d); |
| 27 | base_aligned_free(e); |
| 28 | } |
| 29 | |
| 30 | int main(int argc, char** argv) |
| 31 | { |
nothing calls this directly
no test coverage detected