diff tests/TestGetKeyMode.cpp @ 470:dd132354ea02

Expand tests a bit, make them fail if they fail
author Chris Cannam <cannam@all-day-breakfast.com>
date Thu, 30 May 2019 14:10:33 +0100
parents 3f913390bcf2
children 2adcd94c2079
line wrap: on
line diff
--- a/tests/TestGetKeyMode.cpp	Thu May 30 14:10:15 2019 +0100
+++ b/tests/TestGetKeyMode.cpp	Thu May 30 14:10:33 2019 +0100
@@ -70,19 +70,16 @@
     
     for (int midiPitch = 48; midiPitch < 96; ++midiPitch) {
 
-        cout << endl;
-
         GetKeyMode gkm(sampleRate, concertA, 10, 10);
         int blockSize = gkm.getBlockSize();
         int hopSize = gkm.getHopSize();
-        cerr << "blockSize = " << blockSize
-             << ", hopSize = " << hopSize << endl;
 
         double frequency = concertA * pow(2.0, (midiPitch - 69.0) / 12.0);
+/*
         cout << "midiPitch = " << midiPitch
              << ", name = " << midiPitchName(midiPitch)
              << ", frequency = " << frequency << endl;
-
+*/
         int blocks = 4;
         int totalLength = blockSize * blocks;
         vector<double> signal = generateSinusoid(frequency, sampleRate,
@@ -105,8 +102,10 @@
         int tonic = key;
         if (minor) tonic -= 12;
 
-        string name = keyName(tonic, minor);
-        cout << "key value = " << key << ", name = " << name << endl;
+        BOOST_CHECK_EQUAL(tonic, 1 + (midiPitch % 12));
+        
+//        string name = keyName(tonic, minor);
+//        cout << "key value = " << key << ", name = " << name << endl;
     }
 }