Skip to content

Commit

Permalink
Improve tests for matrices with few elements
Browse files Browse the repository at this point in the history
  • Loading branch information
devmotion authored Sep 26, 2023
1 parent 3d9e965 commit dd319d4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/testutils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ function pdtest_cholesky(C::Union{PDMat, PDiagMat, ScalMat}, Cmat::Matrix, cmat_
# regression test: https://github.com/JuliaStats/PDMats.jl/pull/182
if C isa Union{PDiagMat, ScalMat}
size_of_sqrt_diag = C.dim * sizeof(float(eltype(C)))
@test (@allocated cholesky(C)) <= 1.05 * size_of_sqrt_diag # allow some overhead
# allow some overhead
max_allocations = max(1.05 * size_of_sqrt_diag, size_of_sqrt_diag + 96)
@test (@allocated cholesky(C)) <= max_allocations
end
end

Expand Down

0 comments on commit dd319d4

Please sign in to comment.