Files
@ 68f79a7c6762
Branch filter:
Location: tempo-plotter/tests/test_helpers.h - annotation
68f79a7c6762
1.5 KiB
text/plain
integrated almost all code to to use new Stream class, plotting doesn't work yet
building works, needs major cleanup
building works, needs major cleanup
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
|