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:
authorJacques Lucke <jacques@blender.org>2020-06-09 11:10:56 +0300
committerJacques Lucke <jacques@blender.org>2020-06-09 11:15:43 +0300
commitd8678e02ecec9375bec1dcf1388c6fc8b4ce3ad2 (patch)
tree6e7d2a7452091877f73d413d830e6cb12e86745f /tests/gtests/blenlib/BLI_linear_allocator_test.cc
parent50258d55e7c1360274d40e303386cf70b16c8b2f (diff)
BLI: generally improve C++ data structures
The main focus here was to improve the docs significantly. Furthermore, I reimplemented `Set`, `Map` and `VectorSet`. They are now (usually) faster, simpler and more customizable. I also rewrote `Stack` to make it more efficient by avoiding unnecessary copies. Thanks to everyone who helped with constructive feedback. Approved by brecht and sybren. Differential Revision: https://developer.blender.org/D7931
Diffstat (limited to 'tests/gtests/blenlib/BLI_linear_allocator_test.cc')
-rw-r--r--tests/gtests/blenlib/BLI_linear_allocator_test.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/gtests/blenlib/BLI_linear_allocator_test.cc b/tests/gtests/blenlib/BLI_linear_allocator_test.cc
index 0c67d1e76c9..6cac60dea3b 100644
--- a/tests/gtests/blenlib/BLI_linear_allocator_test.cc
+++ b/tests/gtests/blenlib/BLI_linear_allocator_test.cc
@@ -1,11 +1,12 @@
#include "BLI_linear_allocator.hh"
+#include "BLI_strict_flags.h"
#include "testing/testing.h"
using namespace BLI;
static bool is_aligned(void *ptr, uint alignment)
{
- BLI_assert(is_power_of_2_i(alignment));
+ BLI_assert(is_power_of_2_i((int)alignment));
return (POINTER_AS_UINT(ptr) & (alignment - 1)) == 0;
}
@@ -105,7 +106,7 @@ TEST(linear_allocator, ConstructArrayCopy)
Vector<int> values = {1, 2, 3};
MutableArrayRef<int> array1 = allocator.construct_array_copy(values.as_ref());
MutableArrayRef<int> array2 = allocator.construct_array_copy(values.as_ref());
- EXPECT_NE(array1.begin(), array2.begin());
+ EXPECT_NE(array1.data(), array2.data());
EXPECT_EQ(array1.size(), 3);
EXPECT_EQ(array2.size(), 3);
EXPECT_EQ(array1[1], 2);