Files
@ d92b6daade5d
Branch filter:
Location: tempo-plotter/tests/test_helpers.h - annotation
d92b6daade5d
1.5 KiB
text/plain
plotting works, only demo is tested
switching readers when demo is enabled breaks demo
switching readers when demo is enabled breaks demo
5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf 5c0005f331cf | #ifndef TEST_HELPERS_H
#define TEST_HELPERS_H
#include "source.h"
#include "sink.h"
class TestSink : public Sink
{
public:
int totalFed;
int _numChannels;
bool _hasX;
TestSink()
{
totalFed = 0;
_numChannels = 0;
_hasX = false;
};
void feedIn(const SamplePack& data)
{
REQUIRE(data.numChannels() == numChannels());
totalFed += data.numSamples();
Sink::feedIn(data);
};
void setNumChannels(unsigned nc, bool x)
{
_numChannels = nc;
_hasX = x;
Sink::setNumChannels(nc, x);
};
virtual unsigned numChannels() const
{
return _numChannels;
};
virtual bool hasX() const
{
return _hasX;
};
};
class TestSource : public Source
{
public:
int _numChannels;
bool _hasX;
TestSource(unsigned nc, bool x)
{
_numChannels = nc;
_hasX = x;
};
virtual unsigned numChannels() const
{
return _numChannels;
};
virtual bool hasX() const
{
return _hasX;
};
void _feed(const SamplePack& data) const
{
feedOut(data);
};
void _setNumChannels(unsigned nc, bool x)
{
_numChannels = nc;
_hasX = x;
updateNumChannels();
};
};
#endif // TEST_HELPERS_H
|