diff options
Diffstat (limited to 'test/test_common.hpp')
-rw-r--r-- | test/test_common.hpp | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/test/test_common.hpp b/test/test_common.hpp index fa6cf09..05f86db 100644 --- a/test/test_common.hpp +++ b/test/test_common.hpp @@ -15,13 +15,13 @@ * limitations under the License. */ -#ifndef EXT_TEST_COMMON_HPP -#define EXT_TEST_COMMON_HPP +#ifndef FUD_TEST_COMMON_HPP +#define FUD_TEST_COMMON_HPP #include <cstddef> #include <cstdlib> -namespace ext_lib { +namespace fud { // NOLINTBEGIN(cppcoreguidelines-macro-usage) #define MULTI_BYTE_LITERAL "test今日素敵はですねƩ®😀z" @@ -38,6 +38,28 @@ static_assert(sizeof(FOUR_BYTE) == 4 + 1); // NOLINTEND(cppcoreguidelines-macro-usage) constexpr size_t charSetSize = sizeof(CHARACTER_SET) - 1; +struct MockFudAlloc { + virtual void* operator()(size_t size); +}; + +extern MockFudAlloc globalDefaultMockAlloc; + +struct MockFudDealloc { + virtual void operator()(void* pointer); +}; + +extern MockFudDealloc globalDefaultMockDealloc; + +struct MockFudAllocator { + void* allocate(size_t size); + void deallocate(void* pointer); + + MockFudAlloc* m_allocator{&globalDefaultMockAlloc}; + MockFudDealloc* m_deallocator{&globalDefaultMockDealloc};; +}; + +extern MockFudAllocator globalMockFudAlloc; + } // namespace ext_lib #endif |