~ubuntu-branches/ubuntu/quantal/vala/quantal

« back to all changes in this revision

Viewing changes to tests/dbus/bug602003.test

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-09-20 19:57:26 UTC
  • mfrom: (1.5.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20100920195726-cbxb3q400aj1hoqr
Tags: 0.10.0-0ubuntu1
* New upstream release
* debian/patches/90_revert_use_new_gir_version.patch:
  - don't build with new GIR

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
        }
28
28
}
29
29
 
30
 
Application app;
 
30
MainLoop main_loop;
31
31
 
32
32
void client_exit (Pid pid, int status) {
33
33
        // client finished, terminate server
34
34
        assert (status == 0);
35
 
        app.quit ();
 
35
        main_loop.quit ();
36
36
}
37
37
 
38
38
void main () {
40
40
        conn.register_object ("/org/example/test", new Test ());
41
41
 
42
42
        // try to register service in session bus
43
 
        app = new Application ("org.example.Test");
 
43
        var request_result = conn.call_sync ("org.freedesktop.DBus", "/org/freedesktop/DBus", "org.freedesktop.DBus", "RequestName",
 
44
                                              new Variant ("(su)", "org.example.Test", 0x4), null, 0, -1);
 
45
        assert ((uint) request_result.get_child_value (0) == 1);
44
46
 
45
47
        // server ready, spawn client
46
48
        Pid client_pid;
47
49
        Process.spawn_async (null, { "test", "/dbus/bug602003/client" }, null, SpawnFlags.DO_NOT_REAP_CHILD, null, out client_pid);
48
50
        ChildWatch.add (client_pid, client_exit);
49
51
 
50
 
        app.run ();
 
52
        main_loop = new MainLoop ();
 
53
        main_loop.run ();
51
54
}