Skip to content

Commit 204723a

Browse files
committed
Switch from @test to @Assert for performance-critical tests
1 parent 2ec4d19 commit 204723a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/fixed.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ using FixedPointNumbers
44
function test_op{F,T}(fun::F, ::Type{T}, fx, fy, fxf, fyf, tol)
55
# Make sure that the result is representable
66
(typemin(T) <= fun(fxf, fyf) <= typemax(T)) || return nothing
7-
@test abs(fun(fx, fy) - convert(T, fun(fxf, fyf))) <= tol
8-
@test abs(convert(Float64, fun(fx, fy)) - fun(fxf, fyf)) <= tol
7+
@assert abs(fun(fx, fy) - convert(T, fun(fxf, fyf))) <= tol
8+
@assert abs(convert(Float64, fun(fx, fy)) - fun(fxf, fyf)) <= tol
99
end
1010

1111
function test_fixed{T}(::Type{T}, f)
@@ -36,16 +36,16 @@ function test_fixed{T}(::Type{T}, f)
3636
fy = convert(T,y)
3737
fyf = convert(Float64, fy)
3838

39-
@test fx==fy || x!=y
40-
@test fx<fy || x>=y
41-
@test fx<=fy || x>y
39+
@assert fx==fy || x!=y
40+
@assert fx<fy || x>=y
41+
@assert fx<=fy || x>y
4242

4343
test_op(+, T, fx, fy, fxf, fyf, tol)
4444
test_op(-, T, fx, fy, fxf, fyf, tol)
4545
test_op(*, T, fx, fy, fxf, fyf, tol)
4646
fy != 0 && test_op(/, T, fx, fy, fxf, fyf, tol)
4747

48-
@test isequal(fx,fy) == isequal(hash(fx),hash(fy))
48+
@assert isequal(fx,fy) == isequal(hash(fx),hash(fy))
4949
end
5050
end
5151
end

0 commit comments

Comments
 (0)