Skip to content

Commit

Permalink
bug fix: lingering FactCheck constructs now changed
Browse files Browse the repository at this point in the history
  • Loading branch information
robertfeldt committed Sep 22, 2016
1 parent a4293e9 commit 280b19c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions test/problems/test_single_objective.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@test sphere([1, 2]) == 5
@test sphere([1, 2, 3]) == 14
@test sphere([-1, 2, -3]) == 14
@fact_throws sphere([])
@test_throws MethodError sphere([])

p2 = instantiate(p, 3)
@test numdims(p2) == 3
Expand All @@ -25,7 +25,7 @@ end
@test schwefel2_22([1, 2]) == (1+2)+(1*2)
@test schwefel2_22([1, 2, 3]) == (1+2+3)+(1*2*3)
@test schwefel2_22([-1, 2, -3]) == (1+2+3)+(1*2*3)
@fact_throws schwefel2_22([])
@test_throws MethodError schwefel2_22([])

p2 = instantiate(p, 4)
@test numdims(p2) == 4
Expand Down Expand Up @@ -53,7 +53,7 @@ end
@test schwefel2_21([1, 2]) == 2
@test schwefel2_21([1, 2, 3]) == 3
@test schwefel2_21([-1, 2, -3]) == 3
@fact_throws schwefel2_21([])
@test_throws MethodError schwefel2_21([])
end

@testset "Rosenbrock" begin
Expand All @@ -63,7 +63,7 @@ end
@test rosenbrock([1, 2]) == 100
@test rosenbrock([1, 2, 3]) == 201
@test rosenbrock([-1, 2, -3]) == 5005
@fact_throws rosenbrock([])
@test_throws MethodError rosenbrock([])
end

end
8 changes: 4 additions & 4 deletions test/test_borg_moea.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
FitnessScheme=ParetoFitnessScheme{2}(is_minimizing=true),
SearchRange=(-10.0, 10.0), NumDimensions=2, ϵ=0.01,
MaxSteps=5000, TraceMode=:silent)
@fact BlackBoxOptim.IGD(BlackBoxOptim.Schaffer1Family.opt_value, pareto_frontier(res),
fitness_scheme(res), Val{length(best_candidate(res))}) --> less_than(0.05)
@test BlackBoxOptim.IGD(BlackBoxOptim.Schaffer1Family.opt_value, pareto_frontier(res),
fitness_scheme(res), Val{length(best_candidate(res))}) < 0.05
end
@testset "CEC09_UP8" begin
res = bboptimize(BlackBoxOptim.CEC09_Unconstrained_Set[8]; Method=:borg_moea,
NumDimensions=4, ϵ=0.025,
MaxSteps=50000, TraceMode=:silent)
@fact BlackBoxOptim.IGD(BlackBoxOptim.CEC09_Unconstrained_Set[8].opt_value, pareto_frontier(res),
fitness_scheme(res), Val{length(best_candidate(res))}) --> less_than(0.13)
@test BlackBoxOptim.IGD(BlackBoxOptim.CEC09_Unconstrained_Set[8].opt_value, pareto_frontier(res),
fitness_scheme(res), Val{length(best_candidate(res))}) < 0.13
end
end
6 changes: 3 additions & 3 deletions test/test_direct_search_with_probabilistic_descent.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ end
@test ds2[:,6] == -ds2[:,3]

# Must be even number of directions
@fact_throws BlackBoxOptim.MirroredRandomDirectionGen(10, 1)
@fact_throws BlackBoxOptim.MirroredRandomDirectionGen(10, 3)
@fact_throws BlackBoxOptim.MirroredRandomDirectionGen(10, 7)
@test_throws ArgumentError BlackBoxOptim.MirroredRandomDirectionGen(10, 1)
@test_throws ArgumentError BlackBoxOptim.MirroredRandomDirectionGen(10, 3)
@test_throws ArgumentError BlackBoxOptim.MirroredRandomDirectionGen(10, 7)

end
2 changes: 1 addition & 1 deletion test/test_toplevel_bboptimize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ end
i = 0 # reset the counter, otherwise it will throw in the setup
optctrl = bbsetup(rosenbrock_throwing; SearchRange = (-5.0, 5.0), NumDimensions = 100,
MaxSteps=100, TraceMode=:silent, RecoverResults=false)
@fact_throws InterruptException bboptimize(optctrl)
@test_throws InterruptException bboptimize(optctrl)
end
end

Expand Down

0 comments on commit 280b19c

Please sign in to comment.