mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Tests] Fix LongRefcounting test.
We were retaining one too many times in the two `_DeathTest` tests, which caused the tests to fail. This was previously masked by a bug. rdar://124212794
This commit is contained in:
@@ -10,6 +10,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#include "swift/Runtime/HeapObject.h"
|
||||
|
||||
namespace swift {
|
||||
|
||||
@@ -282,7 +282,7 @@ TEST(LongRefcountingTest, unowned_retain_overflow_DeathTest) {
|
||||
auto object = allocTestObject(&deinited, 1);
|
||||
|
||||
// URC is 1. Retain to maxURC, then retain again and verify overflow error.
|
||||
unownedRetainALot<true>(object, maxURC);
|
||||
unownedRetainALot<true>(object, maxURC - 1);
|
||||
EXPECT_EQ(0u, deinited);
|
||||
EXPECT_ALLOCATED(object);
|
||||
ASSERT_DEATH(swift_unownedRetain(object),
|
||||
@@ -329,7 +329,7 @@ TEST(LongRefcountingTest, nonatomic_unowned_retain_overflow_DeathTest) {
|
||||
auto object = allocTestObject(&deinited, 1);
|
||||
|
||||
// URC is 1. Retain to maxURC, then retain again and verify overflow error.
|
||||
unownedRetainALot<false>(object, maxURC);
|
||||
unownedRetainALot<false>(object, maxURC - 1);
|
||||
EXPECT_EQ(0u, deinited);
|
||||
EXPECT_ALLOCATED(object);
|
||||
ASSERT_DEATH(swift_nonatomic_unownedRetain(object),
|
||||
|
||||
Reference in New Issue
Block a user