In case of QCOMPARE failure, code following the comparison
is not executed, this results in application state not being
properly resorted and often gives several test failures,
when only one test really fails.
Using QTest cleanup method allows restoring proper state,
before next test is executed.
Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
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>
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>
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>
We do some merging in a couple of the other tests as well, but the idea
is to have specific test cases that exercise our merge logic.
This one starts simple. Merge a dive with some valid info with a second
one that has less data filled. And then try it in both possible orders.
It shows a few potential problems.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>