From dfacba5af0fb5dcdbf269b97258e435007276bf1 Mon Sep 17 00:00:00 2001 From: Chia-hung Duan Date: Wed, 15 Feb 2023 01:23:13 +0000 Subject: [PATCH] [scudo] Update ring buffer test to make it accept zero size allocation ring buffer is allowed to be zero. Update the logic in the test so that on the platform that disables it won't fail this case. Reviewed By: fmayer Differential Revision: https://reviews.llvm.org/D144055 --- compiler-rt/lib/scudo/standalone/tests/combined_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler-rt/lib/scudo/standalone/tests/combined_test.cpp b/compiler-rt/lib/scudo/standalone/tests/combined_test.cpp index 63cb571..d4c2a23 100644 --- a/compiler-rt/lib/scudo/standalone/tests/combined_test.cpp +++ b/compiler-rt/lib/scudo/standalone/tests/combined_test.cpp @@ -705,8 +705,8 @@ SCUDO_TYPED_TEST(ScudoCombinedTest, ReallocateInPlaceStress) { SCUDO_TYPED_TEST(ScudoCombinedTest, RingBufferSize) { auto *Allocator = this->Allocator.get(); auto Size = Allocator->getRingBufferSize(); - ASSERT_GT(Size, 0u); - EXPECT_EQ(Allocator->getRingBufferAddress()[Size - 1], '\0'); + if (Size > 0) + EXPECT_EQ(Allocator->getRingBufferAddress()[Size - 1], '\0'); } SCUDO_TYPED_TEST(ScudoCombinedTest, RingBufferAddress) { -- 2.7.4