Skip to content

Commit a936f8f

Browse files
Merge pull request #161 from apple/build-fixes-for-darwin-chagnes
Fix the build script run tests that were missed
2 parents 37ea60f + a0fb983 commit a936f8f

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

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: .defaultRunLoopMode)
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: .defaultRunLoopMode)
6363
waitForExpectations(timeout: 0.1)
6464
}
6565

Tests/Functional/Asynchronous/Notifications/Expectations/main.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class NotificationExpectationsTestCase: XCTestCase {
2121
func test_observeNotificationWithName_passes() {
2222
let notificationName = "notificationWithNameTest"
2323
expectation(forNotification: notificationName, object:nil)
24-
NotificationCenter.default.postNotificationName(Notification.Name(rawValue: notificationName), object: nil)
24+
NotificationCenter.default.post(name: Notification.Name(rawValue: notificationName), object: nil)
2525
waitForExpectations(timeout: 0.0)
2626
}
2727

@@ -31,7 +31,7 @@ class NotificationExpectationsTestCase: XCTestCase {
3131
let notificationName = "notificationWithNameAndObjectTest"
3232
let dummyObject = NSObject()
3333
expectation(forNotification: notificationName, object:dummyObject)
34-
NotificationCenter.default.postNotificationName(Notification.Name(rawValue: notificationName), object: dummyObject)
34+
NotificationCenter.default.post(name: Notification.Name(rawValue: notificationName), object: dummyObject)
3535
waitForExpectations(timeout: 0.0)
3636
}
3737

@@ -41,7 +41,7 @@ class NotificationExpectationsTestCase: XCTestCase {
4141
let notificationName = "notificationWithNameAndObject_expectNoObjectTest"
4242
expectation(forNotification: notificationName, object:nil)
4343
let dummyObject = NSObject()
44-
NotificationCenter.default.postNotificationName(Notification.Name(rawValue: notificationName), object: dummyObject)
44+
NotificationCenter.default.post(name: Notification.Name(rawValue: notificationName), object: dummyObject)
4545
waitForExpectations(timeout: 0.0)
4646
}
4747

@@ -50,7 +50,7 @@ class NotificationExpectationsTestCase: XCTestCase {
5050
// CHECK: Test Case 'NotificationExpectationsTestCase.test_observeNotificationWithIncorrectName_fails' failed \(\d+\.\d+ seconds\).
5151
func test_observeNotificationWithIncorrectName_fails() {
5252
expectation(forNotification: "expectedName", object: nil)
53-
NotificationCenter.default.postNotificationName(Notification.Name(rawValue: "actualName"), object: nil)
53+
NotificationCenter.default.post(name: Notification.Name(rawValue: "actualName"), object: nil)
5454
waitForExpectations(timeout: 0.1)
5555
}
5656

@@ -62,7 +62,7 @@ class NotificationExpectationsTestCase: XCTestCase {
6262
let dummyObject: NSString = "dummyObject"
6363
let anotherDummyObject = NSObject()
6464
expectation(forNotification: notificationName, object: dummyObject)
65-
NotificationCenter.default.postNotificationName(Notification.Name(rawValue: notificationName), object:anotherDummyObject)
65+
NotificationCenter.default.post(name: Notification.Name(rawValue: notificationName), object:anotherDummyObject)
6666
waitForExpectations(timeout: 0.1)
6767
}
6868

Tests/Functional/Asynchronous/Notifications/Handler/main.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class NotificationHandlerTestCase: XCTestCase {
2323
notification in
2424
return false
2525
})
26-
NotificationCenter.default.postNotificationName(Notification.Name(rawValue: "returnFalse"), object: nil)
26+
NotificationCenter.default.post(name: Notification.Name(rawValue: "returnFalse"), object: nil)
2727
waitForExpectations(timeout: 0.1)
2828
}
2929

@@ -34,7 +34,7 @@ class NotificationHandlerTestCase: XCTestCase {
3434
notification in
3535
return true
3636
})
37-
NotificationCenter.default.postNotificationName(Notification.Name(rawValue: "returnTrue"), object: nil)
37+
NotificationCenter.default.post(name: Notification.Name(rawValue: "returnTrue"), object: nil)
3838
waitForExpectations(timeout: 0.1)
3939
}
4040

@@ -47,7 +47,7 @@ class NotificationHandlerTestCase: XCTestCase {
4747
return true
4848
})
4949
waitForExpectations(timeout: 0.1, handler: nil)
50-
NotificationCenter.default.postNotificationName(Notification.Name(rawValue: "note"), object: nil)
50+
NotificationCenter.default.post(name: Notification.Name(rawValue: "note"), object: nil)
5151
}
5252

