1 /* GLib testing framework examples and tests 2 * 3 * Copyright (C) 2008-2010 Red Hat, Inc. 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Lesser General Public 7 * License as published by the Free Software Foundation; either 8 * version 2.1 of the License, or (at your option) any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General 16 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>. 17 * 18 * Author: David Zeuthen <davidz@redhat.com> 19 */ 20 21 #include <gio/gio.h> 22 23 int main(int argc,char * argv[])24 main (int argc, 25 char *argv[]) 26 { 27 GDBusConnection *c; 28 GError *error; 29 gboolean ret; 30 31 error = NULL; 32 c = g_bus_get_sync (G_BUS_TYPE_SESSION, 33 NULL, /* GCancellable* */ 34 &error); 35 g_assert_no_error (error); 36 37 error = NULL; 38 g_dbus_connection_emit_signal (c, 39 NULL, /* const gchar *destination_bus_name */ 40 "/org/gtk/GDBus/FlushObject", 41 "org.gtk.GDBus.FlushInterface", 42 "SomeSignal", 43 NULL, /* GVariant *parameters */ 44 &error); 45 g_assert_no_error (error); 46 47 error = NULL; 48 ret = g_dbus_connection_flush_sync (c, 49 NULL, /* GCancellable* */ 50 &error); 51 g_assert_no_error (error); 52 g_assert (ret); 53 54 /* and now exit immediately! */ 55 return 0; 56 } 57