do not trigger allocator to return null under sanitizers

This commit is contained in:
Sema Checherinda 2022-08-18 21:07:55 +02:00
parent 128e1fec3d
commit f8480c26e7

View File

@ -269,6 +269,7 @@ TEST(MemoryResizeTest, AlignmentWithRealAllocator)
ASSERT_EQ(memory.m_size, 1);
}
#if !defined(ADDRESS_SANITIZER) && !defined(THREAD_SANITIZER) && !defined(MEMORY_SANITIZER) && !defined(UNDEFINED_BEHAVIOR_SANITIZER)
{
auto memory = Memory<>(0, 10); // not the power of 2
ASSERT_EQ(memory.m_data, nullptr);
@ -280,6 +281,7 @@ TEST(MemoryResizeTest, AlignmentWithRealAllocator)
ASSERT_EQ(memory.m_capacity, 0);
ASSERT_EQ(memory.m_size, 0);
}
#endif
{
auto memory = Memory<>(0, 32);