Skip to content

Commit

Permalink
Improve hades tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiashienzsch committed Feb 12, 2024
1 parent a41f432 commit 7d24c22
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/grit/eurorack/hades_test.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
#include "hades.hpp"

#include <catch2/catch_approx.hpp>
#include <catch2/catch_get_random_seed.hpp>
#include <catch2/catch_template_test_macros.hpp>

#include <etl/algorithm.hpp>
#include <etl/random.hpp>

TEST_CASE("grit/audio/eurorack: Hades")
{
static constexpr auto sampleRate = 96'000.0F;
static constexpr auto blockSize = 32;

auto input = etl::array<float, 2 * blockSize>{};
auto input = [] {
auto buf = etl::array<float, 2 * blockSize>{};
auto rng = etl::xoshiro128plusplus{Catch::getSeed()};
auto dist = etl::uniform_real_distribution<float>{-1.0F, 1.0F};
etl::generate(buf.begin(), buf.end(), [&] { return dist(rng); });
return buf;
}();

auto output = etl::array<float, 2 * blockSize>{};
auto const buffer = grit::Hades::Buffer{
.input = grit::StereoBlock<float const>{ input.data(), blockSize},
Expand Down

0 comments on commit 7d24c22

Please sign in to comment.