[libgnome-keyring] Return GNOME_KEYRING_RESULT_NO_MATCH when no secret is found



commit 4f3c8637e3c455038d7fca73e8511d0401b24709
Author: Stef Walter <stef memberwebs com>
Date:   Tue Mar 30 16:49:55 2010 +0200

    Return GNOME_KEYRING_RESULT_NO_MATCH when no secret is found
    
    This reverts 18affdaa, but really fixes
    https://bugzilla.gnome.org/show_bug.cgi?id=608510

 library/gnome-keyring.c       |    2 +-
 library/tests/test-keyrings.c |    9 ++++-----
 2 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/library/gnome-keyring.c b/library/gnome-keyring.c
index 88bdf27..9c8486a 100644
--- a/library/gnome-keyring.c
+++ b/library/gnome-keyring.c
@@ -4548,7 +4548,7 @@ find_password_1_reply (GkrOperation *op, const char *path, gpointer user_data)
 	/* All done, complete the operation here */
 	if (path == NULL) {
 		cb = gkr_operation_pop (op);
-		gkr_callback_invoke_ok_string (cb, NULL);
+		gkr_callback_invoke_res (cb, GNOME_KEYRING_RESULT_NO_MATCH);
 
 	/* We need a session to get the secret for this item */
 	} else {
diff --git a/library/tests/test-keyrings.c b/library/tests/test-keyrings.c
index c5789f8..433f929 100644
--- a/library/tests/test-keyrings.c
+++ b/library/tests/test-keyrings.c
@@ -495,15 +495,14 @@ static void
 done_find_no_password (GnomeKeyringResult res, const gchar* password, gpointer unused)
 {
 	find_no_password_result = res;
-	if(res == GNOME_KEYRING_RESULT_OK)
-		g_assert (password == NULL);
+	g_assert (password == NULL);
 	test_mainloop_quit ();
 }
 
 DEFINE_TEST(find_no_password)
 {
 	GnomeKeyringResult res;
-	gchar *password;
+	gchar *password = NULL;
 	gpointer op;
 
 	/* Synchronous, valid*/
@@ -511,7 +510,7 @@ DEFINE_TEST(find_no_password)
 	                                        "dog", "grunt",
 	                                        "legs", 1000,
 	                                        NULL);
-	g_assert_cmpint (GNOME_KEYRING_RESULT_OK, ==, res);
+	g_assert_cmpint (GNOME_KEYRING_RESULT_NO_MATCH, ==, res);
 	g_assert (password == NULL);
 
 	/* Asynchronous, less arguments */
@@ -526,7 +525,7 @@ DEFINE_TEST(find_no_password)
 
 	test_mainloop_run (2000);
 
-	g_assert_cmpint (GNOME_KEYRING_RESULT_OK, ==, find_no_password_result);
+	g_assert_cmpint (GNOME_KEYRING_RESULT_NO_MATCH, ==, find_no_password_result);
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]