summaryrefslogtreecommitdiff
path: root/test/test_common.hpp
diff options
context:
space:
mode:
authorDominick Allen <djallen@librehumanitas.org>2024-10-17 19:42:29 -0500
committerDominick Allen <djallen@librehumanitas.org>2024-10-17 19:42:29 -0500
commit8249b28bea29e8ce17eac12776a60ec3f9e47176 (patch)
tree98318d7564b5f618cfb59e23cc6b918fcab88ee8 /test/test_common.hpp
parentb32e83ece42cec5aa9dee370bcdf349d23dbc8ba (diff)
Rename InvalidInput to ArgumentInvalid.
Diffstat (limited to 'test/test_common.hpp')
-rw-r--r--test/test_common.hpp28
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