From: Chia-hung Duan Date: Wed, 15 Feb 2023 01:23:13 +0000 (+0000) Subject: [scudo] Update ring buffer test to make it accept zero size X-Git-Tag: upstream/17.0.6~17481 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dfacba5af0fb5dcdbf269b97258e435007276bf1;p=platform%2Fupstream%2Fllvm.git [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 --- 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) {