diff tests/TestWindow.cpp @ 111:469d234acb9e

Test two-arg cut as well
author Chris Cannam
date Tue, 01 Oct 2013 15:15:59 +0100
parents 87ad66aaed32
children 4920d100b290
line wrap: on
line diff
--- a/tests/TestWindow.cpp	Mon Sep 30 16:50:38 2013 +0100
+++ b/tests/TestWindow.cpp	Tue Oct 01 15:15:59 2013 +0100
@@ -51,6 +51,13 @@
     Window<double> w(type, N);
     w.cut(d);
     COMPARE_ARRAY(d, expected);
+
+    double d0[N], d1[N];
+    for (int i = 0; i < N; ++i) d0[i] = 0.5 + (1.0 / (N * 2)) * (i + 1);
+    w.cut(d0, d1);
+    for (int i = 0; i < N; ++i) {
+	BOOST_CHECK_SMALL(d1[i] - d0[i] * expected[i], 1e-4);
+    }
 }
 
 BOOST_AUTO_TEST_CASE(bartlett)