Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unit tests caused by accuracy #23

Merged
merged 1 commit into from
Sep 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
}
}