[test_buffer]

use target and actual checks
This commit is contained in:
2025-11-05 08:23:09 +01:00
parent c627cd2dd7
commit 6f69217ba3
3 changed files with 21 additions and 7 deletions
+9 -2
View File
@@ -1,8 +1,9 @@
#include <delay/buffer_multi.hpp>
#include <delay/buffer.hpp>
#include <cstdio>
#include <assert.h>
#include <iostream>
#include <ostream>
#ifndef TEST_COMMON_H
#define TEST_COMMON_H
@@ -20,8 +21,14 @@ void print(const dsp::Buffer<T> &v, size_t size, std::string name=std::string(""
}
template<typename T>
bool check(const dsp::Buffer<T> &target, const dsp::Buffer<T> &actual)
void check(const dsp::Buffer<T> &target, const dsp::Buffer<T> &actual)
{
if (!(target == actual))
{
std::cout << "Check failed" << std::endl;
print(target, target.capacity(), "Target");
print(actual, actual.capacity(), "Actual");
}
assert(target == actual);
}