Skip to content

Commit

Permalink
Format tests file
Browse files Browse the repository at this point in the history
  • Loading branch information
starkdmi committed Jun 8, 2023
1 parent 9f46534 commit 5e13b40
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions Tests/VideoTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -325,12 +325,12 @@ let configurations: [ConfigList] = [
frameRate: 60
),
output: Parameters(
filename: "exported_oludeniz_prores.mov",
filesize: nil,
resolution: CGSize(width: 1080.0, height: 1920.0),
videoCodec: .proRes4444,
filename: "exported_oludeniz_prores.mov",
filesize: nil,
resolution: CGSize(width: 1080.0, height: 1920.0),
videoCodec: .proRes4444,
fileType: .mov,
bitrate: nil,
bitrate: nil,
frameRate: 30,
duration: 7.6,
hasAlpha: false
Expand Down Expand Up @@ -403,7 +403,7 @@ let configurations: [ConfigList] = [
duration: 7.97,
hasAlpha: false
)
),
)
]
)

Expand All @@ -428,15 +428,15 @@ class MediaToolSwiftTests: XCTestCase {
static let testsDirectory = URL(fileURLWithPath: #file).deletingLastPathComponent()
static let mediaDirectory = testsDirectory.appendingPathComponent("media")
static let tempDirectory = mediaDirectory.appendingPathComponent("temp")

static var setUpCalled = false

override func setUp() {
guard !Self.setUpCalled else { return }

// Used to stop execution of fulfillment expectations whenever at least one of them fails
// XCTestObservationCenter.shared.addTestObserver(TestObserver())

super.setUp()

Task {
Expand All @@ -450,12 +450,12 @@ class MediaToolSwiftTests: XCTestCase {
}
}
}

var isDirectory: ObjCBool = true
if !FileManager.default.fileExists(atPath: Self.tempDirectory.path, isDirectory: &isDirectory) {
try! FileManager.default.createDirectory(atPath: Self.tempDirectory.path, withIntermediateDirectories: false)
}

Self.setUpCalled = true
}

Expand All @@ -478,7 +478,7 @@ class MediaToolSwiftTests: XCTestCase {
expectation.fulfill()
}
}

#if targetEnvironment(simulator)
// Apple TV and iOS simulator compression is really slow
let osAdditionalTimeout: TimeInterval = 300 // 5 min
Expand Down Expand Up @@ -546,7 +546,7 @@ class MediaToolSwiftTests: XCTestCase {
continue
}
#endif

#if os(tvOS)
// Apple TV doesn't support HEVC with alpha channel decoding
if file.input.videoCodec == .hevcWithAlpha {
Expand Down Expand Up @@ -584,7 +584,7 @@ class MediaToolSwiftTests: XCTestCase {
expectations.append(expectation)
}
}

await fulfillment(of: expectations, timeout: 20 + osAdditionalTimeout * Double(expectations.count))

for file in configurations {
Expand All @@ -593,13 +593,13 @@ class MediaToolSwiftTests: XCTestCase {
continue
}
#endif

#if os(tvOS)
if file.input.videoCodec == .hevcWithAlpha {
continue
}
#endif

for config in file.configs {
// Test results
// 1. video
Expand All @@ -617,7 +617,7 @@ class MediaToolSwiftTests: XCTestCase {
#endif

let destination = Self.tempDirectory.appendingPathComponent(config.output.filename)

// Init video asset
let asset = AVAsset(url: destination)
guard let videoTrack = await asset.getFirstTrack(withMediaType: .video) else {
Expand Down Expand Up @@ -894,7 +894,7 @@ class MediaToolSwiftTests: XCTestCase {
Self.fulfill(expectationOne)
}
})

// Copy file
let sourceTwo = Self.tempDirectory.appendingPathComponent("oludeniz.MOV")
try? FileManager.default.copyItem(at: sourceOne, to: sourceTwo)
Expand Down

0 comments on commit 5e13b40

Please sign in to comment.