diff options
author | Jeremie Guichard <djebrest@gmail.com> | 2017-03-03 13:33:25 +0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-03-04 12:03:33 -0800 |
commit | 5caa9b23fe3195c758f9b6f1a9ab5f7bf88ee45c (patch) | |
tree | 0eb92e14fdda8fc9b8f858df3204970b2ce2fde7 /tests/testgitstorage.cpp | |
parent | 16a321d43b654cd756f5e2b54d72bad80e493b69 (diff) | |
download | subsurface-5caa9b23fe3195c758f9b6f1a9ab5f7bf88ee45c.tar.gz |
Use QTest cleanup method for proper test shutdown
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>
Diffstat (limited to 'tests/testgitstorage.cpp')
-rw-r--r-- | tests/testgitstorage.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/testgitstorage.cpp b/tests/testgitstorage.cpp index 46e77142d..f2fe3f0e1 100644 --- a/tests/testgitstorage.cpp +++ b/tests/testgitstorage.cpp @@ -59,6 +59,11 @@ void TestGitStorage::initTestCase() QCOMPARE(localCacheDirectory.removeRecursively(), true); } +void TestGitStorage::cleanup() +{ + clear_dive_file_data(); +} + void TestGitStorage::testGitStorageLocal_data() { // test different path we may encounter (since storage depends on user name) @@ -92,7 +97,6 @@ void TestGitStorage::testGitStorageLocal() QString readin = orgS.readAll(); QString written = outS.readAll(); QCOMPARE(readin, written); - clear_dive_file_data(); } void TestGitStorage::testGitStorageCloud() @@ -115,7 +119,6 @@ void TestGitStorage::testGitStorageCloud() QString readin = orgS.readAll(); QString written = outS.readAll(); QCOMPARE(readin, written); - clear_dive_file_data(); } void TestGitStorage::testGitStorageCloudOfflineSync() @@ -165,7 +168,6 @@ void TestGitStorage::testGitStorageCloudOfflineSync() readin = orgS2.readAll(); written = outS2.readAll(); QCOMPARE(readin, written); - clear_dive_file_data(); } void TestGitStorage::testGitStorageCloudMerge() @@ -213,7 +215,6 @@ void TestGitStorage::testGitStorageCloudMerge() QString readin = orgS.readAll(); QString written = outS.readAll(); QCOMPARE(readin, written); - clear_dive_file_data(); } void TestGitStorage::testGitStorageCloudMerge2() @@ -268,7 +269,6 @@ void TestGitStorage::testGitStorageCloudMerge2() QString readin = orgS.readAll(); QString written = outS.readAll(); QCOMPARE(readin, written); - clear_dive_file_data(); } void TestGitStorage::testGitStorageCloudMerge3() @@ -334,7 +334,6 @@ void TestGitStorage::testGitStorageCloudMerge3() QCOMPARE(save_dives("./SampleDivesMerge3.ssrf"), 0); // we are not trying to compare this to a pre-determined result... what this test // checks is that there are no parsing errors with the merge - clear_dive_file_data(); } QTEST_GUILESS_MAIN(TestGitStorage) |