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")
122122tests. test ( " basic " ) {
123123 do {
124124 let s = TestManagedBuffer< LifetimeTracked> . create( 0 )
125- expectEqual ( 1 , LifetimeTracked . instances)
125+ withExtendedLifetime ( s) {
126+ expectEqual ( 1 , LifetimeTracked . instances)
127+ }
126128 }
127129
128130 expectEqual ( 0 , LifetimeTracked . instances)
@@ -220,8 +222,9 @@ tests.test("ManagedBufferPointer") {
220222 expectEqual ( mgr. header. capacity, 99 )
221223
222224 let s2 = mgr. buffer as! MyBuffer < LifetimeTracked >
223- expectFalse ( mgr. isUniqueReference ( ) )
224-
225+ withExtendedLifetime ( s2) {
226+ expectFalse ( mgr. isUniqueReference ( ) )
227+ }
225228 let val = mgr. withUnsafeMutablePointerToHeader { $0 } . pointee
226229 expectEqual ( val. count. value, 0 )
227230 expectEqual ( val. capacity, 99 )
You can’t perform that action at this time.
0 commit comments