Skip to content

Commit 47cb402

Browse files
author
Avik Pal
committed
Patch the Static Arrays tests
1 parent 3b4f4ed commit 47cb402

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

Project.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,9 @@ Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
131131
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
132132
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
133133
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
134+
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
134135
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
135136
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
136137

137138
[targets]
138-
test = ["Aqua", "Test", "IterativeSolvers", "InteractiveUtils", "JET", "KrylovKit", "Pkg", "Random", "SafeTestsets", "MultiFloats", "ForwardDiff", "HYPRE", "MPI", "BlockDiagonals", "Enzyme", "FiniteDiff", "BandedMatrices", "FastAlmostBandedMatrices", "StaticArrays", "AllocCheck"]
139+
test = ["Aqua", "Test", "IterativeSolvers", "InteractiveUtils", "JET", "KrylovKit", "Pkg", "Random", "SafeTestsets", "MultiFloats", "ForwardDiff", "HYPRE", "MPI", "BlockDiagonals", "Enzyme", "FiniteDiff", "BandedMatrices", "FastAlmostBandedMatrices", "StaticArrays", "AllocCheck", "StableRNGs"]

test/static_arrays.jl

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
using LinearSolve, StaticArrays, LinearAlgebra, Test
1+
using LinearSolve, StaticArrays, LinearAlgebra, Test, StableRNGs
22
using AllocCheck
33

4-
A = SMatrix{5, 5}(Hermitian(rand(5, 5) + I))
5-
b = SVector{5}(rand(5))
4+
rng = StableRNG(0)
5+
6+
A = SMatrix{5, 5}(Hermitian(rand(rng, 5, 5) + I))
7+
b = SVector{5}(rand(rng, 5))
68

79
@check_allocs __solve_no_alloc(A, b, alg) = solve(LinearProblem(A, b), alg)
810

@@ -27,16 +29,16 @@ for alg in (nothing, LUFactorization(), SVDFactorization(), CholeskyFactorizatio
2729
@test norm(A * sol .- b) < 1e-10
2830
end
2931

30-
A = SMatrix{7, 5}(rand(7, 5))
31-
b = SVector{7}(rand(7))
32+
A = SMatrix{7, 5}(rand(rng, 7, 5))
33+
b = SVector{7}(rand(rng, 7))
3234

3335
for alg in (nothing, SVDFactorization(), KrylovJL_LSMR())
3436
@inferred solve(LinearProblem(A, b), alg)
3537
@test_nowarn solve(LinearProblem(A, b), alg)
3638
end
3739

38-
A = SMatrix{5, 7}(rand(5, 7))
39-
b = SVector{5}(rand(5))
40+
A = SMatrix{5, 7}(rand(rng, 5, 7))
41+
b = SVector{5}(rand(rng, 5))
4042

4143
for alg in (nothing, SVDFactorization(), KrylovJL_LSMR())
4244
@inferred solve(LinearProblem(A, b), alg)

0 commit comments

Comments
 (0)