#include #include #include #include #include #include #include #ifndef TEST_COMMON_H #define TEST_COMMON_H template void print(const dsp::Buffer &v, size_t size) { for(int i=0; i < size; i++) { std::cout << v[i] << " "; } std::cout << std::endl; } template void print(T *v, size_t size) { for(int i=0; i < size; i++) { std::cout << v[i] << " "; } std::cout << std::endl; } template void check(const dsp::Buffer &target, const dsp::Buffer &actual, size_t size=0) { bool success = false; do { if (size == 0) { if (target.capacity() != actual.capacity()) { break; } size = target.capacity(); } for (int i=0; i < size; i++) { if (target[i] != actual[i]) { break; } } success = true; } while(false); if (!success) { std::cout << "Check failed" << std::endl; std::cout << "Target" << std::endl; print(target, target.capacity()); std::cout << "Actual" << std::endl; print(actual, actual.capacity()); } assert(success); } #endif