replace return value of mmi_set_result_cb 97/281597/1
authordyamy-lee <dyamy.lee@samsung.com>
Tue, 6 Sep 2022 07:54:40 +0000 (16:54 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Tue, 20 Sep 2022 04:52:30 +0000 (13:52 +0900)
Following a mmi_client_set_result_cb's error type is more clear than NOT_SUPPORTED error type.
So, changed it's return value following it on source code and test, too.

Change-Id: Id66f763de1904034ed321e22cbe52ad454a9c9df

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

index c698a4f..7023343 100644 (file)
--- a/src/mmi.c
+++ b/src/mmi.c
@@ -56,7 +56,7 @@ MMI_API int mmi_set_result_cb(int input_event_type, result_cb callback, void* us
        ret = mmi_client_set_result_cb(input_event_type, callback, user_data);
        if(ret != MMI_ERROR_NONE) {
                LOGE("Fail to set result cb(%d)", ret);
-               return MMI_ERROR_NOT_SUPPORTED;
+               return ret;
        }
 
        return MMI_ERROR_NONE;
index 4e9fb6a..0f08648 100644 (file)
@@ -126,7 +126,7 @@ TEST_F(MMIMainTest, MMISetResultCbFail)
        EXPECT_EQ(res, MMI_ERROR_NONE);
 
        res = mmi_set_result_cb(input_event_type, NULL, NULL);
-       EXPECT_EQ(res, MMI_ERROR_NOT_SUPPORTED);
+       EXPECT_EQ(res, MMI_ERROR_INVALID_PARAMETER);
 
        mmi_shutdown();
 }