From: Konrad Lipinski Date: Thu, 15 Sep 2016 08:50:40 +0000 (+0200) Subject: kdbus-test: fix test-policy-priv for non-TIZEN X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9be749520bf1496fb93f07b3c50fd0d88f3e3336;p=platform%2Fkernel%2Flinux-exynos.git kdbus-test: fix test-policy-priv for non-TIZEN --- diff --git a/tools/testing/selftests/kdbus/kdbus-util.h b/tools/testing/selftests/kdbus/kdbus-util.h index 09c559aaa7a0..3ca545cf89b5 100644 --- a/tools/testing/selftests/kdbus/kdbus-util.h +++ b/tools/testing/selftests/kdbus/kdbus-util.h @@ -16,7 +16,8 @@ #include #include -#define TIZEN /* backwards-incompatible tizen customizations */ +/* backwards-incompatible tizen customizations */ +#define TIZEN #ifdef TIZEN #define ONTIZEN(TIZEN,NONTIZEN) TIZEN #else diff --git a/tools/testing/selftests/kdbus/test-policy-priv.c b/tools/testing/selftests/kdbus/test-policy-priv.c index 4f8f9b360b7a..78412470284b 100644 --- a/tools/testing/selftests/kdbus/test-policy-priv.c +++ b/tools/testing/selftests/kdbus/test-policy-priv.c @@ -75,13 +75,14 @@ static wur int test_policy_priv_by_broadcast(const char *bus, * If we expect the child to get the broadcast * message, then check the received cookie. */ - if (child_status == 0) + if (!child_status) { ASSERT_EXIT(expected_cookie,==,msg->cookie); + kdbus_msg_free(msg); + } /* Use expected_cookie since 'msg' might be NULL */ ASSERT_EXIT_ZERO(kdbus_msg_send(child, NULL, expected_cookie + 1, 0, 0, 0, KDBUS_DST_ID_BROADCAST)); - kdbus_msg_free(msg); kdbus_conn_free(child); }), ({ @@ -94,16 +95,17 @@ static wur int test_policy_priv_by_broadcast(const char *bus, ASSERT_ZERO(kdbus_msg_send(child_2, NULL, expected_cookie, 0, 0, 0, KDBUS_DST_ID_BROADCAST)); /* Use a little bit high time */ - ASSERT_RETURN(parent_status,==,kdbus_msg_recv_poll(child_2, 1000, &msg, NULL)); + ret = kdbus_msg_recv_poll(child_2, 1000, &msg, NULL); + ASSERT_RETURN(parent_status,==,ret); /* * Check returned cookie in case we expect * success. */ - if (ret == 0) + if (!ret) { ASSERT_RETURN(msg->cookie,==,expected_cookie + 1); - - kdbus_msg_free(msg); + kdbus_msg_free(msg); + } } else { /* * Two unprivileged users will try to @@ -127,10 +129,11 @@ static wur int test_policy_priv_by_broadcast(const char *bus, * Check returned cookie in case we expect * success. */ - if (ret == 0) + if (!ret) { ASSERT_EXIT(msg->cookie,==,expected_cookie + 1); + kdbus_msg_free(msg); + } - kdbus_msg_free(msg); kdbus_conn_free(child_2); }), ({}));