Add simple framewalk_to_beats test and normalise naming
[ardour.git] / libs / ardour / test / resampled_source_test.cc
1 #include "ardour/resampled_source.h"
2 #include "ardour/sndfileimportable.h"
3 #include "resampled_source_test.h"
4
5 CPPUNIT_TEST_SUITE_REGISTRATION (ResampledSourceTest);
6
7 using namespace ARDOUR;
8
9 void
10 ResampledSourceTest::seekTest ()
11 {
12         boost::shared_ptr<SndFileImportableSource> s (new SndFileImportableSource ("../libs/ardour/test/data/test.wav"));
13         ResampledImportableSource r (s, 48000, SrcBest);
14
15         /* Make sure that seek (0) has the desired effect, ie that
16            given the same input you get the same output after seek (0)
17            as you got when the Source was newly created.
18         */
19
20         Sample A[64];
21         r.read (A, 64);
22
23         r.seek (0);
24
25         Sample B[64];
26         r.read (B, 64);
27
28         for (int i = 0; i < 64; ++i) {
29                 CPPUNIT_ASSERT (A[i] == B[i]);
30         }
31 }