diff options
author | Johannes Schauer Marin Rodrigues <josch@debian.org> | 2023-10-28 08:25:04 +0200 |
---|---|---|
committer | Johannes Schauer Marin Rodrigues <josch@debian.org> | 2023-10-28 08:25:04 +0200 |
commit | 23856a28f4cd0f34d9c44d373ed600070453d427 (patch) | |
tree | 0b9dda532bdb0485ae6385bac237044c39dbc0a1 /fuzzylite/test/variable/VariableTest.cpp | |
parent | f8b0a9c07c57de3dff307667a72c505831243f97 (diff) |
catch2v3
Gbp-Pq: Name catch2v3
Diffstat (limited to 'fuzzylite/test/variable/VariableTest.cpp')
-rw-r--r-- | fuzzylite/test/variable/VariableTest.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fuzzylite/test/variable/VariableTest.cpp b/fuzzylite/test/variable/VariableTest.cpp index 11f3794..f3df653 100644 --- a/fuzzylite/test/variable/VariableTest.cpp +++ b/fuzzylite/test/variable/VariableTest.cpp @@ -14,13 +14,15 @@ fuzzylite is a registered trademark of FuzzyLite Limited. */ -#include "catch2/catch.hpp" +#include "catch2/catch_all.hpp" #include "fl/Headers.h" -#include <algorithm> // std::random_shuffle +#include <algorithm> // std::shuffle namespace fl { + auto rng = std::default_random_engine{ std::random_device{}() }; + /** * Tests: variable/Variable * @@ -33,7 +35,7 @@ namespace fl { for (int i = 0; i <= 20; ++i) { variable.addTerm(new Constant(Op::str(i), i - 10)); } - std::random_shuffle(variable.terms().begin(), variable.terms().end()); + std::shuffle(variable.terms().begin(), variable.terms().end(), rng); FL_DBG(variable.toString()); REQUIRE(variable.numberOfTerms() == 21); variable.sort(); @@ -53,7 +55,7 @@ namespace fl { for (int i = 0; i <= 20; ++i) { variable.addTerm(new Triangle(Op::str(i), i - 1, i, i + 1)); } - std::random_shuffle(variable.terms().begin(), variable.terms().end()); + std::shuffle(variable.terms().begin(), variable.terms().end(), rng); FL_DBG(variable.toString()); REQUIRE(variable.numberOfTerms() == 21); variable.sort(); |