diff options
author | Carl Hetherington <carl@carlh.net> | 2011-12-09 19:59:23 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2011-12-09 19:59:23 +0000 |
commit | 73461494d75ab794224cbe93021acfa51a8c98a9 (patch) | |
tree | 02738a5c19b178aebb3ae078e1bd2c2e8037eed2 /libs/ardour/test/resampled_source_test.cc | |
parent | 1244cae5c1799c72dc7624dfd573704c56963ebe (diff) |
Add simple framewalk_to_beats test and normalise naming
of test files.
git-svn-id: svn://localhost/ardour2/branches/3.0@10954 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/test/resampled_source_test.cc')
-rw-r--r-- | libs/ardour/test/resampled_source_test.cc | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/libs/ardour/test/resampled_source_test.cc b/libs/ardour/test/resampled_source_test.cc new file mode 100644 index 0000000000..983c0d88d2 --- /dev/null +++ b/libs/ardour/test/resampled_source_test.cc @@ -0,0 +1,31 @@ +#include "ardour/resampled_source.h" +#include "ardour/sndfileimportable.h" +#include "resampled_source_test.h" + +CPPUNIT_TEST_SUITE_REGISTRATION (ResampledSourceTest); + +using namespace ARDOUR; + +void +ResampledSourceTest::seekTest () +{ + boost::shared_ptr<SndFileImportableSource> s (new SndFileImportableSource ("../libs/ardour/test/data/test.wav")); + ResampledImportableSource r (s, 48000, SrcBest); + + /* Make sure that seek (0) has the desired effect, ie that + given the same input you get the same output after seek (0) + as you got when the Source was newly created. + */ + + Sample A[64]; + r.read (A, 64); + + r.seek (0); + + Sample B[64]; + r.read (B, 64); + + for (int i = 0; i < 64; ++i) { + CPPUNIT_ASSERT (A[i] == B[i]); + } +} |