mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
5caa9b23fe
commit
b9a3dfb86b
2 changed files with 87 additions and 120 deletions
|
@ -2,25 +2,29 @@
|
|||
#define TESTPARSE_H
|
||||
|
||||
#include <QtTest>
|
||||
#include <sqlite3.h>
|
||||
|
||||
class TestParse : public QObject{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
void initTestCase();
|
||||
void testParseCSV();
|
||||
void testParseDivingLog();
|
||||
void testParseV2NoQuestion();
|
||||
void testParseV3();
|
||||
void testParseCompareOutput();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
int parseCSV();
|
||||
int parseDivingLog();
|
||||
int parseV2NoQuestion();
|
||||
int parseV3();
|
||||
void testParse();
|
||||
|
||||
void testParseDM4();
|
||||
void testParseCompareDM4Output();
|
||||
void testParseHUDC();
|
||||
void testParseCompareHUDCOutput();
|
||||
void testParseNewFormat();
|
||||
void testParseCompareNewFormatOutput();
|
||||
void testParseDLD();
|
||||
void testParseCompareDLDOutput();
|
||||
void testParseMerge();
|
||||
|
||||
private:
|
||||
sqlite3 *_sqlite3_handle = NULL;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue