# HG changeset patch # User Chris Cannam # Date 1538057979 -3600 # Node ID a53bf95f0bea3b21d7a9073a8cdf44304338c0ff # Parent 0b08bc8741c6b040843d7cbbfc75067391557824 Further test diff -r 0b08bc8741c6 -r a53bf95f0bea data/model/test/TestWaveformOversampler.h --- a/data/model/test/TestWaveformOversampler.h Wed Sep 26 17:38:34 2018 +0100 +++ b/data/model/test/TestWaveformOversampler.h Thu Sep 27 15:19:39 2018 +0100 @@ -34,8 +34,8 @@ m_source[2500] = 0.5f; m_source[2501] = -0.5f; m_source[4999] = -1.f; - for (int i = 4000; i < 4900; ++i) { - m_source[i] = float(sin(double(i - 1000) * M_PI / 50.0)); + for (int i = 3000; i < 3900; ++i) { + m_source[i] = float(sin(double(i - 3000) * M_PI / 50.0)); } m_sourceModel = new WritableWaveFileModel(8000, 1); const float *d = m_source.data(); @@ -199,9 +199,19 @@ // samples, even when the original sample that was the source // of this sinc kernel is not within the requested range floatvec_t output = get(1, 10, 4); + QVERIFY(output[0] < 0.0001); QVERIFY(output[1] + 0.1787 < 0.0001); QVERIFY(output[2] + 0.2099 < 0.0001); QVERIFY(output[3] + 0.1267 < 0.0001); + + // and again at the end + output = get(4989, 10, 4); + QVERIFY(output[39] + 0.9000 < 0.0001); + QVERIFY(output[38] + 0.6358 < 0.0001); + QVERIFY(output[37] + 0.2993 < 0.0001); + QVERIFY(output[35] - 0.1787 < 0.0001); + QVERIFY(output[34] - 0.2099 < 0.0001); + QVERIFY(output[33] - 0.1267 < 0.0001); } void testOverlaps4x() {