summaryrefslogtreecommitdiff
path: root/Source/UnitTests/Core
diff options
context:
space:
mode:
authorShawn Hoffman <godisgovernment@gmail.com>2023-02-22 12:55:12 -0800
committerShawn Hoffman <godisgovernment@gmail.com>2023-02-22 12:55:12 -0800
commit2c2fb869a22130aafbcc2e5b2586342f9854d5e1 (patch)
treefc9f904352720e39d364478b51dfc3ddc2e9766c /Source/UnitTests/Core
parentebd98226db78aeac5d8d4d1afb87e673989e2a04 (diff)
use std-provided randomness for JitArm64 unittests
decreases runtime significantly and lessens dependency on mbedtls
Diffstat (limited to 'Source/UnitTests/Core')
-rw-r--r--Source/UnitTests/Core/PowerPC/JitArm64/MovI2R.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/UnitTests/Core/PowerPC/JitArm64/MovI2R.cpp b/Source/UnitTests/Core/PowerPC/JitArm64/MovI2R.cpp
index 889878d43a..aa70617de9 100644
--- a/Source/UnitTests/Core/PowerPC/JitArm64/MovI2R.cpp
+++ b/Source/UnitTests/Core/PowerPC/JitArm64/MovI2R.cpp
@@ -2,12 +2,12 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#include <cstddef>
+#include <random>
#include <type_traits>
#include "Common/Arm64Emitter.h"
#include "Common/Assert.h"
#include "Common/BitUtils.h"
-#include "Common/Random.h"
#include <gtest/gtest.h>
@@ -59,11 +59,12 @@ public:
TEST(JitArm64, MovI2R_32BitValues)
{
- Common::Random::PRNG rng{0};
+ std::default_random_engine engine(0);
+ std::uniform_int_distribution<u32> dist;
TestMovI2R test;
for (u64 i = 0; i < 0x100000; i++)
{
- const u32 value = rng.GenerateValue<u32>();
+ const u32 value = dist(engine);
test.Check32(value);
test.Check64(value);
}
@@ -71,11 +72,12 @@ TEST(JitArm64, MovI2R_32BitValues)
TEST(JitArm64, MovI2R_Rand)
{
- Common::Random::PRNG rng{0};
+ std::default_random_engine engine(0);
+ std::uniform_int_distribution<u64> dist;
TestMovI2R test;
for (u64 i = 0; i < 0x100000; i++)
{
- test.Check64(rng.GenerateValue<u64>());
+ test.Check64(dist(engine));
}
}