ardour
resampled_source_test.cc
Go to the documentation of this file.
1 #include "test_util.h"
2 
3 #include "pbd/file_utils.h"
7 
8 
10 
11 using namespace std;
12 using namespace ARDOUR;
13 using namespace PBD;
14 
15 void
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 
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 }
Definition: Beats.hpp:239
bool find_file(const Searchpath &search_path, const string &filename, std::string &result)
Definition: file_utils.cc:187
float Sample
Definition: types.h:54
Definition: amp.h:29
framecnt_t read(Sample *buffer, framecnt_t nframes)
PBD::Searchpath test_search_path()
Definition: test_util.cc:133
Definition: debug.h:30
CPPUNIT_TEST_SUITE_REGISTRATION(ResampledSourceTest)