comparison base/test/TestMovingMedian.h @ 1574:cfcfec216c21 spectrogramparam

Fix win32 build annoyances
author Chris Cannam
date Fri, 09 Nov 2018 15:22:01 +0000
parents f04038819c26
children
comparison
equal deleted inserted replaced
1573:f04038819c26 1574:cfcfec216c21
31 31
32 template <typename T> 32 template <typename T>
33 void checkExpected(const vector<T> &output, 33 void checkExpected(const vector<T> &output,
34 const vector<T> &expected) { 34 const vector<T> &expected) {
35 if (output.size() != expected.size()) { 35 if (output.size() != expected.size()) {
36 cerr << "ERROR: output array size " << output.size() 36 std::cerr << "ERROR: output array size " << output.size()
37 << " differs from expected size " << expected.size() << endl; 37 << " differs from expected size " << expected.size()
38 << std::endl;
38 } 39 }
39 for (int i = 0; i < int(output.size()); ++i) { 40 for (int i = 0; i < int(output.size()); ++i) {
40 if (output[i] != expected[i]) { 41 if (output[i] != expected[i]) {
41 cerr << "ERROR: Value at index " << i 42 std::cerr << "ERROR: Value at index " << i
42 << " in output array differs from expected" << endl; 43 << " in output array differs from expected"
43 cerr << "Output: "; 44 << std::endl;
44 for (auto v: output) cerr << v << " "; 45 std::cerr << "Output: ";
45 cerr << "\nExpected: "; 46 for (auto v: output) std::cerr << v << " ";
46 for (auto v: expected) cerr << v << " "; 47 std::cerr << "\nExpected: ";
47 cerr << endl; 48 for (auto v: expected) std::cerr << v << " ";
49 std::cerr << std::endl;
48 break; 50 break;
49 } 51 }
50 } 52 }
51 QCOMPARE(output, expected); 53 QCOMPARE(output, expected);
52 } 54 }