Skip to content

Commit cd8c174

Browse files
authored
Merge pull request #32 from GregPlowman/GregPlowman/bigcrushJulia
Avoid trunc error in smarsa_BirthSpacings in bigcrushJulia
2 parents 4920b41 + e8245a1 commit cd8c174

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/RNGTest.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,11 @@ module RNGTest
964964
g->smarsa_CollisionOver(g, 30, 2*10^7, 27, 8, 14),
965965
g->smarsa_CollisionOver(g, 30, 2*10^7, 0, 4, 21),
966966
g->smarsa_CollisionOver(g, 30, 2*10^7, 28, 4, 21),
967-
g->smarsa_BirthdaySpacings(g, 100, 10^7, 0, 2^31, 2, 1),
967+
if typemax(Clong) < 2^31 # On Windows Clong is defined as Int32
968+
g->smarsa_BirthdaySpacings(g, 250, 4*10^6, 0, 2^30, 2, 1)
969+
else
970+
g->smarsa_BirthdaySpacings(g, 100, 10^7, 0, 2^31, 2, 1)
971+
end,
968972
g->smarsa_BirthdaySpacings(g, 20, 2*10^7, 0, 2^21, 3, 1),
969973
g->smarsa_BirthdaySpacings(g, 20, 3*10^7, 14, 2^16, 4, 1),
970974
g->smarsa_BirthdaySpacings(g, 20, 2*10^7, 0, 2^9, 7, 1),

test/runtests.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ pval = 0.001
88
@testset "smarsa" begin
99
@testset "BirthdaySpacings" begin
1010
@test RNGTest.smarsa_BirthdaySpacings(f, 1, 5000000, 0, 1073741824, 2, 1) > pval
11+
12+
# Issue28: smarsa_BirthdaySpacing called in bigcrushJulia
13+
if typemax(Clong) < 2^31 # On Windows Clong is defined as Int32
14+
@test RNGTest.smarsa_BirthdaySpacings(f, 250, 4*10^6, 0, 2^30, 2, 1) > pval
15+
else
16+
@test RNGTest.smarsa_BirthdaySpacings(f, 100, 10^7, 0, 2^31, 2, 1) > pval
17+
end
1118
end
1219

1320
@testset "MatrixRank" begin

0 commit comments

Comments
 (0)