[maemo-commits] [maemo-commits] r11753 - in projects/haf/trunk/gconf2: . dbus-tests gconf

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue May 22 14:22:25 EEST 2007
Author: richard
Date: 2007-05-22 14:22:23 +0300 (Tue, 22 May 2007)
New Revision: 11753

Modified:
   projects/haf/trunk/gconf2/ChangeLog
   projects/haf/trunk/gconf2/dbus-tests/test-getting-and-setting.sh
   projects/haf/trunk/gconf2/dbus-tests/test-schema-bug.c
   projects/haf/trunk/gconf2/dbus-tests/test-schemas.schemas
   projects/haf/trunk/gconf2/gconf/gconf-database-dbus.c
   projects/haf/trunk/gconf2/gconf/gconf-dbus.c
   projects/haf/trunk/gconf2/gconf/gconfd-dbus.c
Log:
Improve tests.

Modified: projects/haf/trunk/gconf2/ChangeLog
===================================================================
--- projects/haf/trunk/gconf2/ChangeLog	2007-05-22 11:09:25 UTC (rev 11752)
+++ projects/haf/trunk/gconf2/ChangeLog	2007-05-22 11:22:23 UTC (rev 11753)
@@ -1,3 +1,21 @@
+2007-05-22  Richard Hult  <richard at imendio.com>
+
+	Improve tests and clean up:
+	
+	* dbus-tests/test-getting-and-setting.sh:
+	* dbus-tests/test-schema-bug.c: (main):
+	* dbus-tests/test-schemas.schemas: Use different keys for the
+	different tests so they don't interfere with each other.
+	
+	* gconf/gconf-database-dbus.c:
+	(database_handle_name_owner_changed),
+	(gconf_database_dbus_teardown): Remove obsolete comments.
+	(gconf_database_dbus_notify_listeners): Notify other listeners.
+	
+	* gconf/gconf-dbus.c: (gconf_engine_is_local):
+	* gconf/gconfd-dbus.c: (gconfd_dbus_get_connection): Remove
+	obsolete comments.
+
 2007-05-21  Richard Hult  <richard at imendio.com>
 
 	* gconf/gconf-dbus-utils.c: (utils_append_value_helper_pair),

Modified: projects/haf/trunk/gconf2/dbus-tests/test-getting-and-setting.sh
===================================================================
--- projects/haf/trunk/gconf2/dbus-tests/test-getting-and-setting.sh	2007-05-22 11:09:25 UTC (rev 11752)
+++ projects/haf/trunk/gconf2/dbus-tests/test-getting-and-setting.sh	2007-05-22 11:22:23 UTC (rev 11753)
@@ -4,68 +4,68 @@
 #
 
 # Test integers
-gconftool-2 --unset /foo/bar/int
+gconftool-2 --unset /foo-dbus/bar/int
 
-gconftool-2 --set --type int /foo/bar/int 69
-result=`gconftool-2 --get /foo/bar/int`
+gconftool-2 --set --type int /foo-dbus/bar/int 69
+result=`gconftool-2 --get /foo-dbus/bar/int`
 if test "$result" != "69"; then
   echo Expected "69", got $result
   exit 1
 fi
 
-gconftool-2 --unset /foo/bar/int
-result=`gconftool-2 --get /foo/bar/int 2>/dev/null`
+gconftool-2 --unset /foo-dbus/bar/int
+result=`gconftool-2 --get /foo-dbus/bar/int 2>/dev/null`
 if test -n "$result"; then
   echo Expected unset value got $result
   exit 1
 fi
 
 # Test floats
-gconftool-2 --unset /foo/bar/float
+gconftool-2 --unset /foo-dbus/bar/float
 
-gconftool-2 --set --type float /foo/bar/float 69.989999999999995
-result=`gconftool-2 --get /foo/bar/float`
+gconftool-2 --set --type float /foo-dbus/bar/float 69.989999999999995
+result=`gconftool-2 --get /foo-dbus/bar/float`
 if test "$result" != "69.989999999999995"; then
   echo Expected "69.989999999999995", got $result
   exit 1
 fi
 
