1 /* Regression test utilities
2 *
3 * Copyright © 2009-2018 Collabora Ltd. <http://www.collabora.co.uk/>
4 * Copyright © 2009-2011 Nokia Corporation
5 *
6 * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later
7 *
8 * Licensed under the Academic Free License version 2.1
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 * 02110-1301 USA
24 */
25
26 #ifdef HAVE_CONFIG_H
27 #include <config.h>
28 #endif
29
30 #include "util.h"
31
32 void
test_run_until_disconnected(DBusConnection * connection,GMainContext * context)33 test_run_until_disconnected (DBusConnection *connection,
34 GMainContext *context)
35 {
36 g_printerr ("Disconnecting... ");
37
38 dbus_connection_set_exit_on_disconnect (connection, FALSE);
39 dbus_connection_close (connection);
40
41 while (dbus_connection_get_is_connected (connection))
42 {
43 g_printerr (".");
44 g_main_context_iteration (context, TRUE);
45 }
46
47 g_printerr (" disconnected\n");
48 }
49