bus_dispatch_sha1_test on Windows

Peter Kümmel syntheticpp at gmx.net
Fri Nov 24 14:42:13 PST 2006


On Windows sometimes and not reproducible the test
bus_dispatch_sha1_test fails in check_no_leftovers.

I've figured out that it is due to some unprocessed
initial messages which could be caught with the
attached patch.

Then, the whole function looks like this:

static void
spin_connection_until_authenticated (BusContext     *context,
                                     DBusConnection *connection)
{
  _dbus_verbose ("Spinning to auth connection %p\n", connection);
  while (!dbus_connection_get_is_authenticated (connection) &&
         dbus_connection_get_is_connected (connection))
    {
      bus_test_run_bus_loop (context, FALSE);
      bus_test_run_clients_loop (FALSE);
    }

  if ( dbus_connection_get_dispatch_status(connection) != DBUS_DISPATCH_COMPLETE)
    _dbus_assert_not_reached ("spin_connection_until_authenticated failed\n ");

  _dbus_verbose (" ... done spinning to auth connection %p\n", connection);
}

What could be the reason for the not dispatched messages?

Peter
-------------- next part --------------
Index: bus/dispatch.c
===================================================================
--- bus/dispatch.c	(revision 490)
+++ bus/dispatch.c	(working copy)
@@ -439,6 +439,10 @@
       bus_test_run_bus_loop (context, FALSE);
       bus_test_run_clients_loop (FALSE);
     }
+
+  if ( dbus_connection_get_dispatch_status(connection) != DBUS_DISPATCH_COMPLETE)
+    _dbus_assert_not_reached ("spin_connection_until_authenticated failed\n ");
+
   _dbus_verbose (" ... done spinning to auth connection %p\n", connection);
 


More information about the dbus mailing list