diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-06-29 16:51:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-29 16:51:23 +0200 |
commit | af635a1dbc79ed8929b9199a592a6fb145dc8964 (patch) | |
tree | 96b70c7fffd75ab5f94b47b1c8df34ef5cc8304a /vespamalloc/src | |
parent | 0d7d6d0d6d3b4c9c94aa4f05da148c41c21b74fc (diff) |
Revert "Ensure errnoe is reset and saved in order to avoid sideeffects of lat…"
Diffstat (limited to 'vespamalloc/src')
-rw-r--r-- | vespamalloc/src/tests/test1/new_test.cpp | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/vespamalloc/src/tests/test1/new_test.cpp b/vespamalloc/src/tests/test1/new_test.cpp index e73def175b0..9c291b3842e 100644 --- a/vespamalloc/src/tests/test1/new_test.cpp +++ b/vespamalloc/src/tests/test1/new_test.cpp @@ -95,21 +95,16 @@ TEST("verify new with alignment = 64 with single element") { LOG(info, "&s=%p", s.get()); } -#if __GLIBC_PREREQ(2, 26) -TEST("verify realloarray") { - void *arr = calloc(5,5); - errno = 0; - void *arr2 = reallocarray(arr, 800, 5); - int myErrno = errno; - EXPECT_NOT_EQUAL(arr, arr2); - EXPECT_NOT_EQUAL(nullptr, arr2); - EXPECT_NOT_EQUAL(ENOMEM, myErrno); - - errno = 0; - void *arr3 = reallocarray(arr2, 1ul << 33, 1ul << 33); - myErrno = errno; - EXPECT_EQUAL(nullptr, arr3); - EXPECT_EQUAL(ENOMEM, myErrno); +TEST("verify new with alignment = 64 with single element") { + struct alignas(64) S { + long a; + }; + static_assert(sizeof(S) == 64); + static_assert(alignof(S) == 64); + auto s = std::make_unique<S>(); + verify_aligned(s.get()); + cmp(s.get(), &s->a); + LOG(info, "&s=%p", s.get()); } void verify_vespamalloc_usable_size() { |