From f9bacbe9be8ad575ba8a57d8335523580a3fb6ae Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Thu, 24 Oct 2024 18:34:11 -0700 Subject: [PATCH] Make tests work on iOS 18.0 and iOS 18.1 Estimated data rate changes a bit so check against a range instead of a specific value. --- .../SJSAssetExportSessionTests.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Tests/SJSAssetExportSessionTests/SJSAssetExportSessionTests.swift b/Tests/SJSAssetExportSessionTests/SJSAssetExportSessionTests.swift index 5fb57c7..71ba608 100644 --- a/Tests/SJSAssetExportSessionTests/SJSAssetExportSessionTests.swift +++ b/Tests/SJSAssetExportSessionTests/SJSAssetExportSessionTests.swift @@ -80,7 +80,8 @@ final class ExportSessionTests { let videoTrack = try #require(await exportedAsset.sendTracks(withMediaType: .video).first) #expect(try await videoTrack.load(.naturalSize) == CGSize(width: 1280, height: 720)) #expect(try await videoTrack.load(.nominalFrameRate) == 24.0) - #expect(try await videoTrack.load(.estimatedDataRate) == 1_036_128) + let dataRate = try await videoTrack.load(.estimatedDataRate) + #expect((1_000_000 ... 1_100_000).contains(dataRate)) let videoFormat = try #require(await videoTrack.load(.formatDescriptions).first) #expect(videoFormat.mediaType == .video) #expect(videoFormat.mediaSubType == .h264) @@ -128,7 +129,8 @@ final class ExportSessionTests { let videoTrack = try #require(await exportedAsset.sendTracks(withMediaType: .video).first) #expect(try await videoTrack.load(.naturalSize) == CGSize(width: 1280, height: 720)) #expect(try await videoTrack.load(.nominalFrameRate) == 24.0) - #expect(try await videoTrack.load(.estimatedDataRate) == 1_036_128) + let dataRate = try await videoTrack.load(.estimatedDataRate) + #expect((1_000_000 ... 1_100_000).contains(dataRate)) let videoFormat = try #require(await videoTrack.load(.formatDescriptions).first) #expect(videoFormat.mediaType == .video) #expect(videoFormat.mediaSubType == .h264)