[libgnome-keyring] Try and reset the default keyring after running tests on a daemon.
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgnome-keyring] Try and reset the default keyring after running tests on a daemon.
- Date: Thu, 15 Sep 2011 10:01:36 +0000 (UTC)
commit 67511dcaa05f1ad322c87352ad71fff764c361c2
Author: Stef Walter <stefw collabora co uk>
Date: Thu Sep 15 12:00:22 2011 +0200
Try and reset the default keyring after running tests on a daemon.
library/tests/test-keyrings.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/library/tests/test-keyrings.c b/library/tests/test-keyrings.c
index dadf76d..b7a7981 100644
--- a/library/tests/test-keyrings.c
+++ b/library/tests/test-keyrings.c
@@ -33,6 +33,7 @@
#include <unistd.h>
static GList* keyrings = NULL;
+static gchar *default_name = NULL;
#define PASSWORD "my-keyring-password"
#define KEYRING_NAME "unit-test-keyring"
@@ -96,6 +97,9 @@ test_set_default_keyring (void)
GnomeKeyringResult res;
gchar* name;
+ res = gnome_keyring_get_default_keyring_sync (&default_name);
+ g_assert_cmpint (GNOME_KEYRING_RESULT_OK, ==, res);
+
res = gnome_keyring_set_default_keyring_sync (KEYRING_NAME);
g_assert_cmpint (GNOME_KEYRING_RESULT_OK, ==, res);
@@ -750,6 +754,12 @@ main (int argc, char **argv)
if (daemon_start ()) {
ret = g_test_run ();
+
+ if (default_name) {
+ gnome_keyring_set_default_keyring_sync (default_name);
+ g_free (default_name);
+ }
+
daemon_stop ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]