commit 1841e4790b1b664103c96b8b486dbce12dc2c70a
parent e479a4b1311fe964447bee11d28c5b92a3299140
Author: Anders Damsgaard <andersd@riseup.net>
Date: Fri, 12 May 2017 19:41:47 -0400
add tests of temporal.jl functions
Diffstat:
2 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/test/runtests.jl b/test/runtests.jl
@@ -2,6 +2,7 @@ import SeaIce
using Base.Test
include("icefloe.jl")
+include("temporal.jl")
include("contact-search-and-geometry.jl")
include("collision-2floes-normal.jl")
include("collision-5floes-normal.jl")
diff --git a/test/temporal.jl b/test/temporal.jl
@@ -0,0 +1,18 @@
+info("Testing temporal functionality")
+
+sim = SeaIce.createSimulation()
+@test_throws ErrorException SeaIce.setTimeStep!(sim)
+
+SeaIce.setOutputFileInterval!(sim, 1e-9)
+@test_throws ErrorException SeaIce.setTotalTime!(sim, 0.)
+@test_throws ErrorException SeaIce.setCurrentTime!(sim, 0.)
+SeaIce.setCurrentTime!(sim, 1.)
+@test sim.time ≈ 1.0
+@test_throws ErrorException SeaIce.incrementCurrentTime!(sim, 0.)
+SeaIce.setOutputFileInterval!(sim, 0.)
+SeaIce.disableOutputFiles!(sim)
+@test_throws ErrorException SeaIce.checkTimeParameters(sim)
+SeaIce.addIceFloeCylindrical(sim, [.1,.1], 2., 2.)
+sim.ice_floes[1].mass = 0.
+@test_throws ErrorException SeaIce.setTimeStep!(sim)
+