File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -122,7 +122,9 @@ var tests = TestSuite("ManagedBuffer")
122
122
tests. test ( " basic " ) {
123
123
do {
124
124
let s = TestManagedBuffer< LifetimeTracked> . create( 0 )
125
- expectEqual ( 1 , LifetimeTracked . instances)
125
+ withExtendedLifetime ( s) {
126
+ expectEqual ( 1 , LifetimeTracked . instances)
127
+ }
126
128
}
127
129
128
130
expectEqual ( 0 , LifetimeTracked . instances)
@@ -220,8 +222,9 @@ tests.test("ManagedBufferPointer") {
220
222
expectEqual ( mgr. header. capacity, 99 )
221
223
222
224
let s2 = mgr. buffer as! MyBuffer < LifetimeTracked >
223
- expectFalse ( mgr. isUniqueReference ( ) )
224
-
225
+ withExtendedLifetime ( s2) {
226
+ expectFalse ( mgr. isUniqueReference ( ) )
227
+ }
225
228
let val = mgr. withUnsafeMutablePointerToHeader { $0 } . pointee
226
229
expectEqual ( val. count. value, 0 )
227
230
expectEqual ( val. capacity, 99 )
You can’t perform that action at this time.
0 commit comments