annotate base/test/svcore-base-test.cpp @ 1421:8b7d6c1e1ab7

Adjust rounding; fixes tests on 32-bit Linux test box. Also update one test. Next: recheck everywhere else.
author Chris Cannam
date Thu, 20 Jul 2017 14:52:49 +0100
parents 25ed6dde2ce0
children 87ae75da6527
rev   line source
Chris@879 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@879 2 /*
Chris@879 3 Sonic Visualiser
Chris@879 4 An audio file viewer and annotation editor.
Chris@879 5 Centre for Digital Music, Queen Mary, University of London.
Chris@879 6
Chris@879 7 This program is free software; you can redistribute it and/or
Chris@879 8 modify it under the terms of the GNU General Public License as
Chris@879 9 published by the Free Software Foundation; either version 2 of the
Chris@879 10 License, or (at your option) any later version. See the file
Chris@879 11 COPYING included with this distribution for more information.
Chris@879 12 */
Chris@879 13
Chris@1392 14 #include "TestLogRange.h"
Chris@883 15 #include "TestRangeMapper.h"
Chris@892 16 #include "TestPitch.h"
Chris@1407 17 #include "TestScaleTickIntervals.h"
Chris@1022 18 #include "TestStringBits.h"
Chris@1262 19 #include "TestOurRealTime.h"
Chris@1262 20 #include "TestVampRealTime.h"
Chris@1265 21 #include "TestColumnOp.h"
Chris@879 22
Chris@879 23 #include <QtTest>
Chris@879 24
Chris@879 25 #include <iostream>
Chris@879 26
Chris@879 27 int main(int argc, char *argv[])
Chris@879 28 {
Chris@879 29 int good = 0, bad = 0;
Chris@879 30
Chris@879 31 QCoreApplication app(argc, argv);
Chris@1392 32 app.setOrganizationName("sonic-visualiser");
Chris@879 33 app.setApplicationName("test-svcore-base");
Chris@879 34
Chris@879 35 {
Chris@883 36 TestRangeMapper t;
Chris@879 37 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@879 38 else ++bad;
Chris@879 39 }
Chris@892 40 {
Chris@892 41 TestPitch t;
Chris@892 42 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@892 43 else ++bad;
Chris@892 44 }
Chris@1012 45 {
Chris@1262 46 TestOurRealTime t;
Chris@1262 47 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@1262 48 else ++bad;
Chris@1262 49 }
Chris@1262 50 {
Chris@1262 51 TestVampRealTime t;
Chris@1012 52 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@1012 53 else ++bad;
Chris@1012 54 }
Chris@1022 55 {
Chris@1022 56 TestStringBits t;
Chris@1022 57 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@1022 58 else ++bad;
Chris@1022 59 }
Chris@1265 60 {
Chris@1265 61 TestColumnOp t;
Chris@1265 62 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@1265 63 else ++bad;
Chris@1265 64 }
Chris@1392 65 {
Chris@1392 66 TestLogRange t;
Chris@1392 67 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@1392 68 else ++bad;
Chris@1392 69 }
Chris@1407 70 {
Chris@1407 71 TestScaleTickIntervals t;
Chris@1407 72 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@1407 73 else ++bad;
Chris@1407 74 }
Chris@879 75
Chris@879 76 if (bad > 0) {
Chris@879 77 cerr << "\n********* " << bad << " test suite(s) failed!\n" << endl;
Chris@879 78 return 1;
Chris@879 79 } else {
Chris@879 80 cerr << "All tests passed" << endl;
Chris@879 81 return 0;
Chris@879 82 }
Chris@879 83 }