Skip to content

Commit 52ef76a

Browse files
authored
Merge pull request #241 from ikesyo/make-runloopmode-nested
Convert RunLoopMode to RunLoop.Mode as with Darwin Foundation
2 parents 9692ead + 596a135 commit 52ef76a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Sources/XCTest/Public/Asynchronous/XCTNSPredicateExpectation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ open class XCTNSPredicateExpectation: XCTestExpectation {
9595
}
9696
}
9797

98-
runLoop.add(timer, forMode: .defaultRunLoopMode)
98+
runLoop.add(timer, forMode: .default)
9999
queue.async {
100100
self.timer = timer
101101
}

Sources/XCTest/Public/Asynchronous/XCTWaiter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ private extension XCTWaiter {
362362
let timeIntervalToRun = min(0.1, timeout)
363363

364364
// RunLoop.run(mode:before:) should have @discardableResult <rdar://problem/45371901>
365-
_ = runLoop.run(mode: .defaultRunLoopMode, before: Date(timeIntervalSinceNow: timeIntervalToRun))
365+
_ = runLoop.run(mode: .default, before: Date(timeIntervalSinceNow: timeIntervalToRun))
366366
}
367367

368368
func cancelPrimitiveWait() {

Tests/Functional/Asynchronous/Expectations/main.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class ExpectationsTestCase: XCTestCase {
4747
let timer = Timer.scheduledTimer(withTimeInterval: 0.1, repeats: false) { _ in
4848
expectation.fulfill()
4949
}
50-
RunLoop.current.add(timer, forMode: .defaultRunLoopMode)
50+
RunLoop.current.add(timer, forMode: .default)
5151
waitForExpectations(timeout: 1.0)
5252
}
5353

@@ -59,7 +59,7 @@ class ExpectationsTestCase: XCTestCase {
5959
let timer = Timer.scheduledTimer(withTimeInterval: 1.0, repeats: false) { _ in
6060
expectation.fulfill()
6161
}
62-
RunLoop.current.add(timer, forMode: .defaultRunLoopMode)
62+
RunLoop.current.add(timer, forMode: .default)
6363
waitForExpectations(timeout: 0.1)
6464
}
6565

0 commit comments

Comments
 (0)