~elementary-os/ubuntu-package-imports/fcitx-xenial

« back to all changes in this revision

Viewing changes to test/testdbuslaunch.c

  • Committer: RabbitBot
  • Date: 2016-09-07 20:31:39 UTC
  • Revision ID: rabbitbot@elementary.io-20160907203139-bcsq3wop36c7w6yz
Initial import, version 1:4.2.9.1-1ubuntu1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <assert.h>
 
2
#include <stdio.h>
 
3
#include <signal.h>
 
4
#include "dbuslauncher.h"
 
5
 
 
6
int main()
 
7
{
 
8
    DBusDaemonProperty daemonProp = DBusLaunch(NULL);
 
9
    if (daemonProp.pid != 0)
 
10
    {
 
11
        assert(daemonProp.address != NULL);
 
12
        printf("dbus-daemon address %s\n", daemonProp.address);
 
13
        int result = DBusKill(&daemonProp);
 
14
        printf("kill dbus-daemon result %d\n", result);
 
15
    }
 
16
    else {
 
17
        assert(daemonProp.address == NULL);
 
18
        printf("dbus-daemon launch failed\n");
 
19
    }
 
20
 
 
21
    return 0;
 
22
}