change return value 18/281618/1
authordyamy-lee <dyamy.lee@samsung.com>
Thu, 15 Sep 2022 08:32:53 +0000 (17:32 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Tue, 20 Sep 2022 05:09:39 +0000 (14:09 +0900)
this patch changed some functions' return value from INVALID_PARAMETER to OPERATION_FAILED.
Using operation vailed error is more proper, because these variables are managed internal.

Change-Id: I2e5fd908aa5f615e16d2e9730a526fff3816085e

src/mmi-client.c
src/mmi-ipc.c
tests/mmi-main-test.cpp

index 6c4088a..446b3a3 100644 (file)
@@ -111,7 +111,7 @@ int mmi_client_set_result_cb(int input_event_type, mmi_result_cb callback, void*
 
        if (mmi_h == NULL) {
                LOGE("Fail to get client");
-               return MMI_ERROR_INVALID_PARAMETER;
+               return MMI_ERROR_OPERATION_FAILED;
        }
 
        mmi_result_cb_s* input_result_callback = (mmi_result_cb_s*)calloc(1, sizeof(mmi_result_cb_s));
index 03fcc31..5872c08 100644 (file)
@@ -146,13 +146,13 @@ int mmi_ipc_register_input_event_result_cb(int input_event_type, rpc_port_proxy_
        mmi_handle client = mmi_client_get();
        if (client == NULL) {
                LOGE("Fail to get client");
-               return MMI_ERROR_INVALID_PARAMETER;
+               return MMI_ERROR_OPERATION_FAILED;
        }
 
        rpc_port_proxy_mmi_h rpc_h = client->rpc_h;
        if (rpc_h == NULL) {
                LOGE("Fail to get tidl rpc info");
-               return MMI_ERROR_INVALID_PARAMETER;
+               return MMI_ERROR_OPERATION_FAILED;
        }
 
        if (mmi_ipc_is_connected() == false) {
@@ -200,13 +200,13 @@ int mmi_ipc_activate_input_event(int input_event_type)
        mmi_handle client = mmi_client_get();
        if (client == NULL) {
                LOGE("Fail to get client");
-               return MMI_ERROR_INVALID_PARAMETER;
+               return MMI_ERROR_OPERATION_FAILED;
        }
 
        rpc_port_proxy_mmi_h rpc_h = client->rpc_h;
        if (rpc_h == NULL) {
                LOGE("Fail to get tidl rpc info");
-               return MMI_ERROR_INVALID_PARAMETER;
+               return MMI_ERROR_OPERATION_FAILED;
        }
 
        if (mmi_ipc_is_connected() == false) {
index 224a12c..fdf3c5d 100644 (file)
@@ -157,7 +157,7 @@ TEST_F(MMIMainTest, MMISetResultCbFailNoClient)
        mmi_client_destroy();
 
        res = mmi_set_result_cb(input_event_type, voice_touch_callback, NULL);
-       EXPECT_EQ(res, MMI_ERROR_INVALID_PARAMETER);
+       EXPECT_EQ(res, MMI_ERROR_OPERATION_FAILED);
 
        mmi_deinitialize();
 }
@@ -175,7 +175,7 @@ TEST_F(MMIMainTest, MMISetResultCbFailNoRpcHandle)
        mmi_client->rpc_h = NULL;
 
        res = mmi_set_result_cb(input_event_type, voice_touch_callback, NULL);
-       EXPECT_EQ(res, MMI_ERROR_INVALID_PARAMETER);
+       EXPECT_EQ(res, MMI_ERROR_OPERATION_FAILED);
 
        mmi_deinitialize();
 }
@@ -241,7 +241,7 @@ TEST_F(MMIMainTest, MMIActivateInputEventFailNoRpcHandle)
        mmi_client->rpc_h = NULL;
 
        res = mmi_activate_input_event(input_event_type);
-       EXPECT_EQ(res, MMI_ERROR_INVALID_PARAMETER);
+       EXPECT_EQ(res, MMI_ERROR_OPERATION_FAILED);
 
        mmi_deinitialize();
 }