diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2016-03-23 12:12:11 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-03-23 12:12:11 -0700 |
commit | aef63649219ab1e73d8385b1de66758a2621ba3e (patch) | |
tree | 42157da7d58b27608f45570cb035ec1796d53ff6 /tests/testgitstorage.cpp | |
parent | cc0f29898068c376c38563e9e60f2a5d978abc0c (diff) | |
download | subsurface-aef63649219ab1e73d8385b1de66758a2621ba3e.tar.gz |
Prevent possible SIGSEGV in test
If the load fails the get_dive(1) could return NULL. Let's catch that as
an error instead of having the test crash.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'tests/testgitstorage.cpp')
-rw-r--r-- | tests/testgitstorage.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/testgitstorage.cpp b/tests/testgitstorage.cpp index 891982151..30417b3c4 100644 --- a/tests/testgitstorage.cpp +++ b/tests/testgitstorage.cpp @@ -233,6 +233,7 @@ void TestGitStorage::testGitStorageCloudMerge2() QCOMPARE(parse_file(qPrintable(cloudTestRepo)), 0); process_dives(false, false); dive = get_dive(1); + QVERIFY(dive != NULL); free(dive->notes); dive->notes = strdup("These notes have been modified by TestGitStorage"); QCOMPARE(save_dives(qPrintable(cloudTestRepo)), 0); |