summaryrefslogtreecommitdiffhomepage
path: root/ios/OperationsTests/AsyncBlockOperationTests.swift
diff options
context:
space:
mode:
authorBug Magnet <marco.nikic@mullvad.net>2025-01-14 11:49:21 +0100
committerBug Magnet <marco.nikic@mullvad.net>2025-01-14 11:49:21 +0100
commited0b9cd0283e26e216fbb7edf5cd6e5bcf042cde (patch)
tree6fc5be4a68ffde2337d1bc3bb516ff46144a07be /ios/OperationsTests/AsyncBlockOperationTests.swift
parentd2949b4a0b1d3d86a25de1569dc8308c9d7fe237 (diff)
parente71db0cfc12bd561532b73722983175edab2482c (diff)
downloadmullvadvpn-ed0b9cd0283e26e216fbb7edf5cd6e5bcf042cde.tar.xz
mullvadvpn-ed0b9cd0283e26e216fbb7edf5cd6e5bcf042cde.zip
Merge branch 'fix-warnings-introduced-by-xcode-16-ios-741'
Diffstat (limited to 'ios/OperationsTests/AsyncBlockOperationTests.swift')
-rw-r--r--ios/OperationsTests/AsyncBlockOperationTests.swift20
1 files changed, 10 insertions, 10 deletions
diff --git a/ios/OperationsTests/AsyncBlockOperationTests.swift b/ios/OperationsTests/AsyncBlockOperationTests.swift
index c19e5e8a3f..00a7796f1c 100644
--- a/ios/OperationsTests/AsyncBlockOperationTests.swift
+++ b/ios/OperationsTests/AsyncBlockOperationTests.swift
@@ -14,7 +14,7 @@ import XCTest
final class AsyncBlockOperationTests: XCTestCase {
let operationQueue = AsyncOperationQueue()
- func testBlockOperation() {
+ func testBlockOperation() async {
let executionExpectation = expectation(description: "Should execute")
let finishExpectation = expectation(description: "Should finish")
@@ -29,10 +29,10 @@ final class AsyncBlockOperationTests: XCTestCase {
operationQueue.addOperation(operation)
- waitForExpectations(timeout: .UnitTest.timeout)
+ await fulfillment(of: [executionExpectation, finishExpectation], timeout: .UnitTest.timeout)
}
- func testSynchronousBlockOperation() {
+ func testSynchronousBlockOperation() async {
let executionExpectation = expectation(description: "Should execute")
let finishExpectation = expectation(description: "Should finish")
@@ -46,10 +46,10 @@ final class AsyncBlockOperationTests: XCTestCase {
operationQueue.addOperation(operation)
- waitForExpectations(timeout: .UnitTest.timeout)
+ await fulfillment(of: [executionExpectation, finishExpectation], timeout: .UnitTest.timeout)
}
- func testCancellableTaskBlockOperation() {
+ func testCancellableTaskBlockOperation() async {
let executionExpectation = expectation(description: "Should execute")
let cancelExpectation = expectation(description: "Should cancel")
let finishExpectation = expectation(description: "Should finish")
@@ -73,10 +73,10 @@ final class AsyncBlockOperationTests: XCTestCase {
operationQueue.addOperation(operation)
- waitForExpectations(timeout: .UnitTest.timeout)
+ await fulfillment(of: [executionExpectation, cancelExpectation, finishExpectation], timeout: .UnitTest.timeout)
}
- func testCancellationShouldNotFireBeforeOperationIsEnqueued() throws {
+ func testCancellationShouldNotFireBeforeOperationIsEnqueued() async throws {
let expect = expectation(description: "Cancellation should not fire.")
expect.isInverted = true
@@ -84,10 +84,10 @@ final class AsyncBlockOperationTests: XCTestCase {
operation.onCancel { _ in expect.fulfill() }
operation.cancel()
- waitForExpectations(timeout: .UnitTest.invertedTimeout)
+ await fulfillment(of: [expect], timeout: .UnitTest.invertedTimeout)
}
- func testCancellationShouldFireAfterCancelledOperationIsEnqueued() throws {
+ func testCancellationShouldFireAfterCancelledOperationIsEnqueued() async throws {
let expect = expectation(description: "Cancellation should fire.")
let operation = AsyncBlockOperation {}
@@ -95,6 +95,6 @@ final class AsyncBlockOperationTests: XCTestCase {
operation.cancel()
operationQueue.addOperation(operation)
- waitForExpectations(timeout: .UnitTest.timeout)
+ await fulfillment(of: [expect], timeout: .UnitTest.timeout)
}
}