Skip to content

Commit

Permalink
Test push! errors
Browse files Browse the repository at this point in the history
  • Loading branch information
abelsiqueira committed Jul 12, 2021
1 parent 62e6261 commit 7574588
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/test_lbfgs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,28 @@ function test_lbfgs()
@test nallocs == 0
end

@testset "push! errors" begin
n = 100
mem = 20
B = LBFGSOperator(n, mem = mem)
H = InverseLBFGSOperator(n, mem = mem)
BD = LBFGSOperator(n, mem = mem, damped = true)
HD = InverseLBFGSOperator(n, mem = mem, damped = true)
s = ones(n)
y = ones(n)
g = ones(n)
Bs = zeros(n)
@test_throws ErrorException push!(B, s, y, Bs)
@test_throws ErrorException push!(H, s, y, Bs)
@test_throws ErrorException push!(HD, s, y, Bs)
@test_throws ErrorException push!(B, s, y, 1.0, g)
@test_throws ErrorException push!(BD, s, y, 1.0, g)
@test_throws ErrorException push!(H, s, y, 1.0, g)
@test_throws ErrorException push!(B, s, y, 1.0, g, Bs)
@test_throws ErrorException push!(BD, s, y, 1.0, g, Bs)
@test_throws ErrorException push!(H, s, y, 1.0, g, Bs)
end

@testset "LBFGS eigenvalues" begin
n = 100
mem = 20
Expand Down

0 comments on commit 7574588

Please sign in to comment.