comparison data/fileio/test/svcore-data-fileio-test.cpp @ 1524:64ef24ebb19c

Some CSV format tests and minor fixes
author Chris Cannam
date Fri, 14 Sep 2018 09:25:17 +0100
parents 4700b7188f6c
children a090221caeda
comparison
equal deleted inserted replaced
1523:c1b2eab6ac51 1524:64ef24ebb19c
14 14
15 #include "AudioFileReaderTest.h" 15 #include "AudioFileReaderTest.h"
16 #include "AudioFileWriterTest.h" 16 #include "AudioFileWriterTest.h"
17 #include "EncodingTest.h" 17 #include "EncodingTest.h"
18 #include "MIDIFileReaderTest.h" 18 #include "MIDIFileReaderTest.h"
19 #include "CSVFormatTest.h"
19 #include "CSVStreamWriterTest.h" 20 #include "CSVStreamWriterTest.h"
20 21
21 #include <QtTest> 22 #include <QtTest>
22 23
23 #include <iostream> 24 #include <iostream>
38 testDir = argv[1]; 39 testDir = argv[1];
39 } 40 }
40 41
41 QCoreApplication app(argc, argv); 42 QCoreApplication app(argc, argv);
42 app.setOrganizationName("sonic-visualiser"); 43 app.setOrganizationName("sonic-visualiser");
43 app.setApplicationName("test-fileio"); 44 app.setApplicationName("test-svcore-data-fileio");
44 45
45 if (testDir != "") { 46 if (testDir != "") {
46 SVCERR << "Setting test directory base path to \"" << testDir << "\"" << endl; 47 SVCERR << "Setting test directory base path to \"" << testDir << "\"" << endl;
47 } 48 }
48 49
69 if (QTest::qExec(&t, argc, argv) == 0) ++good; 70 if (QTest::qExec(&t, argc, argv) == 0) ++good;
70 else ++bad; 71 else ++bad;
71 } 72 }
72 73
73 { 74 {
75 CSVFormatTest t(testDir);
76 if (QTest::qExec(&t, argc, argv) == 0) ++good;
77 else ++bad;
78 }
79
80 {
74 CSVStreamWriterTest t; 81 CSVStreamWriterTest t;
75 if (QTest::qExec(&t, argc, argv) == 0) ++good; 82 if (QTest::qExec(&t, argc, argv) == 0) ++good;
76 else ++bad; 83 else ++bad;
77 } 84 }
78 85
79 if (bad > 0) { 86 if (bad > 0) {
80 SVCERR << "\n********* " << bad << " test suite(s) failed!\n" << endl; 87 SVCERR << "\n********* " << bad << " test suite(s) failed!\n" << endl;
81 return 1; 88 return 1;
82 } else { 89 } else {
83 SVCERR << "All tests passed" << endl; 90 SVCERR << "All tests passed" << endl;
84 return 0; 91 return 0;
85 } 92 }
86 } 93 }