summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@profusion.mobi>2013-01-15 21:52:51 +0000
committerLucas De Marchi <lucas.demarchi@profusion.mobi>2013-01-15 21:52:51 +0000
commit9d8774403d3eb201c0cc93f148b9fffd9a89b19e (patch)
treefe19e4ef2b3a53e2310d69bf75a52138e2976f74
parent48e207859a3b46295f8ff227b6594b2a6f6539dd (diff)
efl/edbus: Add test for creating/destroy obj without mainloop
The second test was crashing before r82784, which is also the fix for terminology's issue with efreet_init()/efreet_shutown(). SVN revision: 82843
-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}