Mercurial > hg > svcore
diff data/model/test/MockWaveModel.cpp @ 1088:5fab8e4f5f19
Start making the FFT model tests into proper tests
author | Chris Cannam |
---|---|
date | Fri, 12 Jun 2015 12:41:19 +0100 |
parents | dcf54a6964d0 |
children | bdebff3265ae 6d550a16f7d6 |
line wrap: on
line diff
--- a/data/model/test/MockWaveModel.cpp Thu Jun 11 09:09:11 2015 +0100 +++ b/data/model/test/MockWaveModel.cpp Fri Jun 12 12:41:19 2015 +0100 @@ -17,10 +17,10 @@ using namespace std; -MockWaveModel::MockWaveModel(vector<Sort> sorts, int length) +MockWaveModel::MockWaveModel(vector<Sort> sorts, int length, int pad) { for (auto sort: sorts) { - m_data.push_back(generate(sort, length)); + m_data.push_back(generate(sort, length, pad)); } } @@ -61,10 +61,14 @@ } vector<float> -MockWaveModel::generate(Sort sort, int length) const +MockWaveModel::generate(Sort sort, int length, int pad) const { vector<float> data; + for (int i = 0; i < pad; ++i) { + data.push_back(0.f); + } + for (int i = 0; i < length; ++i) { double v = 0.0; @@ -80,6 +84,10 @@ data.push_back(float(v)); } + for (int i = 0; i < pad; ++i) { + data.push_back(0.f); + } + return data; }