Namespacified tests aswell

This commit is contained in:
Leonetienne 2022-03-06 20:05:34 +01:00
parent be63652df6
commit da18c59969
20 changed files with 35 additions and 37 deletions

View File

@ -583,31 +583,29 @@ namespace Leonetienne::Eule {
return true; return true;
} }
namespace Eule { std::ostream &operator<<(std::ostream &os, const Matrix4x4 &m) {
std::ostream &operator<<(std::ostream &os, const Matrix4x4 &m) { os << std::endl;
os << std::endl;
for (std::size_t y = 0; y < 4; y++) { for (std::size_t y = 0; y < 4; y++) {
for (std::size_t x = 0; x < 4; x++) for (std::size_t x = 0; x < 4; x++)
os << " | " << m[y][x]; os << " | " << m[y][x];
os << " |" << std::endl; os << " |" << std::endl;
}
return os;
} }
std::wostream &operator<<(std::wostream &os, const Matrix4x4 &m) { return os;
os << std::endl; }
for (std::size_t y = 0; y < 4; y++) { std::wostream &operator<<(std::wostream &os, const Matrix4x4 &m) {
for (std::size_t x = 0; x < 4; x++) os << std::endl;
os << L" | " << m[y][x];
os << L" |" << std::endl; for (std::size_t y = 0; y < 4; y++) {
} for (std::size_t x = 0; x < 4; x++)
os << L" | " << m[y][x];
return os; os << L" |" << std::endl;
} }
return os;
} }
} }

View File