-gconftool-2 --unset /foo/bar/float
-result=`gconftool-2 --get /foo/bar/float 2>/dev/null`
+gconftool-2 --unset /foo-dbus/bar/float
+result=`gconftool-2 --get /foo-dbus/bar/float 2>/dev/null`
 if test -n "$result"; then
   echo Expected unset value got $result
   exit 1
 fi
 
 # Test strings
-gconftool-2 --unset /foo/bar/string
+gconftool-2 --unset /foo-dbus/bar/string
 
-gconftool-2 --set --type string /foo/bar/string båzbözbäz
-result=`gconftool-2 --get /foo/bar/string`
+gconftool-2 --set --type string /foo-dbus/bar/string båzbözbäz
+result=`gconftool-2 --get /foo-dbus/bar/string`
 if test "$result" != "båzbözbäz"; then
   echo Expected "båzbözbäz", got $result
   exit 1
 fi
 
-gconftool-2 --unset /foo/bar/string
-result=`gconftool-2 --get /foo/bar/string 2>/dev/null`
+gconftool-2 --unset /foo-dbus/bar/string
+result=`gconftool-2 --get /foo-dbus/bar/string 2>/dev/null`
 if test -n "$result"; then
   echo Expected unset value got $result
   exit 1
 fi
 
 # Test bools 
-gconftool-2 --unset /foo/bar/bool
+gconftool-2 --unset /foo-dbus/bar/bool
 
-gconftool-2 --set --type string /foo/bar/bool true
-result=`gconftool-2 --get /foo/bar/bool`
+gconftool-2 --set --type string /foo-dbus/bar/bool true
+result=`gconftool-2 --get /foo-dbus/bar/bool`
 if test "$result" != "true"; then
   echo Expected "true", got $result
   exit 1
 fi
 
-gconftool-2 --unset /foo/bar/bool
-result=`gconftool-2 --get /foo/bar/bool 2>/dev/null`
+gconftool-2 --unset /foo-dbus/bar/bool
+result=`gconftool-2 --get /foo-dbus/bar/bool 2>/dev/null`
 if test -n "$result"; then
   echo Expected unset value got $result
   exit 1

Modified: projects/haf/trunk/gconf2/dbus-tests/test-schema-bug.c
===================================================================
--- projects/haf/trunk/gconf2/dbus-tests/test-schema-bug.c	2007-05-22 11:09:25 UTC (rev 11752)
+++ projects/haf/trunk/gconf2/dbus-tests/test-schema-bug.c	2007-05-22 11:22:23 UTC (rev 11753)
@@ -6,7 +6,7 @@
 #include <stdlib.h>
 #include <gconf/gconf-client.h>
 
-#define KEY "/foo/bar/string"
+#define KEY "/foo-schemas/bar/string"
 
 int
 main (int argc, char **argv)
@@ -19,13 +19,13 @@
 	g_type_init ();
 	
 	system ("gconftool-2 --install-schema-file test-schemas.schemas");
-	
+        
 	client = gconf_client_get_default ();
 	
 	gconf_client_unset (client, KEY, &err);
 	if (err) {
 		goto error;
-	}
+        }
 
 	val = gconf_client_get_string (client, KEY, &err);
 	if (err) {

Modified: projects/haf/trunk/gconf2/dbus-tests/test-schemas.schemas
===================================================================
--- projects/haf/trunk/gconf2/dbus-tests/test-schemas.schemas	2007-05-22 11:09:25 UTC (rev 11752)
+++ projects/haf/trunk/gconf2/dbus-tests/test-schemas.schemas	2007-05-22 11:22:23 UTC (rev 11753)
@@ -2,8 +2,8 @@
   <schemalist>
 
     <schema>
-      <key>/schemas/foo/bar/string</key>
-      <applyto>/foo/bar/string</applyto>
+      <key>/schemas/foo-schemas/bar/string</key>
+      <applyto>/foo-schemas/bar/string</applyto>
       <owner>foo</owner>
       <type>string</type>
       <default>baz</default>

Modified: projects/haf/trunk/gconf2/gconf/gconf-database-dbus.c
===================================================================
--- projects/haf/trunk/gconf2/gconf/gconf-database-dbus.c	2007-05-22 11:09:25 UTC (rev 11752)
+++ projects/haf/trunk/gconf2/gconf/gconf-database-dbus.c	2007-05-22 11:22:23 UTC (rev 11753)
@@ -237,8 +237,6 @@
       return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
     }
 
