Files
@ a91f37cb7784
Branch filter:
Location: tempo-plotter/tests/test_helpers.h - annotation
a91f37cb7784
1.5 KiB
text/plain
disable reader selection buttons so that user cannot mess up the 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
|