From 9d8774403d3eb201c0cc93f148b9fffd9a89b19e Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Tue, 15 Jan 2013 21:52:51 +0000 Subject: [PATCH] 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 --- src/tests/edbus/edbus_test_edbus_init.c | 61 +++++++++++++++++++++++++ 1 file changed, 61 insertions(+) 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) } END_TEST +START_TEST(edbus_test_edbus_conn) +{ + EDBus_Connection *conn; + int ret; + + ret = edbus_init(); + fail_if(ret != 1); + + /* + * let's use connection type == system, so it works without a session, + * however security rules may apply differently depending on the + * machine/user + */ + conn = edbus_connection_get(EDBUS_CONNECTION_TYPE_SYSTEM); + fail_if(conn == NULL); + + edbus_connection_unref(conn); + + ret = edbus_shutdown(); + fail_if(ret != 0); + + ecore_shutdown(); + +} +END_TEST + +START_TEST(edbus_test_edbus_conn_object) +{ + EDBus_Connection *conn; + EDBus_Object *obj; + int ret; + + ret = edbus_init(); + fail_if(ret != 1); + + /* + * let's use connection type == system, so it works without a D-Bus session. + * However security rules may apply differently depending on the + * machine/user + */ + conn = edbus_connection_get(EDBUS_CONNECTION_TYPE_SYSTEM); + fail_if(conn == NULL); + + obj = edbus_object_get(conn, "org.buu", "/org/buu"); + fail_if(obj == NULL); + + edbus_object_unref(obj); + + edbus_connection_unref(conn); + + ret = edbus_shutdown(); + fail_if(ret != 0); + + ecore_shutdown(); + +} +END_TEST + + void edbus_test_edbus_init(TCase *tc) { tcase_add_test(tc, edbus_test_edbus); tcase_add_test(tc, edbus_test_edbus_main_loop); + tcase_add_test(tc, edbus_test_edbus_conn); + tcase_add_test(tc, edbus_test_edbus_conn_object); }