5ad55b1d58
- EncryptionKey uses UnswappableAllocator
19 lines
490 B
C++
19 lines
490 B
C++
#include <gtest/gtest.h>
|
|
#include <cpp-utils/system/memory.h>
|
|
#include <memory>
|
|
#include <cpp-utils/pointer/gcc_4_8_compatibility.h>
|
|
|
|
using cpputils::UnswappableAllocator;
|
|
|
|
TEST(MemoryTest, LockingSmallMemoryDoesntCrash) {
|
|
UnswappableAllocator allocator;
|
|
void *data = allocator.allocate(5);
|
|
allocator.free(data, 5);
|
|
}
|
|
|
|
TEST(MemoryTest, LockingLargeMemoryDoesntCrash) {
|
|
UnswappableAllocator allocator;
|
|
void *data = allocator.allocate(10240);
|
|
allocator.free(data, 10240);
|
|
}
|