Updated tests
This commit is contained in:
parent
543c638926
commit
29aa231960
3 changed files with 8 additions and 8 deletions
|
|
@ -64,8 +64,8 @@ TEST_CASE("[AudioBuffer] Iterators")
|
||||||
std::fill(buffer.channelWriter(0), buffer.channelWriterEnd(0), fillValue);
|
std::fill(buffer.channelWriter(0), buffer.channelWriterEnd(0), fillValue);
|
||||||
std::fill(buffer.channelWriter(1), buffer.channelWriterEnd(1), fillValue);
|
std::fill(buffer.channelWriter(1), buffer.channelWriterEnd(1), fillValue);
|
||||||
|
|
||||||
REQUIRE(std::all_of(buffer.channelReader(0), buffer.channelReaderEnd(0), [fillValue](auto value) { return value == fillValue; }));
|
REQUIRE(std::all_of(buffer.channelReader(0), buffer.channelReaderEnd(0), [fillValue](float value) { return value == fillValue; }));
|
||||||
REQUIRE(std::all_of(buffer.channelReader(1), buffer.channelReaderEnd(1), [fillValue](auto value) { return value == fillValue; }));
|
REQUIRE(std::all_of(buffer.channelReader(1), buffer.channelReaderEnd(1), [fillValue](float value) { return value == fillValue; }));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("[AudioSpan] Constructions")
|
TEST_CASE("[AudioSpan] Constructions")
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ TEST_CASE("[Buffer] Resize 10 floats ")
|
||||||
REQUIRE(buffer.resize(smallSize));
|
REQUIRE(buffer.resize(smallSize));
|
||||||
checkBoundaries(buffer, smallSize);
|
checkBoundaries(buffer, smallSize);
|
||||||
|
|
||||||
REQUIRE(std::all_of(buffer.begin(), buffer.end(), [](auto value) { return value == 1.0f; }));
|
REQUIRE(std::all_of(buffer.begin(), buffer.end(), [](float value) { return value == 1.0f; }));
|
||||||
|
|
||||||
REQUIRE(buffer.resize(bigSize));
|
REQUIRE(buffer.resize(bigSize));
|
||||||
checkBoundaries(buffer, bigSize);
|
checkBoundaries(buffer, bigSize);
|
||||||
|
|
@ -95,7 +95,7 @@ TEST_CASE("[Buffer] Resize 4096 floats ")
|
||||||
REQUIRE(buffer.resize(smallSize));
|
REQUIRE(buffer.resize(smallSize));
|
||||||
checkBoundaries(buffer, smallSize);
|
checkBoundaries(buffer, smallSize);
|
||||||
|
|
||||||
REQUIRE(std::all_of(buffer.begin(), buffer.end(), [](auto value) { return value == 1.0f; }));
|
REQUIRE(std::all_of(buffer.begin(), buffer.end(), [](float value) { return value == 1.0f; }));
|
||||||
|
|
||||||
REQUIRE(buffer.resize(bigSize));
|
REQUIRE(buffer.resize(bigSize));
|
||||||
checkBoundaries(buffer, bigSize);
|
checkBoundaries(buffer, bigSize);
|
||||||
|
|
@ -117,7 +117,7 @@ TEST_CASE("[Buffer] Resize 65536 floats ")
|
||||||
REQUIRE(buffer.resize(smallSize));
|
REQUIRE(buffer.resize(smallSize));
|
||||||
checkBoundaries(buffer, smallSize);
|
checkBoundaries(buffer, smallSize);
|
||||||
|
|
||||||
REQUIRE(std::all_of(buffer.begin(), buffer.end(), [](auto value) { return value == 1.0f; }));
|
REQUIRE(std::all_of(buffer.begin(), buffer.end(), [](float value) { return value == 1.0f; }));
|
||||||
|
|
||||||
REQUIRE(buffer.resize(bigSize));
|
REQUIRE(buffer.resize(bigSize));
|
||||||
checkBoundaries(buffer, bigSize);
|
checkBoundaries(buffer, bigSize);
|
||||||
|
|
@ -134,11 +134,11 @@ TEST_CASE("[Buffer] Copy and move")
|
||||||
std::fill(copied.begin(), copied.end(), 2.0f);
|
std::fill(copied.begin(), copied.end(), 2.0f);
|
||||||
copied = buffer;
|
copied = buffer;
|
||||||
checkBoundaries(copied, baseSize);
|
checkBoundaries(copied, baseSize);
|
||||||
REQUIRE(std::all_of(copied.begin(), copied.end(), [](auto value) { return value == 1.0f; }));
|
REQUIRE(std::all_of(copied.begin(), copied.end(), [](float value) { return value == 1.0f; }));
|
||||||
|
|
||||||
sfz::Buffer<float> copyConstructed { buffer };
|
sfz::Buffer<float> copyConstructed { buffer };
|
||||||
checkBoundaries(copyConstructed, baseSize);
|
checkBoundaries(copyConstructed, baseSize);
|
||||||
REQUIRE(std::all_of(copyConstructed.begin(), copyConstructed.end(), [](auto value) { return value == 1.0f; }));
|
REQUIRE(std::all_of(copyConstructed.begin(), copyConstructed.end(), [](float value) { return value == 1.0f; }));
|
||||||
|
|
||||||
// sfz::Buffer<float> moveConstructed { std::move(buffer) };
|
// sfz::Buffer<float> moveConstructed { std::move(buffer) };
|
||||||
// REQUIRE(buffer.empty());
|
// REQUIRE(buffer.empty());
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ TEST_CASE("[LinearEnvelope] 2 events, with another block call")
|
||||||
TEST_CASE("[LinearEnvelope] 2 events, function")
|
TEST_CASE("[LinearEnvelope] 2 events, function")
|
||||||
{
|
{
|
||||||
sfz::LinearEnvelope<float> envelope;
|
sfz::LinearEnvelope<float> envelope;
|
||||||
envelope.setFunction([](auto x) { return 2 * x; });
|
envelope.setFunction([](float x) { return 2 * x; });
|
||||||
envelope.registerEvent(2, 1.0f);
|
envelope.registerEvent(2, 1.0f);
|
||||||
envelope.registerEvent(6, 2.0f);
|
envelope.registerEvent(6, 2.0f);
|
||||||
std::array<float, 8> output;
|
std::array<float, 8> output;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue