aboutsummaryrefslogtreecommitdiffstats
path: root/tests/testparse.cpp
AgeCommit message (Collapse)Author
2017-05-06Add UDDF export-import testGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-05-06Fix memory leakGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-04-29Add SPDX header to testsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-01Cleanup for CSV testingGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-04-01Enable CSV import-export unit conversion testGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-04-01Export-import test for manual CSVGravatar Miika Turkia
Note that the actual validation of the result is currently disabled, so the tests will pass even though there are some bugs and rounding errors present. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-04-01Change parseCSV to support unit and file selectionGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-03-04Rework TestParse to make tests independent from each otherGravatar Jeremie Guichard
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-04Use proper order in QCOMPARE argumentsGravatar Jeremie Guichard
Expected value is the second argument of QCOMPARE, having the arguments in the right order avoid confusion when looking at error message in case of test failure. Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
2017-02-25Fix trailing '\r' test failure on WindowsGravatar Jeremie Guichard
Windows implementation of fwrite changes \n to \r\n for files opened in text mode. It caused failures in TestMerge and TestParse when comparing written files against reference data. Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
2017-02-24Use SUBSURFACE_TEST_DATA definition to point to test data dirGravatar Jeremie Guichard
Update tests with a (compile time) option SUBSURFACE_TEST_DATA, pointing to test data base path. It is needed for cross compilation cases. SUBSURFACE_TEST_DATA is set to SUBSURFACE_SOURCE by default, or configurable via cmake option -DSUBSURFACE_TEST_DATA="...". Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
2017-02-09Add test for merging multiple cylindersGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-02-09Reenable all of TestParseGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-02-09Fix dive number comparison for Seabear import testsGravatar Miika Turkia
2017-02-09Add numberField parameter for parse testingGravatar Miika Turkia
2017-02-09Fix typo on parse testingGravatar Miika Turkia
2017-02-06TestParse: disable failing testsGravatar Dirk Hohndel
I don't understand why the SeaBear tests fail... of course commenting out failing tests is exactly the wrong thing to do. But I'll open an issue on github instead. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-02-06TestParse: prevent crashesGravatar Dirk Hohndel
Two CSV imports are failing right now; we shouldn't access uninitialized memory when that happens. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-02-05TestParse: make sure we get one dive from SeabearHUDCGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-02-05Our tests are actually GUILESSGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-12-27Test line-by-line for equality on TestGravatar Tomaz Canabrava
We where testing the whole document, wich made qDebug completely bogus to see where we failed at testing the generated file. If we test line-by-line, we can know more easily where we failed. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-12-27Correctly open the resource fileGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05Fix compilation with the new folder architectureGravatar Tomaz Canabrava
A few more fixes for things that broke in commit 7be962bfc287 ("Move subsurface-core to core and qt-mobile to mobile-widgets"). [Dirk Hohndel: slightly edited and overlap with Linus' patch removed] Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Silence warnings in testparse.cppGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07Fix annoyances on file.cGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-29Make sure we don't create multiple dive sites with the same uuidGravatar Dirk Hohndel
This shouldn't happen, but in case there is a logic error higher up in the code somewhere, this will prevent it from happening, period. If the code asks for a new dive site with a specific uuid, simply return the existing dive site with that uuid. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-13Test case: compare DLD log with a saved oneGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-13Test case: reading zip and DLD parsingGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-27Update tests to use cleaner CSV parsing "API"Gravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25Change Seabear TestParse to use reduced parametersGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25Change TestParse to use reduced parametersGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-28Seabear import: fix detection of empty linesGravatar Miika Turkia
The old code trusted in Windows new lines with length of 3. The new code strips out spaces and line ending chars resulting in empty line being of length 0. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-28Test case: Seabear new formatGravatar Miika Turkia
This validates Seabear import from H3 and T1 dive computers that use new CSV format to store the logs. The fields wary depending on the dive mode, thus we need to parse the field configuration during import. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-27Test case: HUDC importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-26Test DM4 importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-24Create test case for DivingLog SQLite importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-16Remove all the no longer necessary code that aborts read of first V2 fileGravatar Dirk Hohndel
This was a poorly implemented hack when we executed the reverse geo lookup in the main thread and opening a V2 file could take a very long time. We need to do the "Welcome" message quite differently. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-24Adapt CSV test to include suitGravatar Dirk Hohndel
Also fixed it to correctly parse the mean depth (duh, a test that had a bug) and added a buddy field for good measure. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-24Add suit field for CSV importGravatar Miika Turkia
Fixes #853 [Dirk Hohndel: fixed test compile] Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-14Some simple test for file parsingGravatar Dirk Hohndel
With no V2 question shown - parsing fails when a V2 file is loaded - parsing succeeds when a V3 file is loaded - import of CSV file succeeds With V2 question shown - parsing succeeds when a V2 file is loaded Finally compare the output of reading in the various files with reference output included in the sources. My guess is that this test might be a bit fragile, but hey, it's a start. (reminder: the tests only get built when using cmake) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>