@ -1,7 +1,7 @@
#include "Catch2.h" #include "Catch2.h"
#include <Eule/Math.h> #include <Eule/Math.h>
using namespace Eule; using namespace Leonetienne::Eule;
/** Equivalence classes: /** Equivalence classes:
* -- value > 0 * -- value > 0

View File

@ -1,7 +1,7 @@
#include "Catch2.h" #include "Catch2.h"
#include <Eule/Math.h> #include <Eule/Math.h>
using namespace Eule; using namespace Leonetienne::Eule;
/** Equivalence classes: /** Equivalence classes:
* -- min < v < max -> v * -- min < v < max -> v

View File

@ -1,7 +1,7 @@
#include "Catch2.h" #include "Catch2.h"
#include <Eule/Math.h> #include <Eule/Math.h>
using namespace Eule; using namespace Leonetienne::Eule;
/** Equivalence classes: /** Equivalence classes:
* -- a < b, 0 < t < 1 -> a < result < b * -- a < b, 0 < t < 1 -> a < result < b

View File

@ -1,7 +1,7 @@
#include "Catch2.h" #include "Catch2.h"
#include <Eule/Math.h> #include <Eule/Math.h>
using namespace Eule; using namespace Leonetienne::Eule;
/** Equivalence classes: /** Equivalence classes:
* -- a < b * -- a < b

View File

@ -1,7 +1,7 @@
#include "Catch2.h" #include "Catch2.h"
#include <Eule/Math.h> #include <Eule/Math.h>
using namespace Eule; using namespace Leonetienne::Eule;
/** Equivalence classes: /** Equivalence classes:
* -- min < v < max * -- min < v < max

View File

@ -2,7 +2,7 @@
#include <Eule/Math.h> #include <Eule/Math.h>
#include <stdexcept> #include <stdexcept>
using namespace Eule; using namespace Leonetienne::Eule;
/** Equivalence classes: /** Equivalence classes:
* a -> numerator * a -> numerator

View File

@ -4,7 +4,7 @@
#include <Eule/Math.h> #include <Eule/Math.h>
#include <Eule/Constants.h> #include <Eule/Constants.h>
using namespace Eule; using namespace Leonetienne::Eule;
// Checks that an oscillation of speed 1 between -1 and 1 is just equal to sin(counter*pi-pi/2) // Checks that an oscillation of speed 1 between -1 and 1 is just equal to sin(counter*pi-pi/2)
TEST_CASE(__FILE__"/Oracle_Sin", "[Math][Oscillate]") TEST_CASE(__FILE__"/Oracle_Sin", "[Math][Oscillate]")

View File

@ -1,7 +1,7 @@
#include "Catch2.h" #include "Catch2.h"
#include <Eule/Math.h> #include <Eule/Math.h>
using namespace Eule; using namespace Leonetienne::Eule;
// Checks that the similar function works with an exact comparison -> true // Checks that the similar function works with an exact comparison -> true
TEST_CASE(__FILE__"/Exact_Comparison_True", "[Math][Similar]") TEST_CASE(__FILE__"/Exact_Comparison_True", "[Math][Similar]")

View File

@ -4,7 +4,7 @@
#include "../_TestingUtilities/HandyMacros.h" #include "../_TestingUtilities/HandyMacros.h"
#include <random> #include <random>
using namespace Eule; using namespace Leonetienne::Eule;
namespace { namespace {
static std::mt19937 rng = std::mt19937((std::random_device())()); static std::mt19937 rng = std::mt19937((std::random_device())());

View File

@ -5,7 +5,7 @@
#include <random> #include <random>
#include <sstream> #include <sstream>
using namespace Eule; using namespace Leonetienne::Eule;
namespace { namespace {
static std::mt19937 rng = std::mt19937((std::random_device())()); static std::mt19937 rng = std::mt19937((std::random_device())());

View File

@ -4,7 +4,7 @@
#include <array> #include <array>
#include <sstream> #include <sstream>
using namespace Eule; using namespace Leonetienne::Eule;
// Checks that a random integer is never outside the specification, two positive values // Checks that a random integer is never outside the specification, two positive values
TEST_CASE(__FILE__"/Never_Outside_Specification__pos__pos", "[Random][RandomIntRange]") TEST_CASE(__FILE__"/Never_Outside_Specification__pos__pos", "[Random][RandomIntRange]")

View File

@ -1,7 +1,7 @@
#include "Catch2.h" #include "Catch2.h"
#include <Eule/Random.h> #include <Eule/Random.h>
using namespace Eule; using namespace Leonetienne::Eule;
// Checks that all values are always 0 <= v <= 1 // Checks that all values are always 0 <= v <= 1
TEST_CASE(__FILE__"/Always_Satisfies_0_lt_v_lt_1", "[Random][RandomFloat]") TEST_CASE(__FILE__"/Always_Satisfies_0_lt_v_lt_1", "[Random][RandomFloat]")

View File

@ -3,7 +3,7 @@
#include <Eule/Random.h> #include <Eule/Random.h>
#include <array> #include <array>
using namespace Eule; using namespace Leonetienne::Eule;
// Checks that the produced unsigned-integer distribution shows a big standard deviation // Checks that the produced unsigned-integer distribution shows a big standard deviation
TEST_CASE(__FILE__"/Uint_Big_Standard_Deviation", "[Random][RandomInt]") TEST_CASE(__FILE__"/Uint_Big_Standard_Deviation", "[Random][RandomInt]")

View File

@ -3,7 +3,7 @@
#include <Eule/Random.h> #include <Eule/Random.h>
#include <array> #include <array>
using namespace Eule; using namespace Leonetienne::Eule;
// Checks that a random double is never outside the specification, two positive values // Checks that a random double is never outside the specification, two positive values
TEST_CASE(__FILE__"/Random_Doublerange_Never_Outside_Specification__pos__pos", "[Random][RandomRange]") TEST_CASE(__FILE__"/Random_Doublerange_Never_Outside_Specification__pos__pos", "[Random][RandomRange]")

View File

@ -4,7 +4,7 @@
#include <random> #include <random>
#include <array> #include <array>
using namespace Eule; using namespace Leonetienne::Eule;
using TPC = TrapazoidalPrismCollider; using TPC = TrapazoidalPrismCollider;
namespace { namespace {

View File

@ -5,7 +5,7 @@
#include <random> #include <random>
#include <sstream> #include <sstream>
using namespace Eule; using namespace Leonetienne::Eule;
namespace { namespace {
static std::mt19937 rng = std::mt19937((std::random_device())()); static std::mt19937 rng = std::mt19937((std::random_device())());

View File

@ -4,7 +4,7 @@
#include "../_TestingUtilities/HandyMacros.h" #include "../_TestingUtilities/HandyMacros.h"
#include <random> #include <random>
using namespace Eule; using namespace Leonetienne::Eule;
namespace { namespace {
static std::mt19937 rng = std::mt19937((std::random_device())()); static std::mt19937 rng = std::mt19937((std::random_device())());

View File

@ -5,7 +5,7 @@
#include <_TestingUtilities/HandyMacros.h> #include <_TestingUtilities/HandyMacros.h>
#include <random> #include <random>
using namespace Eule; using namespace Leonetienne::Eule;
namespace { namespace {
static std::mt19937 rng = std::mt19937((std::random_device())()); static std::mt19937 rng = std::mt19937((std::random_device())());

View File

@ -6,7 +6,7 @@
#include <random> #include <random>
#include <sstream> #include <sstream>
using namespace Eule; using namespace Leonetienne::Eule;
namespace { namespace {
static std::mt19937 rng = std::mt19937((std::random_device())()); static std::mt19937 rng = std::mt19937((std::random_device())());