Skip to content

Commit 40ba5e2

Browse files
authored
Merge pull request #72155 from al45tair/eng/PR-124212794
[Tests] Fix LongRefcounting test.
2 parents d5ca8ee + 07031a1 commit 40ba5e2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

stdlib/public/runtime/RefCount.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
#include <cstdio>
14+
1315
#include "swift/Runtime/HeapObject.h"
1416

1517
namespace swift {

unittests/runtime/LongTests/LongRefcounting.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ TEST(LongRefcountingTest, unowned_retain_overflow_DeathTest) {
282282
auto object = allocTestObject(&deinited, 1);
283283

284284
// URC is 1. Retain to maxURC, then retain again and verify overflow error.
285-
unownedRetainALot<true>(object, maxURC);
285+
unownedRetainALot<true>(object, maxURC - 1);
286286
EXPECT_EQ(0u, deinited);
287287
EXPECT_ALLOCATED(object);
288288
ASSERT_DEATH(swift_unownedRetain(object),
@@ -329,7 +329,7 @@ TEST(LongRefcountingTest, nonatomic_unowned_retain_overflow_DeathTest) {
329329
auto object = allocTestObject(&deinited, 1);
330330

331331
// URC is 1. Retain to maxURC, then retain again and verify overflow error.
332-
unownedRetainALot<false>(object, maxURC);
332+
unownedRetainALot<false>(object, maxURC - 1);
333333
EXPECT_EQ(0u, deinited);
334334
EXPECT_ALLOCATED(object);
335335
ASSERT_DEATH(swift_nonatomic_unownedRetain(object),

0 commit comments

Comments
 (0)