Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tmigot committed Jan 29, 2021
1 parent d8807e2 commit 01e4dbf
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/test-state/unit-test-GenericStatemod.jl
Expand Up @@ -42,3 +42,10 @@ reinit!(state0, current_time = 0.5)
@test ismissing(Main.Stopping._init_field(Missing))
@test !_init_field(typeof(true))
@test _init_field(typeof(1)) == -9223372036854775808

#_check_nan_miss
@test !Stopping._check_nan_miss(nothing)
@test !Stopping._check_nan_miss(Counters())
@test !Stopping._check_nan_miss(spzeros(0))
@test !Stopping._check_nan_miss(zeros(0))
@test !Stopping._check_nan_miss(missing)
6 changes: 6 additions & 0 deletions test/test-state/unit-test-NLPAtXmod.jl
Expand Up @@ -59,6 +59,12 @@ reinit!(uncons_nlp_at_x)
reinit!(uncons_nlp_at_x, x = zeros(10))
@test uncons_nlp_at_x.x == zeros(10)
@test isnan(uncons_nlp_at_x.fx)
reinit!(uncons_nlp_at_x, zeros(10))
@test uncons_nlp_at_x.x == zeros(10)
@test isnan(uncons_nlp_at_x.fx)
reinit!(uncons_nlp_at_x, zeros(10), l = zeros(0))
@test uncons_nlp_at_x.x == zeros(10)
@test isnan(uncons_nlp_at_x.fx)

c_uncons_nlp_at_x = copy_compress_state(uncons_nlp_at_x, max_vector_size = 5)

Expand Down
1 change: 1 addition & 0 deletions test/test-stopping/test-unitaire-generic-stopping.jl
Expand Up @@ -7,6 +7,7 @@
stop0 = GenericStopping(rosenbrock, state0, tol_check = (atol,rtol,opt0) -> atol + rtol * opt0, list = ListStates(state0) )

show(stop0)
stop0.listofstates[1]

meta = StoppingMeta(tol_check = (atol,rtol,opt0) -> atol + rtol * opt0)
stop0_meta = GenericStopping(rosenbrock, meta, state0, list = ListStates(state0))
Expand Down

0 comments on commit 01e4dbf

Please sign in to comment.