Merge branch 'gbytes-compare-docs' into 'master'
[glib.git] / gio / tests / gdbus-connection-flush-helper.c
blob172f3e8f32338614ea7ab3a7f75cde8c6808f7e4
1 /* GLib testing framework examples and tests
3 * Copyright (C) 2008-2010 Red Hat, Inc.
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.
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.
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/>.
18 * Author: David Zeuthen <davidz@redhat.com>
21 #include <gio/gio.h>
23 int
24 main (int argc,
25 char *argv[])
27 GDBusConnection *c;
28 GError *error;
29 gboolean ret;
31 error = NULL;
32 c = g_bus_get_sync (G_BUS_TYPE_SESSION,
33 NULL, /* GCancellable* */
34 &error);
35 g_assert_no_error (error);
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);
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);
54 /* and now exit immediately! */
55 return 0;