~ubuntu-branches/debian/sid/glib2.0/sid

« back to all changes in this revision

Viewing changes to gio/tests/gdbus-introspection.c

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2013-05-08 06:25:57 UTC
  • mfrom: (1.27.14) (3.1.181 experimental)
  • Revision ID: package-import@ubuntu.com-20130508062557-i7gbku66mls70gi2
Tags: 2.36.1-2
Merge experimental branch, upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
108
108
  GDBusConnection *connection;
109
109
  GError *error;
110
110
 
111
 
  session_bus_up ();
112
 
 
113
 
  /* TODO: wait a bit for the bus to come up.. ideally session_bus_up() won't return
114
 
   * until one can connect to the bus but that's not how things work right now
115
 
   */
116
 
  usleep (500 * 1000);
117
 
 
118
111
  error = NULL;
119
112
  connection = g_bus_get_sync (G_BUS_TYPE_SESSION,
120
113
                               NULL,
132
125
  g_assert_no_error (error);
133
126
 
134
127
  /* this is safe; testserver will exit once the bus goes away */
135
 
  g_assert (g_spawn_command_line_async (SRCDIR "/gdbus-testserver.py", NULL));
 
128
  g_assert (g_spawn_command_line_async ("./gdbus-testserver", NULL));
136
129
 
137
130
  _g_assert_property_notify (proxy, "g-name-owner");
138
131
 
308
301
main (int   argc,
309
302
      char *argv[])
310
303
{
311
 
  g_type_init ();
 
304
  gint ret;
 
305
 
312
306
  g_test_init (&argc, &argv, NULL);
313
307
 
314
308
  /* all the tests rely on a shared main loop */
315
309
  loop = g_main_loop_new (NULL, FALSE);
316
310
 
317
 
  /* all the tests use a session bus with a well-known address that we can bring up and down
318
 
   * using session_bus_up() and session_bus_down().
319
 
   */
320
 
  g_unsetenv ("DISPLAY");
321
 
  g_setenv ("DBUS_SESSION_BUS_ADDRESS", session_bus_get_temporary_address (), TRUE);
 
311
  session_bus_up ();
322
312
 
323
313
  g_test_add_func ("/gdbus/introspection-parser", test_introspection_parser);
324
314
  g_test_add_func ("/gdbus/introspection-generate", test_generate);
328
318
  g_test_add_func ("/gdbus/introspection-extra-data", test_extra_data);
329
319
#endif
330
320
 
331
 
  return g_test_run();
 
321
  ret = g_test_run ();
 
322
 
 
323
  session_bus_down ();
 
324
 
 
325
  return ret;
332
326
}