|
81 | 81 | SymbolicAWEModels.get_aero_force_override(sys, idx, 1) |
82 | 82 | SymbolicAWEModels.get_aero_moment_override(sys, idx, 1) |
83 | 83 |
|
| 84 | + # Julia 1.11 has extra allocations in @register_symbolic |
| 85 | + # accessors that 1.12+ optimizes away. |
| 86 | + v11 = VERSION < v"1.12" |
| 87 | + |
84 | 88 | @testset "@register_symbolic" begin |
85 | 89 | a = @allocations SymbolicAWEModels.get_l0(sys, idx) |
86 | | - @test a == 0 |
| 90 | + @test a <= (v11 ? 2 : 0) |
87 | 91 | a = @allocations SymbolicAWEModels.get_extra_mass( |
88 | 92 | sys, idx) |
89 | | - @test a == 0 |
| 93 | + @test a <= (v11 ? 2 : 0) |
90 | 94 | a = @allocations SymbolicAWEModels.get_pos_w( |
91 | 95 | sys, idx) |
92 | 96 | @test a <= 1 |
93 | 97 | a = @allocations SymbolicAWEModels.get_Q_b_to_w( |
94 | 98 | sys, idx) |
95 | | - @test a == 0 |
| 99 | + @test a <= (v11 ? 1 : 0) |
96 | 100 | a = @allocations SymbolicAWEModels.get_com_w( |
97 | 101 | sys, idx) |
98 | | - @test a == 0 |
| 102 | + @test a <= (v11 ? 1 : 0) |
99 | 103 | a = @allocations SymbolicAWEModels.get_R_b_to_p( |
100 | 104 | sys, idx) |
101 | | - @test a == 0 |
| 105 | + @test a <= (v11 ? 1 : 0) |
102 | 106 | a = @allocations SymbolicAWEModels.get_inertia_principal( |
103 | 107 | sys, idx) |
104 | | - @test a == 0 |
| 108 | + @test a <= (v11 ? 1 : 0) |
105 | 109 | end |
106 | 110 |
|
107 | 111 | @testset "VSM accessors" begin |
108 | 112 | a = @allocations SymbolicAWEModels.get_vsm_y( |
109 | 113 | sys, idx, 1) |
110 | | - @test a == 0 |
| 114 | + @test a <= (v11 ? 2 : 0) |
111 | 115 | a = @allocations SymbolicAWEModels.get_vsm_x( |
112 | 116 | sys, idx, 1) |
113 | | - @test a == 0 |
| 117 | + @test a <= (v11 ? 2 : 0) |
114 | 118 | a = @allocations SymbolicAWEModels.get_vsm_jac( |
115 | 119 | sys, idx, 1, 1) |
116 | 120 | @test a <= 2 |
|
119 | 123 | @test a <= 4 |
120 | 124 | a = @allocations SymbolicAWEModels.get_aero_moment_override( |
121 | 125 | sys, idx, 1) |
122 | | - @test a == 0 |
| 126 | + @test a <= (v11 ? 2 : 0) |
123 | 127 | end |
124 | 128 |
|
125 | 129 | @testset "No package allocations in RHS" begin |
|
0 commit comments