diff --git a/test/test_allocations.jl b/test/test_allocations.jl index 09c38a3..168c360 100644 --- a/test/test_allocations.jl +++ b/test/test_allocations.jl @@ -1,18 +1,9 @@ -function test_only_zeros(table) - for (key, vals) in table - if !isnan(vals) - @test vals == 0 - vals != 0 && println(key) - end - end -end - @testset "allocations" begin @testset "allocs QPSData" begin for problem in qp_problems_Matrix nlp_qps = eval(Symbol(problem * "_QPSData"))() allocs = test_allocs_nlpmodels(nlp_qps; linear_api = true, exclude = [jac_op]) - test_only_zeros(allocs) + test_zero_allocations(allocs) end end @@ -20,7 +11,7 @@ end for problem in qp_problems_Matrix nlp_qm_dense = eval(Symbol(problem * "_QP_dense"))() allocs = test_allocs_nlpmodels(nlp_qm_dense; linear_api = true, exclude = [jac_op]) - test_only_zeros(allocs) + test_zero_allocations(allocs) end end @@ -28,7 +19,7 @@ end for problem in qp_problems_COO nlp_qps = eval(Symbol(problem * "_QPSData"))() allocs = test_allocs_nlpmodels(nlp_qps; linear_api = true, exclude = [jac_op]) - test_only_zeros(allocs) + test_zero_allocations(allocs) end end @@ -36,7 +27,7 @@ end for problem in qp_problems_COO nlp_qm_dense = eval(Symbol(problem * "_QP"))() allocs = test_allocs_nlpmodels(nlp_qm_dense; linear_api = true, exclude = [jac_op]) - test_only_zeros(allocs) + test_zero_allocations(allocs) end end @@ -46,7 +37,7 @@ end x = nlp.meta.x0 nlp_qm = QuadraticModel(nlp, x) allocs = test_allocs_nlpmodels(nlp_qm; linear_api = true, exclude = [jac_op]) - test_only_zeros(allocs) + test_zero_allocations(allocs) end end end