comparison data/model/test/TestWaveformOversampler.h @ 1539:0b08bc8741c6 zoom

Win32 fix
author Chris Cannam
date Wed, 26 Sep 2018 17:38:34 +0100
parents fa67fbbff8fc
children a53bf95f0bea
comparison
equal deleted inserted replaced
1538:fa67fbbff8fc 1539:0b08bc8741c6
54 void compareStrided(floatvec_t obtained, floatvec_t expected, int stride) { 54 void compareStrided(floatvec_t obtained, floatvec_t expected, int stride) {
55 QCOMPARE(obtained.size(), expected.size() * stride); 55 QCOMPARE(obtained.size(), expected.size() * stride);
56 float threshold = 1e-10f; 56 float threshold = 1e-10f;
57 for (int i = 0; in_range_for(expected, i); ++i) { 57 for (int i = 0; in_range_for(expected, i); ++i) {
58 if (fabsf(obtained[i * stride] - expected[i]) > threshold) { 58 if (fabsf(obtained[i * stride] - expected[i]) > threshold) {
59 cerr << "At position " << i * stride << ": " 59 std::cerr << "At position " << i * stride << ": "
60 << obtained[i * stride] << " != " << expected[i] 60 << obtained[i * stride] << " != " << expected[i]
61 << endl; 61 << std::endl;
62 QCOMPARE(obtained, expected); 62 QCOMPARE(obtained, expected);
63 } 63 }
64 } 64 }
65 } 65 }
66 66