diff --git a/test/allocation_test.jl b/test/allocation_test.jl index 9378da6..9788217 100644 --- a/test/allocation_test.jl +++ b/test/allocation_test.jl @@ -20,21 +20,23 @@ function alloc_solve_model(solve, XData, H, g, ng, calls, max_calls, α) return nothing end -@testset "Allocation test in preprocess and solvemodel" for (Data, solve) in ( - (PDataKARC, AdaptiveRegularization.solve_modelKARC), - (PDataTRK, AdaptiveRegularization.solve_modelTRK), - (PDataST, AdaptiveRegularization.solve_modelST_TR), -) - XData = Data(S, T, n) - @testset "Allocation test in preprocess with $(Data)" begin - alloc_preprocess(XData, H, g, ng, calls, max_calls, α) - al = @allocated alloc_preprocess(XData, H, g, ng, calls, max_calls, α) - @test al == 0 - end +@testset "Allocation test in preprocess and solvemodel" begin + for (Data, solve) in ( + (PDataKARC, AdaptiveRegularization.solve_modelKARC), + (PDataTRK, AdaptiveRegularization.solve_modelTRK), + (PDataST, AdaptiveRegularization.solve_modelST_TR), + ) + XData = Data(S, T, n) + @testset "Allocation test in preprocess with $(Data)" begin + alloc_preprocess(XData, H, g, ng, calls, max_calls, α) + al = @allocated alloc_preprocess(XData, H, g, ng, calls, max_calls, α) + @test al == 0 + end - @testset "Allocation test in $solve with $(Data)" begin - alloc_solve_model(solve, XData, H, g, ng, calls, max_calls, α) - al = @allocated alloc_solve_model(solve, XData, H, g, ng, calls, max_calls, α) - @test al == 0 + @testset "Allocation test in $solve with $(Data)" begin + alloc_solve_model(solve, XData, H, g, ng, calls, max_calls, α) + al = @allocated alloc_solve_model(solve, XData, H, g, ng, calls, max_calls, α) + @test al == 0 + end end end