Commit graph

10 commits

Author SHA1 Message Date
Dirk Hohndel
787b12cff4 Remove unnecessary call from tests
Now that the WindowTitleUpdater is fixed we don't need to create an
instance in the tests, either.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-07 09:56:41 -08:00
Dirk Hohndel
9d8b0addf9 Correctly copy preferences
When just assigning one structure to the other we copy the string
pointers. If we then modify those strings in the copy, we happily free
the strings of the original. And then resetting the preferences equally
happily reused those strings, pointing to long since freed memory.

I think what I did now is excessive for the current use case in that it
copies a ton of strings that are unset in the default_prefs. But I figured
this is a rarely used function and I might as well do it correctly.

Also, once we implement multi user support with per user preferences we
will be copying completely populated preferences around (at least that's
my guess).

Fixes #940

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-06 10:19:43 +01:00
Dirk Hohndel
ade2067155 Git storage test: need to instantiate the window title updater class
Otherwise calling the static function can cause a crash in
mark_divelist_changed()

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-18 12:05:07 -07:00
Robert C. Helling
40122e4233 Prevent tests from hanging when offline
From 31e324797c06d366f49db453a67a119819ca8012 Mon Sep 17 00:00:00 2001
From: "Robert C. Helling" <helling@atdotde.de>
Date: Wed, 2 Sep 2015 17:28:12 +0200
Subject: [PATCH] Test that there is a dive

so that the TestGitStorage does not hang when offline.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-02 09:11:20 -07:00
Dirk Hohndel
6d7faa106f Add test case for multi line dive notes merging
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-30 13:00:32 -07:00
Dirk Hohndel
72817ff47f Cloud storage: second merge test, delete dive on one side, modify on other
Delete a dive while offline, modify it from a different system while
online. Then resync.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 10:44:30 -07:00
Dirk Hohndel
9f5a944107 Cloud storage: first test case for a very simple merge
- We add a dive while offline.
- On a different computer (here simulated by a different local cache) we
  add a different file.
- Now we go back to the previous local cache (the one where we added a
  different dive in the first step) and take that online (i.e., connect to
  cloud storage). Now both of the new dives should have been added to our
  data file.

This is a rather trivial test with no conflict and a straight forward
merge. We need to add a lot more test cases to make sure this works as
expected and doesn't leave the user with a corrupt state.

Ideally whatever happens, the user should never see an error...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 10:44:15 -07:00
Dirk Hohndel
449ba2876f Cloud storage: test offline operation
All this really does is make sure that the fast forward works if the local
cache has received updates that haven't made it to the server, yet.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 10:44:10 -07:00
Dirk Hohndel
092abe9b39 Cloud storage: add test for simple save / load from our test account
This will fail if the proxy settings of the user running the test are
incorrect.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 10:43:57 -07:00
Dirk Hohndel
6eed3155e6 Add simple test for git storage
This just makes sure that writing data to git storage and reading it back
gives you the same result. Without the fixed generation of initial dive
site UUIDs this fails.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 10:43:41 -07:00