Skip to content

Commit 5f1a83e

Browse files
committed
Fix function tests for non-simd
1 parent 58e4fff commit 5f1a83e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Tests/FirebladeMathTests/FunctionTests.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,11 @@ final class FunctionTests: XCTestCase {
164164

165165
XCTAssertEqual(FirebladeMath.normalize(SIMD2<Float>(1, 2)), SIMD2<Float>(0.4472136, 0.8944272))
166166
XCTAssertEqual(FirebladeMath.normalize(SIMD3<Float>(1, 2, 3)), SIMD3<Float>(0.26726124, 0.5345225, 0.8017837))
167+
#if FRB_MATH_USE_SIMD
167168
XCTAssertEqual(FirebladeMath.normalize(SIMD4<Float>(1, 2, 3, 4)), SIMD4<Float>(0.18257417, 0.36514834, 0.5477225, 0.7302967))
169+
#else
170+
XCTAssertEqual(FirebladeMath.normalize(SIMD4<Float>(1, 2, 3, 4)), SIMD4<Float>(0.18257418, 0.36514837, 0.5477226, 0.73029673))
171+
#endif
168172
}
169173
func test_pow() {
170174
XCTAssertEqual(FirebladeMath.pow(Double(123), Double(2)), 15129.0)
@@ -188,7 +192,7 @@ final class FunctionTests: XCTestCase {
188192
}
189193
func test_rsqrt() {
190194
XCTAssertEqual(FirebladeMath.rsqrt(Double(123)), 0.09016696346674323)
191-
XCTAssertEqual(FirebladeMath.rsqrt(Float(123)), 0.090166956)
195+
XCTAssertEqual(FirebladeMath.rsqrt(Float(123)), 0.090166956, accuracy: 1e-8)
192196
}
193197
func test_sign() {
194198
XCTAssertEqual(FirebladeMath.sign(Double(123)), 1.0)

0 commit comments

Comments
 (0)