Mercurial > hg > match-vamp
diff test/TestFeatureExtractor.cpp @ 130:8e240bbea845 refactors
FeatureConditioner tests
author | Chris Cannam |
---|---|
date | Thu, 11 Dec 2014 13:53:16 +0000 |
parents | dad9fdc32a6a |
children | d6f22887283e |
line wrap: on
line diff
--- a/test/TestFeatureExtractor.cpp Thu Dec 11 12:54:46 2014 +0000 +++ b/test/TestFeatureExtractor.cpp Thu Dec 11 13:53:16 2014 +0000 @@ -35,6 +35,19 @@ BOOST_AUTO_TEST_SUITE(TestFeatureExtractor) +void checkAlternateProcessType(FeatureExtractor &fe, vector<double> expected, + vector<double> real, vector<double> imag) +{ + vector<float> in; + for (int i = 0; i < (int)real.size(); ++i) { + in.push_back(float(real[i])); + in.push_back(float(imag[i])); + } + vector<double> alt = fe.process(&in[0]); + BOOST_CHECK_EQUAL_COLLECTIONS(alt.begin(), alt.end(), + expected.begin(), expected.end()); +} + BOOST_AUTO_TEST_CASE(chroma) { int szs[] = { 1024, 2048, 4000 }; @@ -72,6 +85,8 @@ vector<double> out = fe.process(real, imag); + checkAlternateProcessType(fe, out, real, imag); + // We expect to find all bins are 0 except for: // // * two bins of 200 and 50 respectively, if the two input @@ -146,6 +161,8 @@ vector<double> out = fe.process(real, imag); + checkAlternateProcessType(fe, out, real, imag); + // We expect to find all bins are 0 except for: // // * two bins of 200 and 50 respectively, if the two input