summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/tests/edbus/edbus_test_edbus_init.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/tests/edbus/edbus_test_edbus_init.c b/src/tests/edbus/edbus_test_edbus_init.c
index a53393acba..2971892019 100644
--- a/src/tests/edbus/edbus_test_edbus_init.c
+++ b/src/tests/edbus/edbus_test_edbus_init.c
@@ -52,8 +52,69 @@ START_TEST(edbus_test_edbus_main_loop)
52} 52}
53END_TEST 53END_TEST
54 54
55START_TEST(edbus_test_edbus_conn)
56{
57 EDBus_Connection *conn;
58 int ret;
59
60 ret = edbus_init();
61 fail_if(ret != 1);
62
63 /*
64 * let's use connection type == system, so it works without a session,
65 * however security rules may apply differently depending on the
66 * machine/user
67 */
68 conn = edbus_connection_get(EDBUS_CONNECTION_TYPE_SYSTEM);
69 fail_if(conn == NULL);
70
71 edbus_connection_unref(conn);
72
73 ret = edbus_shutdown();
74 fail_if(ret != 0);
75
76 ecore_shutdown();
77
78}
79END_TEST
80
81START_TEST(edbus_test_edbus_conn_object)
82{
83 EDBus_Connection *conn;
84 EDBus_Object *obj;
85 int ret;
86
87 ret = edbus_init();
88 fail_if(ret != 1);
89
90 /*
91 * let's use connection type == system, so it works without a D-Bus session.
92 * However security rules may apply differently depending on the
93 * machine/user
94 */
95 conn = edbus_connection_get(EDBUS_CONNECTION_TYPE_SYSTEM);
96 fail_if(conn == NULL);
97
98 obj = edbus_object_get(conn, "org.buu", "/org/buu");
99 fail_if(obj == NULL);
100
101 edbus_object_unref(obj);
102
103 edbus_connection_unref(conn);
104
105 ret = edbus_shutdown();
106 fail_if(ret != 0);
107
108 ecore_shutdown();
109
110}
111END_TEST
112
113
55void edbus_test_edbus_init(TCase *tc) 114void edbus_test_edbus_init(TCase *tc)
56{ 115{
57 tcase_add_test(tc, edbus_test_edbus); 116 tcase_add_test(tc, edbus_test_edbus);
58 tcase_add_test(tc, edbus_test_edbus_main_loop); 117 tcase_add_test(tc, edbus_test_edbus_main_loop);
118 tcase_add_test(tc, edbus_test_edbus_conn);
119 tcase_add_test(tc, edbus_test_edbus_conn_object);
59} 120}