Skip to content

Commit

Permalink
Revert "Revert "Convert RunLoopMode to RunLoop.Mode as with Darwin Fo…
Browse files Browse the repository at this point in the history
…undation""
  • Loading branch information
ikesyo authored Jan 26, 2019
1 parent e117f36 commit 6cdd5d1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ open class XCTNSPredicateExpectation: XCTestExpectation {
}
}

runLoop.add(timer, forMode: .defaultRunLoopMode)
runLoop.add(timer, forMode: .default)
queue.async {
self.timer = timer
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/XCTest/Public/Asynchronous/XCTWaiter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ private extension XCTWaiter {
let timeIntervalToRun = min(0.1, timeout)

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

func cancelPrimitiveWait() {
Expand Down
4 changes: 2 additions & 2 deletions Tests/Functional/Asynchronous/Expectations/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ExpectationsTestCase: XCTestCase {
let timer = Timer.scheduledTimer(withTimeInterval: 0.1, repeats: false) { _ in
expectation.fulfill()
}
RunLoop.current.add(timer, forMode: .defaultRunLoopMode)
RunLoop.current.add(timer, forMode: .default)
waitForExpectations(timeout: 1.0)
}

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

Expand Down

0 comments on commit 6cdd5d1

Please sign in to comment.