[network-manager-applet] test: ensure GConfClient is new before running each test



commit 2b51455f98a4b00811b9471462eced71509fbf4b
Author: Dan Williams <dcbw redhat com>
Date:   Mon Apr 4 15:13:34 2011 -0500

    test: ensure GConfClient is new before running each test
    
    If we get an old GConfClient (due to bad refcounting or whatever)
    then the stamp won't be what we expect, and some tests will mistakenly
    pass.

 src/gconf-helpers/tests/test-upgrade.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/gconf-helpers/tests/test-upgrade.c b/src/gconf-helpers/tests/test-upgrade.c
index 7433458..d36c9cd 100644
--- a/src/gconf-helpers/tests/test-upgrade.c
+++ b/src/gconf-helpers/tests/test-upgrade.c
@@ -32,6 +32,7 @@
 #include "fake-keyring.h"
 
 #define BASE_PATH "/system/networking/connections/"
+#define APPLET_PREFS_STAMP "/apps/nm-applet/stamp"
 
 static void
 test_import_xml (void)
@@ -271,8 +272,14 @@ test_upgrade_08_wifi (void)
 	GnomeKeyringAttributeList *attrs;
 	char *display_name = NULL;
 	GnomeKeyringResult ret;
+	guint32 stamp;
+	GError *error = NULL;
 
 	client = gconf_client_get_default ();
+	stamp = (guint32) gconf_client_get_int (client, APPLET_PREFS_STAMP, &error);
+	g_assert (stamp == 0);
+	g_assert_no_error (error);
+
 	success = fake_gconf_add_xml (client, TESTDIR "/08wifi.xml");
 	g_assert (success);
 
@@ -334,8 +341,14 @@ test_upgrade_08_vpnc (void)
 	GnomeKeyringAttributeList *attrs;
 	char *display_name = NULL;
 	GnomeKeyringResult ret;
+	guint32 stamp;
+	GError *error = NULL;
 
 	client = gconf_client_get_default ();
+	stamp = (guint32) gconf_client_get_int (client, APPLET_PREFS_STAMP, &error);
+	g_assert (stamp == 0);
+	g_assert_no_error (error);
+
 	success = fake_gconf_add_xml (client, TESTDIR "/08vpnc.xml");
 	g_assert (success);
 



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