From dd319d46714d969f951d2bbb8d01f8c3ac529810 Mon Sep 17 00:00:00 2001 From: David Widmann Date: Tue, 26 Sep 2023 16:05:25 +0200 Subject: [PATCH] Improve tests for matrices with few elements --- test/testutils.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/testutils.jl b/test/testutils.jl index a4183d5..9807016 100644 --- a/test/testutils.jl +++ b/test/testutils.jl @@ -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