revert inadvertently committed debug settings
[ardour.git] / libs / ardour / test / resampled_source_test.cc
1 #include "test_util.h"
2
3 #include "pbd/file_utils.h"
4 #include "ardour/resampled_source.h"
5 #include "ardour/sndfileimportable.h"
6 #include "resampled_source_test.h"
7
8
9 CPPUNIT_TEST_SUITE_REGISTRATION (ResampledSourceTest);
10
11 using namespace std;
12 using namespace ARDOUR;
13 using namespace PBD;
14
15 void
16 ResampledSourceTest::seekTest ()
17 {
18         std::string test_file_path;
19         const string test_filename = "test.wav";
20
21         CPPUNIT_ASSERT (find_file (test_search_path (), test_filename, test_file_path));
22
23         boost::shared_ptr<SndFileImportableSource> s (new SndFileImportableSource (test_file_path));
24         ResampledImportableSource r (s, 48000, SrcBest);
25
26         /* Make sure that seek (0) has the desired effect, ie that
27            given the same input you get the same output after seek (0)
28            as you got when the Source was newly created.
29         */
30
31         Sample A[64];
32         r.read (A, 64);
33
34         r.seek (0);
35
36         Sample B[64];
37         r.read (B, 64);
38
39         for (int i = 0; i < 64; ++i) {
40                 CPPUNIT_ASSERT (A[i] == B[i]);
41         }
42 }