Move ComputeTest,GraphicsTest,RenderTest and Std140Debug to the tests folder

Also renamed NazaraUnitTests to UnitTests
This commit is contained in:
SirLynix
2022-12-26 08:44:11 +01:00
parent fe8715f1fb
commit 4b804dc613
71 changed files with 33 additions and 36 deletions

View File

@@ -0,0 +1,20 @@
#include <Nazara/Audio/Algorithm.hpp>
#include <catch2/catch_approx.hpp>
#include <catch2/catch_test_macros.hpp>
#include <array>
TEST_CASE("MixToMono", "[AUDIO][ALGORITHM]")
{
SECTION("Mix two channels together")
{
std::array<int, 4> input = { { 1, 3, 5, 3 } };
std::array<int, 2> output = { { 0, 0 } };
// Two channels and two frames !
Nz::MixToMono(input.data(), output.data(), 2, 2);
std::array<int, 2> theoric = { { 2, 4 } }; // It's the mean of the two channels
CHECK(output == theoric);
}
}