Skip to content

Commit 892dda8

Browse files
authored
Merge pull request #2720 from valeriyvan/operationqueuetest
Fixes tests of OperationQueue
2 parents 69232d2 + b8f9d58 commit 892dda8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Tests/Foundation/Tests/TestOperationQueue.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,11 @@ class TestOperationQueue : XCTestCase {
229229

230230
func test_CurrentQueueWithCustomUnderlyingQueue() {
231231
let expectation = self.expectation(description: "Background execution")
232-
232+
233233
let operationQueue = OperationQueue()
234-
operationQueue.underlyingQueue = DispatchQueue(label: "underlying_queue")
235-
234+
let underlyingQueue = DispatchQueue(label: "underlying_queue")
235+
operationQueue.underlyingQueue = underlyingQueue
236+
236237
operationQueue.addOperation {
237238
XCTAssertEqual(operationQueue, OperationQueue.current)
238239
expectation.fulfill()
@@ -268,7 +269,8 @@ class TestOperationQueue : XCTestCase {
268269
let expectation = self.expectation(description: "Background execution")
269270

270271
let operationQueue = OperationQueue()
271-
operationQueue.underlyingQueue = DispatchQueue(label: "underlying_queue")
272+
let underlyingQueue = DispatchQueue(label: "underlying_queue")
273+
operationQueue.underlyingQueue = underlyingQueue
272274
operationQueue.underlyingQueue = nil
273275

274276
operationQueue.addOperation {

0 commit comments

Comments
 (0)