Skip to content

Commit

Permalink
Merge pull request #23 from tattn/fix-test
Browse files Browse the repository at this point in the history
Fix unit tests caused by accuracy
  • Loading branch information
tattn committed Sep 9, 2023
2 parents f6160c1 + cf182ad commit 5b2db27
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Tests/VRMSceneKit/SCNMatrix4+Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class SCNMatrix4_Tests: XCTestCase {
func test_testMatrix() {
let result = SCNMatrix4(m11: 0.99999976, m12: 0.0, m13: 0.0, m14: 0.0, m21: 0.0, m22: -2.0, m23: -1.7484554e-07, m24: 0.0, m31: 0.0, m32: 2.6226832e-07, m33: -3.0, m34: 0.0, m41: 3.0, m42: 4.0, m43: 5.0, m44: 1.0)
for (m1, m2) in zip(testMatrix.array, result.array) {
XCTAssertEqual(m1, m2, accuracy: 0.000000001)
XCTAssertEqual(m1, m2, accuracy: 0.000001)
}
}
}
Expand All @@ -39,6 +39,8 @@ class SIMDFloat4x4_Tests: XCTestCase {

func test_multiplyPointWithSCNVector3() {
let vec = testMatrix.multiplyPoint(SIMD3<Float>(1, 2, 3))
XCTAssertEqual(vec, SIMD3<Float>(x: 3.9999998, y: 7.1525574e-07, z: -4.0))
XCTAssertEqual(vec.x, 4, accuracy: 0.00001)
XCTAssertEqual(vec.y, 7.1525574e-07, accuracy: 0.00001)
XCTAssertEqual(vec.z, -4.0, accuracy: 0.00001)
}
}

0 comments on commit 5b2db27

Please sign in to comment.