comparison data/fileio/test/CSVFormatTest.h @ 1873:1d44fdc8196c csv-import-headers

Extend tests to include testing (at least some of) the actual data as well as the layout
author Chris Cannam
date Thu, 18 Jun 2020 13:42:48 +0100
parents 1b8c4ee06f6d
children
comparison
equal deleted inserted replaced
1872:566476eeeb80 1873:1d44fdc8196c
234 } 234 }
235 235
236 void modelType2DImplicit() { 236 void modelType2DImplicit() {
237 CSVFormat f; 237 CSVFormat f;
238 QVERIFY(f.guessFormatFor(csvDir.filePath("model-type-2d-implicit.csv"))); 238 QVERIFY(f.guessFormatFor(csvDir.filePath("model-type-2d-implicit.csv")));
239 QCOMPARE(f.getColumnCount(), 1); 239 QCOMPARE(f.getColumnCount(), 2);
240 QCOMPARE(f.getHeaderStatus(), CSVFormat::HeaderAbsent); 240 QCOMPARE(f.getHeaderStatus(), CSVFormat::HeaderAbsent);
241 QCOMPARE(f.getColumnPurpose(0), CSVFormat::ColumnValue); 241 QCOMPARE(f.getColumnPurpose(0), CSVFormat::ColumnValue);
242 QCOMPARE(f.getColumnPurpose(1), CSVFormat::ColumnLabel);
242 QCOMPARE(f.getTimingType(), CSVFormat::ImplicitTiming); 243 QCOMPARE(f.getTimingType(), CSVFormat::ImplicitTiming);
243 } 244 }
244 245
245 void modelType2DImplicitWithHeader() { 246 void modelType2DImplicitWithHeader() {
246 CSVFormat f; 247 CSVFormat f;
247 QVERIFY(f.guessFormatFor(csvDir.filePath("model-type-2d-implicit-header.csv"))); 248 QVERIFY(f.guessFormatFor(csvDir.filePath("model-type-2d-implicit-header.csv")));
248 QCOMPARE(f.getColumnCount(), 2); 249 QCOMPARE(f.getColumnCount(), 2);
249 QCOMPARE(f.getHeaderStatus(), CSVFormat::HeaderPresent); 250 QCOMPARE(f.getHeaderStatus(), CSVFormat::HeaderPresent);
250 QCOMPARE(f.getColumnPurpose(0), CSVFormat::ColumnValue); 251 QCOMPARE(f.getColumnPurpose(0), CSVFormat::ColumnValue);
252 QCOMPARE(f.getColumnPurpose(1), CSVFormat::ColumnLabel);
251 QCOMPARE(f.getTimingType(), CSVFormat::ImplicitTiming); 253 QCOMPARE(f.getTimingType(), CSVFormat::ImplicitTiming);
252 } 254 }
253 255
254 void modelType2DEndTimeSamples() { 256 void modelType2DEndTimeSamples() {
255 CSVFormat f; 257 CSVFormat f;