commit 8ad2fc08e357501d4d0ad14790e0a13453c60a9a
parent 1841e4790b1b664103c96b8b486dbce12dc2c70a
Author: Anders Damsgaard <andersd@riseup.net>
Date: Fri, 12 May 2017 21:01:43 -0400
add more tests
Diffstat:
3 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/src/simulation.jl b/src/simulation.jl
@@ -142,16 +142,6 @@ function addIceFloe!(simulation::Simulation,
end
end
-export removeIceFloe!
-"Remove ice floe with index `i` from the `simulation` object."
-function removeIceFloe!(simulation::Simulation, i::Integer)
- if i < 1
- error("Index must be greater than 0 (i = $i)")
- end
-
- delete!(simulation.ice_floes, i)
-end
-
export disableIceFloe!
"Disable ice floe with index `i` in the `simulation` object."
function disableIceFloe!(simulation::Simulation, i::Integer)
diff --git a/test/icefloe.jl b/test/icefloe.jl
@@ -17,4 +17,5 @@ SeaIce.printIceFloeInfo(sim.ice_floes[1])
lin_acc=[.2,.2,.2])
@test_throws ErrorException SeaIce.addIceFloeCylindrical(sim, [.1, .1], 0., 1.)
@test_throws ErrorException SeaIce.addIceFloeCylindrical(sim, [.1, .1], 10., 1.,
-density=-2.)
+ density=-2.)
+@test_throws ErrorException SeaIce.disableIceFloe!(sim, 0)
diff --git a/test/netcdf.jl b/test/netcdf.jl
@@ -4,6 +4,9 @@
info("#### $(basename(@__FILE__)) ####")
+@test_throws ErrorException SeaIce.readOceanStateNetCDF("nonexistentfile")
+@test_throws ErrorException SeaIce.readOceanGridNetCDF("nonexistentfile")
+
info("Testing dimensions of content read from Baltic test case")
ocean = SeaIce.readOceanNetCDF("Baltic/00010101.ocean_month.nc",
"Baltic/ocean_hgrid.nc")
@@ -22,6 +25,7 @@ info("Testing ocean state interpolation")
@test_throws ErrorException SeaIce.interpolateOceanState(ocean, time=1.e34)
u1, v1, h1, e1 = SeaIce.interpolateOceanState(ocean, ocean.time[1])
u2, v2, h2, e2 = SeaIce.interpolateOceanState(ocean, ocean.time[2])
+@test_throws ErrorException SeaIce.interpolateOceanState(ocean, -1.)
u1_5, v1_5, h1_5, e1_5 = SeaIce.interpolateOceanState(ocean,
ocean.time[1] + (ocean.time[2] - ocean.time[1])/2.)
@test_approx_eq u1 ocean.u[:, :, :, 1]