5353
static var allTests = {

Tests/Functional/Asynchronous/Predicates/Expectations/main.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@
1414
// CHECK: Test Suite '.*\.xctest' started at \d+:\d+:\d+\.\d+
1515

1616
// CHECK: Test Suite 'PredicateExpectationsTestCase' started at \d+:\d+:\d+\.\d+
17-
class PredicateExpectationsTestCase: XCTestCase {
17+
class NSPredicateExpectationsTestCase: XCTestCase {
1818
// CHECK: Test Case 'PredicateExpectationsTestCase.test_immediatelyTruePredicateAndObject_passes' started at \d+:\d+:\d+\.\d+
1919
// CHECK: Test Case 'PredicateExpectationsTestCase.test_immediatelyTruePredicateAndObject_passes' passed \(\d+\.\d+ seconds\).
2020
func test_immediatelyTruePredicateAndObject_passes() {
21-
let predicate = Predicate(value: true)
21+
let predicate = NSPredicate(value: true)
2222
let object = NSObject()
2323
expectation(for: predicate, evaluatedWith: object)
2424
waitForExpectations(timeout: 0.1)
2525
}
2626

2727
// CHECK: Test Case 'PredicateExpectationsTestCase.test_immediatelyFalsePredicateAndObject_fails' started at \d+:\d+:\d+\.\d+
28-
// CHECK: .*/Tests/Functional/Asynchronous/Predicates/Expectations/main.swift:[[@LINE+6]]: error: PredicateExpectationsTestCase.test_immediatelyFalsePredicateAndObject_fails : Asynchronous wait failed - Exceeded timeout of 0.1 seconds, with unfulfilled expectations: Expect `<Predicate: 0x[0-9A-Fa-f]{1,16}>` for object <NSObject: 0x[0-9A-Fa-f]{1,16}>
28+
// CHECK: .*/Tests/Functional/Asynchronous/Predicates/Expectations/main.swift:[[@LINE+6]]: error: NSPredicateExpectationsTestCase.test_immediatelyFalsePredicateAndObject_fails : Asynchronous wait failed - Exceeded timeout of 0.1 seconds, with unfulfilled expectations: Expect `<Predicate: 0x[0-9A-Fa-f]{1,16}>` for object <NSObject: 0x[0-9A-Fa-f]{1,16}>
2929
// CHECK: Test Case 'PredicateExpectationsTestCase.test_immediatelyFalsePredicateAndObject_fails' failed \(\d+\.\d+ seconds\).
3030
func test_immediatelyFalsePredicateAndObject_fails() {
31-
let predicate = Predicate(value: false)
31+
let predicate = NSPredicate(value: false)
3232
let object = NSObject()
3333
expectation(for: predicate, evaluatedWith: object)
3434
waitForExpectations(timeout: 0.1)
@@ -38,7 +38,7 @@ class PredicateExpectationsTestCase: XCTestCase {
3838
// CHECK: Test Case 'PredicateExpectationsTestCase.test_delayedTruePredicateAndObject_passes' passed \(\d+\.\d+ seconds\).
3939
func test_delayedTruePredicateAndObject_passes() {
4040
var didEvaluate = false
41-
let predicate = Predicate(block: { evaluatedObject, bindings in
41+
let predicate = NSPredicate(block: { evaluatedObject, bindings in
4242
defer { didEvaluate = true }
4343
return didEvaluate
4444
})
@@ -50,7 +50,7 @@ class PredicateExpectationsTestCase: XCTestCase {
5050
// CHECK: Test Case 'PredicateExpectationsTestCase.test_immediatelyTrueDelayedFalsePredicateAndObject_passes' passed \(\d+\.\d+ seconds\).
5151
func test_immediatelyTrueDelayedFalsePredicateAndObject_passes() {
5252
var didEvaluate = false
53-
let predicate = Predicate(block: { evaluatedObject, bindings in
53+
let predicate = NSPredicate(block: { evaluatedObject, bindings in
5454
defer { didEvaluate = true }
5555
return !didEvaluate
5656
})

Tests/Functional/Performance/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class PerformanceTestCase: XCTestCase {
8989
// CHECK: .*/Performance/main.swift:[[@LINE+1]]: error: PerformanceTestCase.test_measuresWallClockTimeInBlock : failed: The relative standard deviation of the measurements is \d+.\d{3}% which is higher than the max allowed of \d+.\d{3}%.
9090
measure {
9191
if !hasWaited {
92-
Thread.sleepForTimeInterval(1)
92+
Thread.sleep(forTimeInterval: 1)
9393
hasWaited = true
9494
}
9595
}

0 commit comments

Comments
 (0)