Skip to content

Commit

Permalink
added guard to render test file
Browse files Browse the repository at this point in the history
  • Loading branch information
untoldengine committed Jan 3, 2025
1 parent e63d7ef commit 710d93d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Tests/UntoldEngineTests/RendererTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,15 @@ final class RendererTests: XCTestCase {
// Compare images
let (averageDifference, diffImage) = compareImages(finalImage, referenceImage)

guard let diffFinalImage = diffImage else {
XCTFail("Unable to produce a final diff image")
return
}
saveResultToDisk(finalImage, "\(targetName)Test")

saveResultToDisk(referenceImage, "\(targetName)Reference")

saveResultToDisk(diffImage!, "\(targetName)Diff")
saveResultToDisk(diffFinalImage, "\(targetName)Diff")

XCTAssert(averageDifference < tolerance, "Images are not similar enough. Difference: \(averageDifference)")
}
Expand Down

0 comments on commit 710d93d

Please sign in to comment.