tadd tests of temporal.jl functions - Granular.jl - Julia package for granular … | |
git clone git://src.adamsgaard.dk/Granular.jl | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 1841e4790b1b664103c96b8b486dbce12dc2c70a | |
parent e479a4b1311fe964447bee11d28c5b92a3299140 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Fri, 12 May 2017 19:41:47 -0400 | |
add tests of temporal.jl functions | |
Diffstat: | |
M test/runtests.jl | 1 + | |
A test/temporal.jl | 18 ++++++++++++++++++ | |
2 files changed, 19 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/test/runtests.jl b/test/runtests.jl | |
t@@ -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 | |
t@@ -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) | |
+ |