Skip to content

Commit a538376

Browse files
committed
Gate tests for AVX2 for Shishua
1 parent e3b9348 commit a538376

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/Fast.PRNGs.Tests/ShishuaTests.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ public sealed class ShishuaTests
77
{
88
public void DoubleDistributionTest()
99
{
10+
if (!Shishua.IsSupported)
11+
return;
12+
1013
var baselinePrng = new Random();
1114
using var prng = Shishua.Create();
1215

@@ -44,23 +47,35 @@ public void DoubleDistributionTest()
4447

4548
public void InitFromNothing()
4649
{
50+
if (!Shishua.IsSupported)
51+
return;
52+
4753
using var _ = Shishua.Create();
4854
}
4955

5056
public void InitFromNew()
5157
{
58+
if (!Shishua.IsSupported)
59+
return;
60+
5261
using var _ = Shishua.Create(new Random());
5362
}
5463

5564
public void InitFromBytes()
5665
{
66+
if (!Shishua.IsSupported)
67+
return;
68+
5769
Span<byte> seedBytes = stackalloc byte[32];
5870
Random.Shared.NextBytes(seedBytes);
5971
using var _ = Shishua.Create(seedBytes);
6072
}
6173

6274
public void FailsWhenGivenWrongSizeSeed()
6375
{
76+
if (!Shishua.IsSupported)
77+
return;
78+
6479
Assert.Throws<ArgumentException>(() => {
6580
Span<byte> seedBytes = stackalloc byte[33];
6681
using var _ = Shishua.Create(seedBytes);

0 commit comments

Comments
 (0)