annotate data/model/test/svcore-data-model-test.cpp @ 1833:21c792334c2e sensible-delimited-data-strings

Rewrite all the DelimitedDataString stuff so as to return vectors of individual cell strings rather than having the classes add the delimiters themselves. Rename accordingly to names based on StringExport. Take advantage of this in the CSV writer code so as to properly quote cells that contain delimiter characters.
author Chris Cannam
date Fri, 03 Apr 2020 17:11:05 +0100
parents 560453546749
children
rev   line source
Chris@1086 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@1086 2 /*
Chris@1086 3 Sonic Visualiser
Chris@1086 4 An audio file viewer and annotation editor.
Chris@1086 5 Centre for Digital Music, Queen Mary, University of London.
Chris@1086 6
Chris@1086 7 This program is free software; you can redistribute it and/or
Chris@1086 8 modify it under the terms of the GNU General Public License as
Chris@1086 9 published by the Free Software Foundation; either version 2 of the
Chris@1086 10 License, or (at your option) any later version. See the file
Chris@1086 11 COPYING included with this distribution for more information.
Chris@1086 12 */
Chris@1086 13
Chris@1086 14 #include "TestFFTModel.h"
Chris@1528 15 #include "TestZoomConstraints.h"
Chris@1537 16 #include "TestWaveformOversampler.h"
Chris@1609 17 #include "TestSparseModels.h"
Chris@1086 18
Chris@1601 19 #include "system/Init.h"
Chris@1601 20
Chris@1086 21 #include <QtTest>
Chris@1086 22
Chris@1086 23 #include <iostream>
Chris@1086 24
Chris@1086 25 using namespace std;
Chris@1086 26
Chris@1086 27 int main(int argc, char *argv[])
Chris@1086 28 {
Chris@1086 29 int good = 0, bad = 0;
Chris@1086 30
Chris@1601 31 svSystemSpecificInitialisation();
Chris@1601 32
Chris@1086 33 QCoreApplication app(argc, argv);
Chris@1392 34 app.setOrganizationName("sonic-visualiser");
Chris@1609 35 app.setApplicationName("test-svcore-data-model");
Chris@1086 36
Chris@1086 37 {
Chris@1429 38 TestFFTModel t;
Chris@1429 39 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@1429 40 else ++bad;
Chris@1086 41 }
Chris@1086 42
Chris@1528 43 {
Chris@1528 44 TestZoomConstraints t;
Chris@1528 45 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@1528 46 else ++bad;
Chris@1528 47 }
Chris@1528 48
Chris@1537 49 {
Chris@1537 50 TestWaveformOversampler t;
Chris@1537 51 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@1537 52 else ++bad;
Chris@1537 53 }
Chris@1537 54
Chris@1609 55 {
Chris@1609 56 TestSparseModels t;
Chris@1609 57 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@1609 58 else ++bad;
Chris@1609 59 }
Chris@1609 60
Chris@1086 61 if (bad > 0) {
Chris@1476 62 SVCERR << "\n********* " << bad << " test suite(s) failed!\n" << endl;
Chris@1429 63 return 1;
Chris@1086 64 } else {
Chris@1476 65 SVCERR << "All tests passed" << endl;
Chris@1429 66 return 0;
Chris@1086 67 }
Chris@1086 68 }
Chris@1086 69