Skip to content

Commit c0b930a

Browse files
test: make test robust to numerical issues
1 parent 4af6b98 commit c0b930a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

test/Thermal/piston.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ using ModelingToolkitStandardLibrary.Blocks
4141
@test SciMLBase.successful_retcode(sol)
4242
# The initial value doesn't add up to absolute zero, while the rest do. To avoid
4343
# tolerance on the latter, the test is split in two parts.
44-
@test sol[piston.gas.Q_flow][1] + sol[piston.coolant.Q_flow][1]0 atol=1e-6
45-
@test sol[piston.gas.Q_flow][2:end] +
46-
sol[piston.coolant.Q_flow][2:end]
47-
zeros(length(sol) - 1) atol=1e-6
44+
@test sol[piston.gas.Q_flow][1]-sol[piston.coolant.Q_flow][1] rtol=1e-6
45+
@test sol[piston.gas.Q_flow][2:end]-sol[piston.coolant.Q_flow][2:end] rtol=1e-6
4846
end

0 commit comments

Comments
 (0)