diff options
author | Jeremie Guichard <djebrest@gmail.com> | 2017-03-04 22:06:52 +0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-03-04 12:03:33 -0800 |
commit | b9a3dfb86ba7a913075a286af843b65243e3bfef (patch) | |
tree | d977fddf51a70b77fdd2385fbde5b26c4a9f80dd /tests/testparse.h | |
parent | 5caa9b23fe3195c758f9b6f1a9ab5f7bf88ee45c (diff) | |
download | subsurface-b9a3dfb86ba7a913075a286af843b65243e3bfef.tar.gz |
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>
Diffstat (limited to 'tests/testparse.h')
-rw-r--r-- | tests/testparse.h | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/tests/testparse.h b/tests/testparse.h index c11420794..a79ce5a38 100644 --- a/tests/testparse.h +++ b/tests/testparse.h @@ -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 |