mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-15 19:16:40 +01:00
Fix export, which has been broken since the boost::signals2 changes. Also update Audiographer, bacause of its incomplete sndfile handling. Audiographer is equal to revision 74
git-svn-id: svn://localhost/ardour2/branches/3.0@6760 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
44f4b84551
commit
830911f6f9
72 changed files with 2182 additions and 1090 deletions
47
libs/audiographer/tests/sndfile/tmp_file_test.cc
Normal file
47
libs/audiographer/tests/sndfile/tmp_file_test.cc
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
#include "tests/utils.h"
|
||||
#include "audiographer/sndfile/tmp_file.h"
|
||||
|
||||
using namespace AudioGrapher;
|
||||
|
||||
class TmpFileTest : public CppUnit::TestFixture
|
||||
{
|
||||
CPPUNIT_TEST_SUITE (TmpFileTest);
|
||||
CPPUNIT_TEST (testProcess);
|
||||
CPPUNIT_TEST_SUITE_END ();
|
||||
|
||||
public:
|
||||
void setUp()
|
||||
{
|
||||
frames = 128;
|
||||
random_data = TestUtils::init_random_data(frames);
|
||||
}
|
||||
|
||||
void tearDown()
|
||||
{
|
||||
delete [] random_data;
|
||||
}
|
||||
|
||||
void testProcess()
|
||||
{
|
||||
uint channels = 2;
|
||||
file.reset (new TmpFile<float>(SF_FORMAT_WAV | SF_FORMAT_FLOAT, channels, 44100));
|
||||
AllocatingProcessContext<float> c (random_data, frames, channels);
|
||||
c.set_flag (ProcessContext<float>::EndOfInput);
|
||||
file->process (c);
|
||||
|
||||
TypeUtils<float>::zero_fill (c.data (), c.frames());
|
||||
|
||||
file->seek (0, SEEK_SET);
|
||||
file->read (c);
|
||||
CPPUNIT_ASSERT (TestUtils::array_equals (random_data, c.data(), c.frames()));
|
||||
}
|
||||
|
||||
private:
|
||||
boost::shared_ptr<TmpFile<float> > file;
|
||||
|
||||
float * random_data;
|
||||
nframes_t frames;
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION (TmpFileTest);
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue