Skip to content

Commit f639d02

Browse files
committed
🚨 Add tests for random generation of CRP and MRP
1 parent a9c88c3 commit f639d02

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

test/random.jl

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,53 @@ end
136136
q = rand(StableRNG(1986), Quaternion{Float32})
137137
@test q q_exp atol = 1e-15
138138
end
139+
140+
@testset "CRP (Float64)" begin
141+
c_exp = CRP(
142+
-1.8520630312725974,
143+
-24.266971356535347,
144+
-4.418926089538365
145+
)
146+
147+
c = rand(StableRNG(1986), CRP)
148+
@test c c_exp atol = 1e-15
149+
150+
c = rand(StableRNG(1986), CRP{Float64})
151+
@test c c_exp atol = 1e-15
152+
end
153+
154+
@testset "CRP (Float32)" begin
155+
c_exp = CRP(
156+
0.049937766f0,
157+
0.7139188f0,
158+
-0.5100343f0
159+
)
160+
161+
c = rand(StableRNG(1986), CRP{Float32})
162+
@test c c_exp atol = 1e-15
163+
end
164+
165+
@testset "MRP (Float64)" begin
166+
m_exp = MRP(
167+
-0.07190895825384126,
168+
-0.9421993748372708,
169+
-0.17157103529089043
170+
)
171+
172+
m = rand(StableRNG(1986), MRP)
173+
@test m m_exp atol = 1e-15
174+
175+
m = rand(StableRNG(1986), MRP{Float64})
176+
@test m m_exp atol = 1e-15
177+
end
178+
179+
@testset "MRP (Float32)" begin
180+
m_exp = MRP(
181+
0.021420741f0,
182+
0.30623457f0,
183+
-0.21877857f0
184+
)
185+
186+
m = rand(StableRNG(1986), MRP{Float32})
187+
@test m m_exp atol = 1e-15
188+
end

0 commit comments

Comments
 (0)