1
+ function test_only_zeros (table)
2
+ for (key, vals) in table
3
+ if ! isnan (vals)
4
+ @test vals == 0
5
+ vals != 0 && println (key)
6
+ end
7
+ end
8
+ end
9
+
10
+ @testset " allocations" begin
11
+ @testset " allocs QPSData" begin
12
+ for problem in qp_problems_Matrix
13
+ nlp_qps = eval (Symbol (problem * " _QPSData" ))()
14
+ test_only_zeros (test_allocs_nlpmodels (nlp_qps))
15
+ end
16
+ end
17
+
18
+ @testset " allocs QP_dense" begin
19
+ for problem in qp_problems_Matrix
20
+ nlp_qm_dense = eval (Symbol (problem * " _QP_dense" ))()
21
+ test_only_zeros (test_allocs_nlpmodels (nlp_qm_dense))
22
+ end
23
+ end
24
+
25
+ @testset " allocs COO QPSData" begin
26
+ for problem in qp_problems_COO
27
+ nlp_qps = eval (Symbol (problem * " _QPSData" ))()
28
+ test_only_zeros (test_allocs_nlpmodels (nlp_qps))
29
+ end
30
+ end
31
+
32
+ @testset " allocs COO QP" begin
33
+ for problem in qp_problems_COO
34
+ nlp_qm_dense = eval (Symbol (problem * " _QP" ))()
35
+ test_only_zeros (test_allocs_nlpmodels (nlp_qm_dense))
36
+ end
37
+ end
38
+
39
+ @testset " allocs quadratic approximation" begin
40
+ for problem in NLPModelsTest. nlp_problems
41
+ nlp = eval (Symbol (problem))()
42
+ x = nlp. meta. x0
43
+ nlp_qm = QuadraticModel (nlp, x)
44
+ test_only_zeros (test_allocs_nlpmodels (nlp_qm))
45
+ end
46
+ end
47
+ end
0 commit comments