gpointing-device-settings r204 - trunk/test



Author: hiikezoe
Date: Wed Mar 11 03:19:03 2009
New Revision: 204
URL: http://svn.gnome.org/viewvc/gpointing-device-settings?rev=204&view=rev

Log:
get failure test.

Modified:
   trunk/test/test-gconf.c

Modified: trunk/test/test-gconf.c
==============================================================================
--- trunk/test/test-gconf.c	(original)
+++ trunk/test/test-gconf.c	Wed Mar 11 03:19:03 2009
@@ -3,18 +3,27 @@
 #include <gcutter.h>
 
 void test_get_key_from_path (void);
+void test_get_non_existent (void);
 
 static const gchar *key;
+static gboolean boolean_value;
+static gint int_value;
+static const gchar *string_value;
+static GConfClient *gconf;
 
 void
 setup (void)
 {
     key = NULL;
+    string_value = NULL;
+
+    gconf = gconf_client_get_default();
 }
 
 void
 teardown (void)
 {
+    g_object_unref(gconf);
 }
 
 void
@@ -24,6 +33,20 @@
     cut_assert_equal_string("middle_button_emulation", key);
 }
 
+void
+test_get_non_existent (void)
+{
+    gchar *unique_key;
+
+    unique_key = gconf_unique_key();
+    key = gconf_concat_dir_and_key("/", unique_key);
+    g_free(unique_key);
+
+    cut_assert_false(gpds_gconf_get_boolean(gconf, key, &boolean_value));
+    cut_assert_false(gpds_gconf_get_int(gconf, key, &int_value));
+    cut_assert_false(gpds_gconf_get_string(gconf, key, &string_value));
+}
+
 /*
 vi:ts=4:nowrap:ai:expandtab:sw=4
 */



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