From 3be23f9b08d04b8cb56b43942985394d76ea88fb Mon Sep 17 00:00:00 2001 From: DmitriRuset <63009738+DmitriRuset@users.noreply.github.com> Date: Tue, 18 Mar 2025 01:19:13 +0300 Subject: [PATCH] Use alignof instead of sizeof in alignment tests --- tasks/tests/stackallocator_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/tests/stackallocator_test.cpp b/tasks/tests/stackallocator_test.cpp index 2374606..b40cd17 100644 --- a/tasks/tests/stackallocator_test.cpp +++ b/tasks/tests/stackallocator_test.cpp @@ -300,7 +300,7 @@ void TestAlignment() { assert((void*)pchar != (void*)pint); - assert(reinterpret_cast(pint) % sizeof(int) == 0); + assert(reinterpret_cast(pint) % alignof(int) == 0); charalloc.deallocate(pchar, 3); @@ -312,7 +312,7 @@ void TestAlignment() { auto* pld = ldalloc.allocate(25); - assert(reinterpret_cast(pld) % sizeof(long double) == 0); + assert(reinterpret_cast(pld) % alignof(long double) == 0); charalloc.deallocate(pchar, 555); ldalloc.deallocate(pld, 25);