-  g_print ("client died\n");
-  
   g_hash_table_foreach (db->notifications, get_all_notifications_func,
 			&notifications);
   
@@ -257,7 +255,6 @@
   if (client)
     database_remove_listening_client (db, client);
 
-  /* FIXME: Remove notification on this client */
   g_list_free (notifications);
 
   return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
@@ -836,8 +833,6 @@
 {
   DBusConnection *conn;
 
-  g_print ("tearing down...\n");
-
   conn = gconfd_dbus_get_connection ();
 
   dbus_connection_unregister_object_path (conn, db->object_path);
@@ -847,10 +842,6 @@
 				 db);
   g_free (db->object_path);
   db->object_path = NULL;
-
-  // db->notifications
-  // db->listening_clients
-  
 }
 
 const char *
@@ -941,8 +932,7 @@
     {
       g_return_if_fail (modified_sources != NULL);
       
-      // FIXME: Implement this:
-      //gconfd_notify_other_listeners (db, modified_sources, key);
+      gconfd_notify_other_listeners (db, modified_sources, key);
       
       g_list_free (modified_sources->sources);
       g_free (modified_sources);

Modified: projects/haf/trunk/gconf2/gconf/gconf-dbus.c
===================================================================
--- projects/haf/trunk/gconf2/gconf/gconf-dbus.c	2007-05-22 11:09:25 UTC (rev 11752)
+++ projects/haf/trunk/gconf2/gconf/gconf-dbus.c	2007-05-22 11:22:23 UTC (rev 11753)
@@ -573,7 +573,6 @@
   return conf->is_local;
 }
 
-// foooo
 static void
 register_engine (GConfEngine *conf)
 {

Modified: projects/haf/trunk/gconf2/gconf/gconfd-dbus.c
===================================================================
--- projects/haf/trunk/gconf2/gconf/gconfd-dbus.c	2007-05-22 11:09:25 UTC (rev 11752)
+++ projects/haf/trunk/gconf2/gconf/gconfd-dbus.c	2007-05-22 11:22:23 UTC (rev 11753)
@@ -394,82 +394,3 @@
   return bus_conn;
 }
 
-#if 0
-void
-gconfd_dbus_notify_other_listeners (GConfDatabase *modified_db,
-				    GConfSources  *modified_sources,
-				    const char    *key)
-{
-  GList *tmp;
-
-  if (!modified_sources)
-    return;
-  
-  tmp = db_list;
-  while (tmp != NULL)
-    {
-      GConfDatabase *db = tmp->data;
-
-      if (db != modified_db)
-	{
-	  GList *tmp2;
-
-	  tmp2 = modified_sources->sources;
-	  while (tmp2)
-	    {
-	      GConfSource *modified_source = tmp2->data;
-
-	      if (gconf_sources_is_affected (db->sources, modified_source, key))
-		{
-		  GConfValue  *value;
-		  ConfigValue *cvalue;
-		  GError      *error;
-		  gboolean     is_default;
-		  gboolean     is_writable;
-
-		  error = NULL;
-		  value = gconf_database_query_value (db,
-						      key,
-						      NULL,
-						      TRUE,
-						      NULL,
-						      &is_default,
-						      &is_writable,
-						      &error);
-		  if (error != NULL)
-		    {
-		      gconf_log (GCL_WARNING,
-				 _("Error obtaining new value for `%s': %s"),
-				 key, error->message);
-		      g_error_free (error);
-		      return;
-		    }
-
-		  if (value != NULL)
-		    {
-		      cvalue = gconf_corba_value_from_gconf_value (value);
-		      gconf_value_free (value);
-		    }
-		  else
-		    {
-		      cvalue = gconf_invalid_corba_value ();
-		    }
-
-		  gconf_database_notify_listeners (db,
-						   NULL,
-						   key,
-						   cvalue,
-						   is_default,
-						   is_writable,
-						   FALSE);
-		  CORBA_free (cvalue);
-		}
-
-	      tmp2 = tmp2->next;
-	    }
-	}
-
-      tmp = tmp->next;
-    }
-}
-#endif


More information about the maemo-commits mailing list