~ubuntu-branches/ubuntu/quantal/ibus/quantal

« back to all changes in this revision

Viewing changes to src/tests/ibus-configservice.c

  • Committer: Bazaar Package Importer
  • Author(s): Barry Warsaw
  • Date: 2011-08-11 17:00:57 UTC
  • mfrom: (6.2.14 sid)
  • Revision ID: james.westby@ubuntu.com-20110811170057-6dmbfs4s3cchzl7x
Tags: 1.3.99.20110419-1ubuntu1
* Merge with Debian unstable.  Remaining Ubuntu changes:
  - Indicator support:
    + Add 05_appindicator.patch: Use an indicator rather than a notification
      icon.
    + debian/control: Recommend python-appindicator.
  - debian/control: Install im-switch instead of im-config by default.
  - debian/README.source: Removed, it was outdated and no longer correct
  - debian/patches/01_ubuntu_desktop: Fix "Desktop entry needs the
    X-Ubuntu-Gettext-Domain key"  (LP: #457632)
  - debian/patches/02_title_update.patch: Rename "IBus Preferences" to
    "Keyboard Input Methods"
  - debian/patches/06_locale_parser.patch: Cherry-picked from upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <ibus.h>
 
2
 
 
3
static gboolean
 
4
timeout_cb (gpointer data)
 
5
{
 
6
    g_main_loop_quit ((GMainLoop *)data);
 
7
    return FALSE;
 
8
}
 
9
 
 
10
static void
 
11
run_loop_with_timeout (gint interval)
 
12
{
 
13
    GMainLoop *loop = g_main_loop_new (NULL, FALSE);
 
14
    g_timeout_add (interval, timeout_cb, loop);
 
15
    g_main_loop_run (loop);
 
16
    g_main_loop_unref (loop);
 
17
}
 
18
 
 
19
static void
 
20
test_configservice (void)
 
21
{
 
22
    IBusBus *bus = ibus_bus_new ();
 
23
    IBusConfigService *config = ibus_config_service_new (ibus_bus_get_connection (bus));
 
24
    ibus_bus_request_name (bus, "test.config", 0);
 
25
 
 
26
    run_loop_with_timeout (1000);
 
27
 
 
28
    g_object_unref (config);
 
29
    g_object_unref (bus);
 
30
}
 
31
 
 
32
gint
 
33
main (gint    argc,
 
34
      gchar **argv)
 
35
{
 
36
    g_mem_set_vtable (glib_mem_profiler_table);
 
37
    g_type_init ();
 
38
    g_test_init (&argc, &argv, NULL);
 
39
 
 
40
    g_test_add_func ("/ibus/configservice", test_configservice);
 
41
 
 
42
    return g_test_run ();
 
43
}