Skip to content

Commit

Permalink
Minor fix for allocations test
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoninKns authored and dpo committed Jun 3, 2022
1 parent 1d89a6d commit 1f2dc06
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/nlp/counters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ if VERSION ≥ VersionNumber(1, 7, 3)
@testset "Allocations for NLP counters" begin
nlp = SimpleNLPModel()

increment!(nlp, :neval_obj)
alloc_mem = @allocated increment!(nlp, :neval_obj)
@test alloc_mem == 0
end
Expand Down
2 changes: 2 additions & 0 deletions test/nls/counters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ if VERSION ≥ VersionNumber(1, 7, 3)
@testset "Allocations for NLS counters" begin
nls = SimpleNLSModel()

increment!(nls, :neval_obj)
alloc_mem = @allocated increment!(nls, :neval_obj)
@test alloc_mem == 0

increment!(nls, :neval_residual)
alloc_mem2 = @allocated increment!(nls, :neval_residual)
@test alloc_mem2 == 0
end
Expand Down

0 comments on commit 1f2dc06

Please sign in to comment.