Skip to content

Commit 813e067

Browse files
authored
[Test] change exact comparison to approx (#1593)
1 parent 5a0bd4f commit 813e067

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

src/Test/test_conic.jl

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6529,7 +6529,7 @@ function test_conic_SecondOrderCone_no_initial_bound(
65296529
MOI.set(model, MOI.ObjectiveFunction{MOI.VariableIndex}(), t)
65306530
MOI.set(model, MOI.ObjectiveSense(), MOI.MIN_SENSE)
65316531
MOI.optimize!(model)
6532-
@test MOI.get(model, MOI.VariablePrimal(), t) == 5.0
6532+
@test isapprox(MOI.get(model, MOI.VariablePrimal(), t), 5.0, config)
65336533
MOI.delete(model, c_soc)
65346534
MOI.optimize!(model)
65356535
@test MOI.get(model, MOI.TerminationStatus()) == MOI.DUAL_INFEASIBLE
@@ -6583,10 +6583,10 @@ function test_conic_SecondOrderCone_nonnegative_initial_bound(
65836583
MOI.set(model, MOI.ObjectiveFunction{MOI.VariableIndex}(), t)
65846584
MOI.set(model, MOI.ObjectiveSense(), MOI.MIN_SENSE)
65856585
MOI.optimize!(model)
6586-
@test MOI.get(model, MOI.VariablePrimal(), t) == 5.0
6586+
@test isapprox(MOI.get(model, MOI.VariablePrimal(), t), 5.0, config)
65876587
MOI.delete(model, c_soc)
65886588
MOI.optimize!(model)
6589-
@test MOI.get(model, MOI.VariablePrimal(), t) == 1.0
6589+
@test isapprox(MOI.get(model, MOI.VariablePrimal(), t), 1.0, config)
65906590
return
65916591
end
65926592

@@ -6637,10 +6637,10 @@ function test_conic_SecondOrderCone_negative_initial_bound(
66376637
MOI.optimize!(model)
66386638
MOI.set(model, MOI.ObjectiveFunction{MOI.VariableIndex}(), t)
66396639
MOI.set(model, MOI.ObjectiveSense(), MOI.MIN_SENSE)
6640-
@test MOI.get(model, MOI.VariablePrimal(), t) == 5.0
6640+
@test isapprox(MOI.get(model, MOI.VariablePrimal(), t), 5.0, config)
66416641
MOI.delete(model, c_soc)
66426642
MOI.optimize!(model)
6643-
@test MOI.get(model, MOI.VariablePrimal(), t) == -1.0
6643+
@test isapprox(MOI.get(model, MOI.VariablePrimal(), t), -1.0, config)
66446644
return
66456645
end
66466646

@@ -6691,10 +6691,10 @@ function test_conic_SecondOrderCone_nonnegative_post_bound(
66916691
MOI.set(model, MOI.ObjectiveFunction{MOI.VariableIndex}(), t)
66926692
MOI.set(model, MOI.ObjectiveSense(), MOI.MIN_SENSE)
66936693
MOI.optimize!(model)
6694-
@test MOI.get(model, MOI.VariablePrimal(), t) == 6.0
6694+
@test isapprox(MOI.get(model, MOI.VariablePrimal(), t), 6.0, config)
66956695
MOI.delete(model, c_lb)
66966696
MOI.optimize!(model)
6697-
@test MOI.get(model, MOI.VariablePrimal(), t) == 5.0
6697+
@test isapprox(MOI.get(model, MOI.VariablePrimal(), t), 5.0, config)
66986698
return
66996699
end
67006700

@@ -6745,10 +6745,10 @@ function test_conic_SecondOrderCone_negative_post_bound(
67456745
MOI.set(model, MOI.ObjectiveFunction{MOI.VariableIndex}(), t)
67466746
MOI.set(model, MOI.ObjectiveSense(), MOI.MIN_SENSE)
67476747
MOI.optimize!(model)
6748-
@test MOI.get(model, MOI.VariablePrimal(), t) == 5.0
6748+
@test isapprox(MOI.get(model, MOI.VariablePrimal(), t), 5.0, config)
67496749
MOI.delete(model, c_soc)
67506750
MOI.optimize!(model)
6751-
@test MOI.get(model, MOI.VariablePrimal(), t) == -6.0
6751+
@test isapprox(MOI.get(model, MOI.VariablePrimal(), t), -6.0, config)
67526752
return
67536753
end
67546754

@@ -6800,10 +6800,10 @@ function test_conic_SecondOrderCone_negative_post_bound_ii(
68006800
MOI.set(model, MOI.ObjectiveFunction{MOI.VariableIndex}(), t)
68016801
MOI.set(model, MOI.ObjectiveSense(), MOI.MIN_SENSE)
68026802
MOI.optimize!(model)
6803-
@test MOI.get(model, MOI.VariablePrimal(), t) == 5.0
6803+
@test isapprox(MOI.get(model, MOI.VariablePrimal(), t), 5.0, config)
68046804
MOI.delete(model, c_lb)
68056805
MOI.optimize!(model)
6806-
@test MOI.get(model, MOI.VariablePrimal(), t) == 5.0
6806+
@test isapprox(MOI.get(model, MOI.VariablePrimal(), t), 5.0, config)
68076807
MOI.delete(model, c_soc)
68086808
MOI.optimize!(model)
68096809
@test MOI.get(model, MOI.TerminationStatus()) == MOI.DUAL_INFEASIBLE
@@ -6861,10 +6861,10 @@ function test_conic_SecondOrderCone_negative_post_bound_iii(
68616861
MOI.set(model, MOI.ObjectiveFunction{MOI.VariableIndex}(), t)
68626862
MOI.set(model, MOI.ObjectiveSense(), MOI.MIN_SENSE)
68636863
MOI.optimize!(model)
6864-
@test MOI.get(model, MOI.VariablePrimal(), t) == 5.0
6864+
@test isapprox(MOI.get(model, MOI.VariablePrimal(), t), 5.0, config)
68656865
MOI.delete(model, c_lb)
68666866
MOI.optimize!(model)
6867-
@test MOI.get(model, MOI.VariablePrimal(), t) == 5.0
6867+
@test isapprox(MOI.get(model, MOI.VariablePrimal(), t), 5.0, config)
68686868
MOI.delete(model, c_soc)
68696869
MOI.optimize!(model)
68706870
@test MOI.get(model, MOI.TerminationStatus()) == MOI.DUAL_INFEASIBLE

0 commit comments

Comments
 (0)