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:
Diffstat (limited to 'tests/gtests/blenlib/BLI_array_test.cc')
-rw-r--r--tests/gtests/blenlib/BLI_array_test.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/gtests/blenlib/BLI_array_test.cc b/tests/gtests/blenlib/BLI_array_test.cc
index 9c77c69e296..3ff5baf1d94 100644
--- a/tests/gtests/blenlib/BLI_array_test.cc
+++ b/tests/gtests/blenlib/BLI_array_test.cc
@@ -1,3 +1,5 @@
+/* Apache License, Version 2.0 */
+
#include "BLI_array.hh"
#include "BLI_strict_flags.h"
#include "testing/testing.h"
@@ -138,23 +140,22 @@ TEST(array, NoInitializationSizeConstructor)
{
using MyArray = Array<ConstructibleType>;
- AlignedBuffer<sizeof(MyArray), alignof(MyArray)> buffer;
- char *buffer_ptr = (char *)buffer.ptr();
- memset(buffer_ptr, 100, sizeof(MyArray));
+ TypedBuffer<MyArray> buffer;
+ memset(buffer, 100, sizeof(MyArray));
/* Doing this to avoid some compiler optimization. */
for (uint i : IndexRange(sizeof(MyArray))) {
- EXPECT_EQ(buffer_ptr[i], 100);
+ EXPECT_EQ(((char *)buffer.ptr())[i], 100);
}
{
- MyArray &array = *new (buffer.ptr()) MyArray(1, NoInitialization());
+ MyArray &array = *new (buffer) MyArray(1, NoInitialization());
EXPECT_EQ(array[0].value, 100);
array.clear_without_destruct();
array.~Array();
}
{
- MyArray &array = *new (buffer.ptr()) MyArray(1);
+ MyArray &array = *new (buffer) MyArray(1);
EXPECT_EQ(array[0].value, 42);
array.~Array();
}