subsurface/tests/testparse.h
Jeremie Guichard b9a3dfb86b Rework TestParse to make tests independent from each other
In the original version, parsing and comparing output was
done in separate test methods. This was forbidding use of
QTest cleanup to call clear_dive_file_data().
As a side effect a failure in one test would make other tests
failing too (since call to clear_dive_file_data was skipped
by QCOMPARE failure).

Added a FILE_COMPARE macro to avoid code duplication.

Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
2017-03-04 12:03:33 -08:00

30 lines
470 B
C++

#ifndef TESTPARSE_H
#define TESTPARSE_H
#include <QtTest>
#include <sqlite3.h>
class TestParse : public QObject{
Q_OBJECT
private slots:
void initTestCase();
void init();
void cleanup();
int parseCSV();
int parseDivingLog();
int parseV2NoQuestion();
int parseV3();
void testParse();
void testParseDM4();
void testParseHUDC();
void testParseNewFormat();
void testParseDLD();
void testParseMerge();
private:
sqlite3 *_sqlite3_handle = NULL;
};
#endif