// // ParallelWorkerTest.swift // Nextcloud // // Created by Henrik Storch on 18.02.22. // Copyright © 2021 Henrik Storch. All rights reserved. // // Author Henrik Storch // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // @testable import Nextcloud import XCTest class ParallelWorkerTest: XCTestCase { func testWorkerComplete() throws { let expectation = XCTestExpectation(description: "Worker executes all tasks") let taskCount = 20 var tasksComplete = 0 let worker = ParallelWorker(n: 5, titleKey: nil, totalTasks: nil, hudView: nil) for _ in 0..