1 #ifndef ORG_EEROS_TEST_CONTROL_SUMBLOCKTEST_HPP_
2 #define ORG_EEROS_TEST_CONTROL_SUMBLOCKTEST_HPP_
9 #include "../../Utils.hpp"
11 template <
unsigned int I,
typename T>
15 for (
int i = 0;
i < I;
i++) {
20 int run(
const char* filepath) {
21 std::ifstream
file(filepath);
22 if (!file.is_open())
return -2;
29 for (
int i = 0;
i < I;
i++) {
32 data[
i].getSignal().setValue(in);
34 if (file.eof())
break;
41 std::cout <<
"line " << line <<
" expecting " << out <<
" calculated " <<
uut.
getOut().getSignal().getValue() <<
std::endl;
54 template <
unsigned int I,
unsigned int M,
unsigned int N,
typename T>
58 for (
int i = 0;
i < I;
i++) {
63 int run(
const char* filepath) {
64 std::ifstream
file(filepath);
65 if (!file.is_open())
return -2;
74 for (
int i = 0;
i < I;
i++) {
75 for(
unsigned int j = 0;
j < M * N;
j++) {
80 data[
i].getSignal().setValue(testValue);
82 if (file.eof())
break;
84 for(
unsigned int j = 0;
j < M * N;
j++) {
92 for(
unsigned int j = 0;
j < M * N;
j++) {
95 std::cout <<
"line " << line <<
" expecting " << refRes(
j) <<
" calculated " <<
uut.
getOut().getSignal().getValue()(
j) <<
std::endl;
109 #endif // ORG_EEROS_TEST_CONTROL_SUMBLOCKTEST_HPP_
SumBlockTestMatrix()
Definition: SumBlockTest.hpp:57
eeros::control::Sum< I, T > uut
Definition: SumBlockTest.hpp:51
static bool compareApprox(double ref, double val, double tolerance)
Definition: Utils.hpp:7
Definition: SumBlockTest.hpp:55
SumBlockTestScalar()
Definition: SumBlockTest.hpp:14
virtual Output< T > & getOut()
Definition: Sum.hpp:36
Definition: SumBlockTest.hpp:12
std::ifstream file
Definition: MatrixOperations.cpp:29
void error(int line, eeros::RingBuffer< int, 4 > &rb)
Definition: RingBufferTest.cpp:24
Definition: Output.hpp:10
int run(const char *filepath)
Definition: SumBlockTest.hpp:63
eeros::control::Sum< I, T > uut
Definition: SumBlockTest.hpp:106
int j
Definition: RingBufferTest.cpp:13
void endl(LogWriter &w)
Definition: RecordWriter.hpp:19
eeros::control::Output< T > data[I]
Definition: SumBlockTest.hpp:50
int run(const char *filepath)
Definition: SumBlockTest.hpp:20
int i
Definition: RingBufferTest.cpp:12
virtual void run()
Definition: Sum.hpp:22
eeros::control::Output< T > data[I]
Definition: SumBlockTest.hpp:105
virtual Input< T > & getIn(uint8_t index)
Definition: Sum.hpp:32