Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey@blender.org>2020-11-17 13:38:42 +0300
committerSergey Sharybin <sergey@blender.org>2020-11-19 18:17:48 +0300
commita44bb8603e551285f569ef43669b0eb378da1dd8 (patch)
tree49652861c8579782e2ea626fe6dbff7a55ac64b6 /intern/guardedalloc/tests/guardedalloc_test_base.h
parent39ec64b13d18a17db86f9e93fb2aad5d8faa1f40 (diff)
Guarded allocator: Fix lock-free allocator tests
Previously the lock-free tests were actually testing guarded allocator because the main entry point of tests was switching allocator to the guarded one. There seems to be no allocations happening between the initialization sequence and the fixture's SetUp(), so easiest seems to be just to switch to lockfree implementation in the fixture's SetUp(). The test are passing locally, so the "should work" has high chance of actually being truth :) Differential Revision: https://developer.blender.org/D9584
Diffstat (limited to 'intern/guardedalloc/tests/guardedalloc_test_base.h')
-rw-r--r--intern/guardedalloc/tests/guardedalloc_test_base.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/intern/guardedalloc/tests/guardedalloc_test_base.h b/intern/guardedalloc/tests/guardedalloc_test_base.h
new file mode 100644
index 00000000000..c56cb9abe29
--- /dev/null
+++ b/intern/guardedalloc/tests/guardedalloc_test_base.h
@@ -0,0 +1,26 @@
+/* Apache License, Version 2.0 */
+
+#ifndef __GUARDEDALLOC_TEST_UTIL_H__
+#define __GUARDEDALLOC_TEST_UTIL_H__
+
+#include "testing/testing.h"
+
+#include "MEM_guardedalloc.h"
+
+class LockFreeAllocatorTest : public ::testing::Test {
+ protected:
+ virtual void SetUp()
+ {
+ MEM_use_lockfree_allocator();
+ }
+};
+
+class GuardedAllocatorTest : public ::testing::Test {
+ protected:
+ virtual void SetUp()
+ {
+ MEM_use_guarded_allocator();
+ }
+};
+
+#endif // __GUARDEDALLOC_TEST_UTIL_H__