From: jusung son Date: Fri, 8 Mar 2024 00:51:02 +0000 (+0900) Subject: [ITC/UTC][cion][NON-ACR] Add feature check X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2c0102f438f4695bc0138ab85ea79bfa6313deb8;p=test%2Ftct%2Fnative%2Fapi.git [ITC/UTC][cion][NON-ACR] Add feature check Change-Id: I62c4e120bb03dafd94657489fac664ac26326b85 Signed-off-by: jusung son (cherry picked from commit 036e92412e43710f278ba3f6a54e8c6eea6620e2) --- diff --git a/src/itc/cion/ITs-cion-client.c b/src/itc/cion/ITs-cion-client.c index 4011814c8..cc31c4e48 100755 --- a/src/itc/cion/ITs-cion-client.c +++ b/src/itc/cion/ITs-cion-client.c @@ -252,6 +252,8 @@ void ITs_cion_client_startup(void) remove(ERR_LOG); } + g_bCionNotSupported = CheckLightMemoryFeatureSupported(); + return; } diff --git a/src/itc/cion/ITs-cion-common.c b/src/itc/cion/ITs-cion-common.c index 1619cacaa..3f9efef81 100755 --- a/src/itc/cion/ITs-cion-common.c +++ b/src/itc/cion/ITs-cion-common.c @@ -88,4 +88,20 @@ gboolean Timeout(gpointer data) return false; } +/** +* @function CheckLightMemoryFeatureSupported +* @description Check the supported feature for the lite memory value +* @return true if supported else false +*/ +bool CheckLightMemoryFeatureSupported() { + bool is_supported = false; + int ret = system_info_get_custom_bool("com.samsung/featureconf/product.lite_memory.support", &is_supported); + + if (ret == SYSTEM_INFO_ERROR_NONE && is_supported) { + return true; + } + + return false; +} + /** @} */ diff --git a/src/itc/cion/ITs-cion-common.h b/src/itc/cion/ITs-cion-common.h index 7ae8c1746..6e0f30ba1 100755 --- a/src/itc/cion/ITs-cion-common.h +++ b/src/itc/cion/ITs-cion-common.h @@ -24,6 +24,7 @@ #include #include #include +#include #define API_NAMESPACE "CION_ITC" #define TIMEOUT_CB 60000 @@ -34,15 +35,25 @@ */ #define START_TEST {\ FPRINTF("[Line : %d][%s] Starting test : %s\\n", __LINE__, API_NAMESPACE, __FUNCTION__);\ + if(g_bCionNotSupported)\ + {\ + FPRINTF("[Line : %d][%s] Feature =%s not supported :success ", __LINE__, API_NAMESPACE, API_NAMESPACE);\ + return 0;\ + }\ } #define START_TEST_PAYLOAD {\ FPRINTF("[Line : %d][%s] Starting test : %s\\n", __LINE__, API_NAMESPACE, __FUNCTION__);\ + if(g_bCionNotSupported)\ + {\ + FPRINTF("[Line : %d][%s] Feature =%s not supported :success ", __LINE__, API_NAMESPACE, API_NAMESPACE);\ + return 0;\ + }\ if ( !g_bCionPayloadCreation )\ -{\ - FPRINTF("[Line : %d][%s] Precondition of cion failed so leaving test\\n", __LINE__, API_NAMESPACE);\ - return 1;\ -}\ + {\ + FPRINTF("[Line : %d][%s] Precondition of cion failed so leaving test\\n", __LINE__, API_NAMESPACE);\ + return 1;\ + }\ } #define RUN_POLLING_LOOP {\ @@ -82,6 +93,9 @@ static GMainLoop *g_pMainLoop = NULL; bool g_bCallbackCalled; gboolean Timeout(gpointer data); char *CionGetError(int nResult); +bool g_bCionNotSupported; +bool CheckLightMemoryFeatureSupported(); + /** @} */ #endif //_ITS_CION_COMMON_H_ diff --git a/src/itc/cion/ITs-cion-group.c b/src/itc/cion/ITs-cion-group.c index 979ac1c64..5e219d754 100755 --- a/src/itc/cion/ITs-cion-group.c +++ b/src/itc/cion/ITs-cion-group.c @@ -36,6 +36,8 @@ void ITs_cion_group_startup(void) remove(ERR_LOG); } + g_bCionNotSupported = CheckLightMemoryFeatureSupported(); + return; } diff --git a/src/itc/cion/ITs-cion-payload-async-result.c b/src/itc/cion/ITs-cion-payload-async-result.c index cc035cccc..bddeca0d7 100755 --- a/src/itc/cion/ITs-cion-payload-async-result.c +++ b/src/itc/cion/ITs-cion-payload-async-result.c @@ -132,6 +132,11 @@ void ITs_cion_payload_async_startup(void) { remove(ERR_LOG); } + + g_bCionNotSupported = CheckLightMemoryFeatureSupported(); + if (g_bCionNotSupported) + return; + int nRetVal = -1; if (connected) return; diff --git a/src/itc/cion/ITs-cion-payload.c b/src/itc/cion/ITs-cion-payload.c index 8cf8bb9cb..ecb7ddcf2 100755 --- a/src/itc/cion/ITs-cion-payload.c +++ b/src/itc/cion/ITs-cion-payload.c @@ -236,6 +236,11 @@ void ITs_cion_payload_startup(void) { remove(ERR_LOG); } + + g_bCionNotSupported = CheckLightMemoryFeatureSupported(); + if (g_bCionNotSupported) + return; + int nRetVal = -1; nRetVal = cion_payload_create(&g_hPayload, CION_PAYLOAD_TYPE_DATA); if (nRetVal != CION_ERROR_NONE) diff --git a/src/itc/cion/ITs-cion-peer-info.c b/src/itc/cion/ITs-cion-peer-info.c index 93d4bfd0c..e8e5d37dc 100755 --- a/src/itc/cion/ITs-cion-peer-info.c +++ b/src/itc/cion/ITs-cion-peer-info.c @@ -83,6 +83,12 @@ void ITs_cion_peer_info_startup(void) { remove(ERR_LOG); } + + g_bCionNotSupported = CheckLightMemoryFeatureSupported(); + if (g_bCionNotSupported) { + return; + } + int nRetVal = -1; nRetVal = cion_server_create(&g_hServer, "ITs_cion_peer_info_startup","ITs_cion_peer_info_startup", NULL); if (nRetVal != CION_ERROR_NONE) @@ -592,4 +598,4 @@ int ITc_cion_peer_info_get_display_name_p(void) } /** @} */ -/** @} */ \ No newline at end of file +/** @} */ diff --git a/src/itc/cion/ITs-cion-security.c b/src/itc/cion/ITs-cion-security.c index 389ec8f20..2a3d5791b 100755 --- a/src/itc/cion/ITs-cion-security.c +++ b/src/itc/cion/ITs-cion-security.c @@ -36,6 +36,10 @@ void ITs_cion_security_startup(void) remove(ERR_LOG); } + g_bCionNotSupported = CheckLightMemoryFeatureSupported(); + if (g_bCionNotSupported) + return; + return; } @@ -175,7 +179,7 @@ int ITc_cion_security_set_get_cert_path_p(void) nRetVal = cion_security_destroy(hSecurity); PRINT_RESULT_NORETURN(CION_ERROR_NONE, nRetVal, "cion_security_destroy", CionGetError(nRetVal)); return 1; - } + } FREE_MEMORY(pszGetPath); nRetVal = cion_security_destroy(hSecurity); PRINT_RESULT_NORETURN(CION_ERROR_NONE, nRetVal, "cion_security_destroy", CionGetError(nRetVal)); @@ -222,7 +226,7 @@ int ITc_cion_security_set_get_private_key_path_p(void) nRetVal = cion_security_destroy(hSecurity); PRINT_RESULT_NORETURN(CION_ERROR_NONE, nRetVal, "cion_security_destroy", CionGetError(nRetVal)); return 1; - } + } FREE_MEMORY(pszGetPath); nRetVal = cion_security_destroy(hSecurity); PRINT_RESULT_NORETURN(CION_ERROR_NONE, nRetVal, "cion_security_destroy", CionGetError(nRetVal)); diff --git a/src/itc/cion/ITs-cion-server.c b/src/itc/cion/ITs-cion-server.c index 57dfe8783..e1e4d8f8c 100755 --- a/src/itc/cion/ITs-cion-server.c +++ b/src/itc/cion/ITs-cion-server.c @@ -264,6 +264,10 @@ void ITs_cion_server_startup(void) remove(ERR_LOG); } + g_bCionNotSupported = CheckLightMemoryFeatureSupported(); + if (g_bCionNotSupported) + return; + return; } diff --git a/src/utc/cion/CMakeLists.txt b/src/utc/cion/CMakeLists.txt index 60ffbde90..caa469d17 100644 --- a/src/utc/cion/CMakeLists.txt +++ b/src/utc/cion/CMakeLists.txt @@ -14,6 +14,7 @@ SET(TC_SOURCES utc-cion-payload.c utc-cion-payload_async_result.c utc-cion-peer_info.c + utc-cion-common.c ) PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED diff --git a/src/utc/cion/utc-cion-client.c b/src/utc/cion/utc-cion-client.c index b57da50dc..1b52b899f 100644 --- a/src/utc/cion/utc-cion-client.c +++ b/src/utc/cion/utc-cion-client.c @@ -15,6 +15,7 @@ // #include "assert.h" #include "assert_common.h" +#include "utc-cion-common.h" #include #include @@ -75,6 +76,7 @@ static void __client_connection_result_cb1(const char *service_name, void utc_cion_client_startup(void) { + g_bCionNotSupported = CheckLightMemoryFeatureSupported(); } void utc_cion_client_cleanup(void) @@ -88,6 +90,7 @@ void utc_cion_client_cleanup(void) */ int utc_cion_client_create_p(void) { + START_TEST; int ret; cion_client_h client; @@ -106,6 +109,7 @@ int utc_cion_client_create_p(void) */ int utc_cion_client_create_n(void) { + START_TEST; int ret; cion_client_h client = NULL; @@ -125,6 +129,7 @@ int utc_cion_client_create_n(void) */ int utc_cion_client_destroy_p(void) { + START_TEST; int ret; cion_client_h client; @@ -144,6 +149,7 @@ int utc_cion_client_destroy_p(void) */ int utc_cion_client_destroy_n(void) { + START_TEST; int ret; ret = cion_client_destroy(NULL); @@ -164,6 +170,7 @@ static void __client_server_discovered_cb(const char *service_name, */ int utc_cion_client_try_discovery_p(void) { + START_TEST; int ret; cion_client_h client; @@ -185,6 +192,7 @@ int utc_cion_client_try_discovery_p(void) */ int utc_cion_client_try_discovery_n(void) { + START_TEST; int ret; cion_client_h client = (cion_client_h)1; @@ -204,6 +212,7 @@ int utc_cion_client_try_discovery_n(void) */ int utc_cion_client_stop_discovery_p(void) { + START_TEST; int ret; cion_client_h client; @@ -228,6 +237,7 @@ int utc_cion_client_stop_discovery_p(void) */ int utc_cion_client_stop_discovery_n(void) { + START_TEST; int ret; cion_client_h client = (cion_client_h)1; @@ -278,6 +288,7 @@ static void __client_server_discovered_cb2(const char *service_name, */ int utc_cion_client_connect_p(void) { + START_TEST; int ret; cion_client_h client; cion_server_h server; @@ -325,6 +336,7 @@ int utc_cion_client_connect_p(void) */ int utc_cion_client_connect_n(void) { + START_TEST; int ret; cion_client_h client = (cion_client_h)1; cion_peer_info_h peer = (cion_peer_info_h)1; @@ -399,6 +411,7 @@ static gpointer __send_data_thread(gpointer data) */ int utc_cion_client_disconnect_p(void) { + START_TEST; int ret; cion_server_h server; struct cbdata cbdata = { 0 }; @@ -448,6 +461,7 @@ int utc_cion_client_disconnect_p(void) */ int utc_cion_client_disconnect_n(void) { + START_TEST; int ret; ret = cion_client_disconnect(NULL); @@ -463,6 +477,7 @@ int utc_cion_client_disconnect_n(void) */ int utc_cion_client_send_data_p(void) { + START_TEST; int ret; cion_client_h client; cion_server_h server; @@ -527,6 +542,7 @@ int utc_cion_client_send_data_p(void) */ int utc_cion_client_send_data_n(void) { + START_TEST; int ret; cion_client_h client = (cion_client_h)1; unsigned char data[] = { 0 }; @@ -563,6 +579,7 @@ int utc_cion_client_send_data_n(void) */ int utc_cion_client_send_payload_async_p(void) { + START_TEST; int ret; cion_client_h client; cion_server_h server; @@ -628,6 +645,7 @@ static void __client_payload_async_result_cb( */ int utc_cion_client_send_payload_async_n(void) { + START_TEST; int ret; cion_client_h client = (cion_client_h)1; cion_payload_h payload = (cion_payload_h)1; @@ -650,6 +668,7 @@ int utc_cion_client_send_payload_async_n(void) */ int utc_cion_client_add_connection_result_cb_p(void) { + START_TEST; int ret; cion_client_h client; @@ -673,6 +692,7 @@ int utc_cion_client_add_connection_result_cb_p(void) */ int utc_cion_client_add_connection_result_cb_n(void) { + START_TEST; int ret; cion_client_h client = (cion_client_h)1; @@ -693,6 +713,7 @@ int utc_cion_client_add_connection_result_cb_n(void) */ int utc_cion_client_remove_connection_result_cb_p(void) { + START_TEST; int ret; cion_client_h client; @@ -720,6 +741,7 @@ int utc_cion_client_remove_connection_result_cb_p(void) */ int utc_cion_client_remove_connection_result_cb_n(void) { + START_TEST; int ret; cion_client_h client = (cion_client_h)1; @@ -747,6 +769,7 @@ static void __client_payload_received_cb(const char *service_name, */ int utc_cion_client_add_payload_received_cb_p(void) { + START_TEST; int ret; cion_client_h client; @@ -770,6 +793,7 @@ int utc_cion_client_add_payload_received_cb_p(void) */ int utc_cion_client_add_payload_received_cb_n(void) { + START_TEST; int ret; cion_client_h client = (cion_client_h)1; @@ -790,6 +814,7 @@ int utc_cion_client_add_payload_received_cb_n(void) */ int utc_cion_client_remove_payload_received_cb_p(void) { + START_TEST; int ret; cion_client_h client; @@ -817,6 +842,7 @@ int utc_cion_client_remove_payload_received_cb_p(void) */ int utc_cion_client_remove_payload_received_cb_n(void) { + START_TEST; int ret; cion_client_h client = (cion_client_h)1; @@ -842,6 +868,7 @@ static void __client_disconnected_cb(const char *service_name, */ int utc_cion_client_add_disconnected_cb_p(void) { + START_TEST; int ret; cion_client_h client; @@ -865,6 +892,7 @@ int utc_cion_client_add_disconnected_cb_p(void) */ int utc_cion_client_add_disconnected_cb_n(void) { + START_TEST; int ret; cion_client_h client = (cion_client_h)1; @@ -886,6 +914,7 @@ int utc_cion_client_add_disconnected_cb_n(void) */ int utc_cion_client_remove_disconnected_cb_p(void) { + START_TEST; int ret; cion_client_h client; @@ -912,6 +941,7 @@ int utc_cion_client_remove_disconnected_cb_p(void) */ int utc_cion_client_remove_disconnected_cb_n(void) { + START_TEST; int ret; cion_client_h client = (cion_client_h)1; diff --git a/src/utc/cion/utc-cion-common.c b/src/utc/cion/utc-cion-common.c new file mode 100755 index 000000000..763ee803a --- /dev/null +++ b/src/utc/cion/utc-cion-common.c @@ -0,0 +1,32 @@ +// +// Copyright (c) 2024 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include "utc-cion-common.h" + +/** +* @function CheckLightMemoryFeatureSupported +* @description Check the supported feature for the lite memory value +* @return true if supported else false +*/ +bool CheckLightMemoryFeatureSupported() { + bool is_supported = false; + int ret = system_info_get_custom_bool("com.samsung/featureconf/product.lite_memory.support", &is_supported); + + if (ret == SYSTEM_INFO_ERROR_NONE && is_supported) { + return true; + } + + return false; +} diff --git a/src/utc/cion/utc-cion-common.h b/src/utc/cion/utc-cion-common.h new file mode 100755 index 000000000..ae196747d --- /dev/null +++ b/src/utc/cion/utc-cion-common.h @@ -0,0 +1,39 @@ +// +// Copyright (c) 2024 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#ifndef _UTC_CION_COMMON_H_ +#define _UTC_CION_COMMON_H_ + +//Add test package related includes here +#include "tct_common.h" +#include +#include + +#define API_NAMESPACE "CION_UTC" + +#define START_TEST {\ + FPRINTF("[Line : %d][%s] Starting test : %s\\n", __LINE__, API_NAMESPACE, __FUNCTION__);\ + if(g_bCionNotSupported)\ + {\ + FPRINTF("[Line : %d][%s] Feature =%s not supported :success ", __LINE__, API_NAMESPACE, API_NAMESPACE);\ + return 0;\ + }\ +} + +bool g_bCionNotSupported; +bool CheckLightMemoryFeatureSupported(); + + +#endif //_UTC_CION_COMMON_H_ diff --git a/src/utc/cion/utc-cion-connection_result.c b/src/utc/cion/utc-cion-connection_result.c index 54e34036c..45ad47eaf 100644 --- a/src/utc/cion/utc-cion-connection_result.c +++ b/src/utc/cion/utc-cion-connection_result.c @@ -15,6 +15,7 @@ // #include "assert.h" #include "assert_common.h" +#include "utc-cion-common.h" #include #include @@ -96,6 +97,10 @@ static void __connection_result_cb(const char * service_name, void utc_cion_connection_result_startup(void) { + g_bCionNotSupported = CheckLightMemoryFeatureSupported(); + if (g_bCionNotSupported) + return; + int ret; if (connected) @@ -174,6 +179,7 @@ void utc_cion_connection_result_cleanup(void) */ int utc_cion_connection_result_get_status_p(void) { + START_TEST; int ret; assert_eq(get_status_test_result, CION_ERROR_NONE); @@ -188,6 +194,7 @@ int utc_cion_connection_result_get_status_p(void) */ int utc_cion_connection_result_get_status_n(void) { + START_TEST; int ret; cion_connection_result_h result = (cion_connection_result_h)1; cion_connection_status_e status; @@ -208,6 +215,7 @@ int utc_cion_connection_result_get_status_n(void) */ int utc_cion_connection_result_get_reason_p(void) { + START_TEST; int ret; assert_eq(get_reason_test_result, CION_ERROR_NONE); @@ -222,6 +230,7 @@ int utc_cion_connection_result_get_reason_p(void) */ int utc_cion_connection_result_get_reason_n(void) { + START_TEST; int ret; cion_connection_result_h result = (cion_connection_result_h)1; char *reason = NULL; diff --git a/src/utc/cion/utc-cion-group.c b/src/utc/cion/utc-cion-group.c index 72fa14a90..855a9ab03 100644 --- a/src/utc/cion/utc-cion-group.c +++ b/src/utc/cion/utc-cion-group.c @@ -15,6 +15,7 @@ // #include "assert.h" #include "assert_common.h" +#include "utc-cion-common.h" #include @@ -22,6 +23,7 @@ void utc_cion_group_startup(void) { + g_bCionNotSupported = CheckLightMemoryFeatureSupported(); } void utc_cion_group_cleanup(void) @@ -35,6 +37,7 @@ void utc_cion_group_cleanup(void) */ int utc_cion_group_create_p(void) { + START_TEST; int ret; cion_group_h group; @@ -53,6 +56,7 @@ int utc_cion_group_create_p(void) */ int utc_cion_group_create_n(void) { + START_TEST; int ret; cion_group_h group = NULL; @@ -75,6 +79,7 @@ int utc_cion_group_create_n(void) */ int utc_cion_group_destroy_p(void) { + START_TEST; int ret; cion_group_h group; @@ -94,6 +99,7 @@ int utc_cion_group_destroy_p(void) */ int utc_cion_group_destroy_n(void) { + START_TEST; int ret; ret = cion_group_destroy(NULL); @@ -109,6 +115,7 @@ int utc_cion_group_destroy_n(void) */ int utc_cion_group_subscribe_p(void) { + START_TEST; int ret; cion_group_h group; @@ -130,6 +137,7 @@ int utc_cion_group_subscribe_p(void) */ int utc_cion_group_subscribe_n(void) { + START_TEST; int ret; ret = cion_group_subscribe(NULL); @@ -145,6 +153,7 @@ int utc_cion_group_subscribe_n(void) */ int utc_cion_group_unsubscribe_p(void) { + START_TEST; int ret; cion_group_h group; @@ -169,6 +178,7 @@ int utc_cion_group_unsubscribe_p(void) */ int utc_cion_group_unsubscribe_n(void) { + START_TEST; int ret; cion_group_h group = (cion_group_h)1; @@ -194,6 +204,7 @@ int utc_cion_group_unsubscribe_n(void) */ int utc_cion_group_publish_p(void) { + START_TEST; int ret; cion_group_h group; cion_payload_h payload; @@ -226,6 +237,7 @@ int utc_cion_group_publish_p(void) */ int utc_cion_group_publish_n(void) { + START_TEST; int ret; cion_group_h group = (cion_group_h)1; cion_payload_h payload = (cion_payload_h)1; diff --git a/src/utc/cion/utc-cion-payload.c b/src/utc/cion/utc-cion-payload.c index e9730ff88..c55f57327 100644 --- a/src/utc/cion/utc-cion-payload.c +++ b/src/utc/cion/utc-cion-payload.c @@ -15,6 +15,7 @@ // #include "assert.h" #include "assert_common.h" +#include "utc-cion-common.h" #include #include @@ -53,6 +54,10 @@ cion_payload_h payload; void utc_cion_payload_startup(void) { + g_bCionNotSupported = CheckLightMemoryFeatureSupported(); + if (g_bCionNotSupported) + return; + int ret; ret = cion_payload_create(&payload, CION_PAYLOAD_TYPE_DATA); @@ -62,8 +67,10 @@ void utc_cion_payload_startup(void) void utc_cion_payload_cleanup(void) { - cion_payload_destroy(payload); - payload = NULL; + if (payload) { + cion_payload_destroy(payload); + payload = NULL; + } } /** @@ -73,6 +80,7 @@ void utc_cion_payload_cleanup(void) */ int utc_cion_payload_create_p(void) { + START_TEST; int ret; cion_payload_h datapayload = NULL; @@ -91,6 +99,7 @@ int utc_cion_payload_create_p(void) */ int utc_cion_payload_create_n(void) { + START_TEST; int ret; ret = cion_payload_create(NULL, CION_PAYLOAD_TYPE_DATA); @@ -106,6 +115,7 @@ int utc_cion_payload_create_n(void) */ int utc_cion_payload_destroy_p(void) { + START_TEST; int ret; cion_payload_h datapayload = NULL; @@ -125,6 +135,7 @@ int utc_cion_payload_destroy_p(void) */ int utc_cion_payload_destroy_n(void) { + START_TEST; int ret; ret = cion_payload_destroy(NULL); @@ -140,6 +151,7 @@ int utc_cion_payload_destroy_n(void) */ int utc_cion_payload_get_type_p(void) { + START_TEST; int ret; cion_payload_type_e type; @@ -156,6 +168,7 @@ int utc_cion_payload_get_type_p(void) */ int utc_cion_payload_get_type_n(void) { + START_TEST; int ret; cion_payload_type_e type; @@ -175,6 +188,7 @@ int utc_cion_payload_get_type_n(void) */ int utc_cion_payload_get_data_p(void) { + START_TEST; int ret; unsigned char data[] = "utc_cion_payload_get_data_p"; unsigned char *get_data = NULL; @@ -198,6 +212,7 @@ int utc_cion_payload_get_data_p(void) */ int utc_cion_payload_get_data_n(void) { + START_TEST; int ret; unsigned char *data; unsigned int data_size; @@ -221,6 +236,7 @@ int utc_cion_payload_get_data_n(void) */ int utc_cion_payload_set_data_p(void) { + START_TEST; int ret; unsigned char data[] = "utc_cion_payload_set_data_p"; @@ -237,6 +253,7 @@ int utc_cion_payload_set_data_p(void) */ int utc_cion_payload_set_data_n(void) { + START_TEST; int ret; unsigned char data[] = "utc_cion_payload_set_data_n"; @@ -336,6 +353,7 @@ static void __server_payload_received_cb(const char *service_name, */ int utc_cion_payload_save_as_file_p(void) { + START_TEST; int ret; cion_client_h client; cion_server_h server; @@ -403,6 +421,7 @@ int utc_cion_payload_save_as_file_p(void) */ int utc_cion_payload_save_as_file_n(void) { + START_TEST; int ret; ret = cion_payload_save_as_file(NULL, "path"); @@ -444,6 +463,7 @@ static void __server_payload_received_cb2(const char *service_name, */ int utc_cion_payload_get_received_file_name_p(void) { + START_TEST; int ret; cion_client_h client; cion_server_h server; @@ -511,6 +531,7 @@ int utc_cion_payload_get_received_file_name_p(void) */ int utc_cion_payload_get_received_file_name_n(void) { + START_TEST; int ret; char *file_name; @@ -552,6 +573,7 @@ static void __server_payload_received_cb3(const char *service_name, */ int utc_cion_payload_get_received_bytes_p(void) { + START_TEST; int ret; cion_client_h client; cion_server_h server; @@ -620,6 +642,7 @@ int utc_cion_payload_get_received_bytes_p(void) */ int utc_cion_payload_get_received_bytes_n(void) { + START_TEST; int ret; uint64_t bytes; @@ -663,6 +686,7 @@ static void __server_payload_received_cb4(const char *service_name, */ int utc_cion_payload_get_total_bytes_p(void) { + START_TEST; int ret; cion_client_h client; cion_server_h server; @@ -730,6 +754,7 @@ int utc_cion_payload_get_total_bytes_p(void) */ int utc_cion_payload_get_total_bytes_n(void) { + START_TEST; int ret; uint64_t bytes; @@ -749,6 +774,7 @@ int utc_cion_payload_get_total_bytes_n(void) */ int utc_cion_payload_set_file_path_p(void) { + START_TEST; int ret; cion_payload_h file_payload; char *res_path; @@ -775,6 +801,7 @@ int utc_cion_payload_set_file_path_p(void) */ int utc_cion_payload_set_file_path_n(void) { + START_TEST; int ret; ret = cion_payload_set_file_path(NULL, "path"); @@ -793,6 +820,7 @@ int utc_cion_payload_set_file_path_n(void) */ int utc_cion_payload_get_payload_id_p(void) { + START_TEST; int ret; char *payload_id = NULL; @@ -811,6 +839,7 @@ int utc_cion_payload_get_payload_id_p(void) */ int utc_cion_payload_get_payload_id_n(void) { + START_TEST; int ret; char *payload_id; diff --git a/src/utc/cion/utc-cion-payload_async_result.c b/src/utc/cion/utc-cion-payload_async_result.c index 060c60414..688297fad 100644 --- a/src/utc/cion/utc-cion-payload_async_result.c +++ b/src/utc/cion/utc-cion-payload_async_result.c @@ -15,6 +15,7 @@ // #include "assert.h" #include "assert_common.h" +#include "utc-cion-common.h" #include #include @@ -92,6 +93,10 @@ void utc_cion_payload_async_result_startup(void) { int ret; + g_bCionNotSupported = CheckLightMemoryFeatureSupported(); + if (g_bCionNotSupported) + return; + if (connected) return; @@ -177,6 +182,7 @@ void __payload_async_result_cb(const cion_payload_async_result_h result, */ int utc_cion_payload_async_result_clone_p(void) { + START_TEST; int ret; cion_payload_h payload; cion_payload_async_result_h result = NULL; @@ -216,6 +222,7 @@ int utc_cion_payload_async_result_clone_p(void) */ int utc_cion_payload_async_result_clone_n(void) { + START_TEST; int ret; cion_payload_async_result_h result = (cion_payload_async_result_h)1; cion_payload_async_result_h clone; @@ -236,6 +243,7 @@ int utc_cion_payload_async_result_clone_n(void) */ int utc_cion_payload_async_result_destroy_p(void) { + START_TEST; int ret; cion_payload_h payload; cion_payload_async_result_h result = NULL; @@ -276,6 +284,7 @@ int utc_cion_payload_async_result_destroy_p(void) */ int utc_cion_payload_async_result_destroy_n(void) { + START_TEST; int ret; ret = cion_payload_async_result_destroy(NULL); @@ -291,6 +300,7 @@ int utc_cion_payload_async_result_destroy_n(void) */ int utc_cion_payload_async_result_get_peer_info_p(void) { + START_TEST; int ret; cion_payload_h payload; cion_payload_async_result_h result = NULL; @@ -337,6 +347,7 @@ int utc_cion_payload_async_result_get_peer_info_p(void) */ int utc_cion_payload_async_result_get_peer_info_n(void) { + START_TEST; int ret; cion_payload_async_result_h result = (cion_payload_async_result_h)1; cion_peer_info_h peer; @@ -357,6 +368,7 @@ int utc_cion_payload_async_result_get_peer_info_n(void) */ int utc_cion_payload_async_result_get_payload_id_p(void) { + START_TEST; int ret; cion_payload_h payload; cion_payload_async_result_h result = NULL; @@ -403,6 +415,7 @@ int utc_cion_payload_async_result_get_payload_id_p(void) */ int utc_cion_payload_async_result_get_payload_id_n(void) { + START_TEST; int ret; cion_payload_async_result_h result = (cion_payload_async_result_h)1; char *payload_id = NULL; diff --git a/src/utc/cion/utc-cion-peer_info.c b/src/utc/cion/utc-cion-peer_info.c index eb1cdbbe1..aecea2f97 100644 --- a/src/utc/cion/utc-cion-peer_info.c +++ b/src/utc/cion/utc-cion-peer_info.c @@ -15,6 +15,7 @@ // #include "assert.h" #include "assert_common.h" +#include "utc-cion-common.h" #include #include @@ -73,6 +74,10 @@ static void __server_discovered_cb(const char *service_name, void utc_cion_peer_info_startup(void) { + g_bCionNotSupported = CheckLightMemoryFeatureSupported(); + if (g_bCionNotSupported) + return; + int ret; if (discovered) @@ -143,6 +148,7 @@ void utc_cion_peer_info_cleanup(void) */ int utc_cion_peer_info_clone_p(void) { + START_TEST; int ret; cion_peer_info_h clone; @@ -163,6 +169,7 @@ int utc_cion_peer_info_clone_p(void) */ int utc_cion_peer_info_clone_n(void) { + START_TEST; int ret; cion_peer_info_h clone; @@ -182,6 +189,7 @@ int utc_cion_peer_info_clone_n(void) */ int utc_cion_peer_info_destroy_p(void) { + START_TEST; int ret; if (!discovered) @@ -203,6 +211,7 @@ int utc_cion_peer_info_destroy_p(void) */ int utc_cion_peer_info_destroy_n(void) { + START_TEST; int ret; ret = cion_peer_info_destroy(NULL); @@ -218,6 +227,7 @@ int utc_cion_peer_info_destroy_n(void) */ int utc_cion_peer_info_get_device_id_p(void) { + START_TEST; int ret; char *device_id = NULL; @@ -241,6 +251,7 @@ int utc_cion_peer_info_get_device_id_p(void) */ int utc_cion_peer_info_get_device_id_n(void) { + START_TEST; int ret; char *device_id; @@ -260,6 +271,7 @@ int utc_cion_peer_info_get_device_id_n(void) */ int utc_cion_peer_info_get_device_name_p(void) { + START_TEST; int ret; char *device_name = NULL; @@ -283,6 +295,7 @@ int utc_cion_peer_info_get_device_name_p(void) */ int utc_cion_peer_info_get_device_name_n(void) { + START_TEST; int ret; char *device_name; @@ -302,6 +315,7 @@ int utc_cion_peer_info_get_device_name_n(void) */ int utc_cion_peer_info_get_device_platform_p(void) { + START_TEST; int ret; char *device_platform = NULL; @@ -325,6 +339,7 @@ int utc_cion_peer_info_get_device_platform_p(void) */ int utc_cion_peer_info_get_device_platform_n(void) { + START_TEST; int ret; char *device_platform; @@ -344,6 +359,7 @@ int utc_cion_peer_info_get_device_platform_n(void) */ int utc_cion_peer_info_get_device_platform_version_p(void) { + START_TEST; int ret; char *device_platform_version = NULL; @@ -368,6 +384,7 @@ int utc_cion_peer_info_get_device_platform_version_p(void) */ int utc_cion_peer_info_get_device_platform_version_n(void) { + START_TEST; int ret; char *device_platform_version; @@ -387,6 +404,7 @@ int utc_cion_peer_info_get_device_platform_version_n(void) */ int utc_cion_peer_info_get_device_type_p(void) { + START_TEST; int ret; char *device_type = NULL; @@ -410,6 +428,7 @@ int utc_cion_peer_info_get_device_type_p(void) */ int utc_cion_peer_info_get_device_type_n(void) { + START_TEST; int ret; char *device_type; @@ -429,6 +448,7 @@ int utc_cion_peer_info_get_device_type_n(void) */ int utc_cion_peer_info_get_app_id_p(void) { + START_TEST; int ret; char *app_id = NULL; @@ -452,6 +472,7 @@ int utc_cion_peer_info_get_app_id_p(void) */ int utc_cion_peer_info_get_app_id_n(void) { + START_TEST; int ret; char *app_id; @@ -471,6 +492,7 @@ int utc_cion_peer_info_get_app_id_n(void) */ int utc_cion_peer_info_get_app_version_p(void) { + START_TEST; int ret; char *app_version = NULL; @@ -494,6 +516,7 @@ int utc_cion_peer_info_get_app_version_p(void) */ int utc_cion_peer_info_get_app_version_n(void) { + START_TEST; int ret; char *app_version; @@ -513,6 +536,7 @@ int utc_cion_peer_info_get_app_version_n(void) */ int utc_cion_peer_info_get_uuid_p(void) { + START_TEST; int ret; char *uuid = NULL; @@ -536,6 +560,7 @@ int utc_cion_peer_info_get_uuid_p(void) */ int utc_cion_peer_info_get_uuid_n(void) { + START_TEST; int ret; char *uuid; @@ -555,6 +580,7 @@ int utc_cion_peer_info_get_uuid_n(void) */ int utc_cion_peer_info_get_display_name_p(void) { + START_TEST; int ret; char *display_name = NULL; @@ -578,6 +604,7 @@ int utc_cion_peer_info_get_display_name_p(void) */ int utc_cion_peer_info_get_display_name_n(void) { + START_TEST; int ret; char *display_name; diff --git a/src/utc/cion/utc-cion-security.c b/src/utc/cion/utc-cion-security.c index ab7e76bd9..004ce6fbc 100644 --- a/src/utc/cion/utc-cion-security.c +++ b/src/utc/cion/utc-cion-security.c @@ -15,6 +15,7 @@ // #include "assert.h" #include "assert_common.h" +#include "utc-cion-common.h" #include #include @@ -26,6 +27,7 @@ void utc_cion_security_startup(void) { + g_bCionNotSupported = CheckLightMemoryFeatureSupported(); } void utc_cion_security_cleanup(void) @@ -39,6 +41,7 @@ void utc_cion_security_cleanup(void) */ int utc_cion_security_create_p(void) { + START_TEST; int ret; cion_security_h security; @@ -57,6 +60,7 @@ int utc_cion_security_create_p(void) */ int utc_cion_security_create_n(void) { + START_TEST; int ret; ret = cion_security_create(NULL); @@ -72,6 +76,7 @@ int utc_cion_security_create_n(void) */ int utc_cion_security_destory_p(void) { + START_TEST; int ret; cion_security_h security; @@ -91,6 +96,7 @@ int utc_cion_security_destory_p(void) */ int utc_cion_security_destory_n(void) { + START_TEST; int ret; ret = cion_security_destroy(NULL); @@ -106,6 +112,7 @@ int utc_cion_security_destory_n(void) */ int utc_cion_security_set_ca_path_p(void) { + START_TEST; int ret; cion_security_h security; @@ -127,6 +134,7 @@ int utc_cion_security_set_ca_path_p(void) */ int utc_cion_security_set_ca_path_n(void) { + START_TEST; int ret; cion_security_h security = (cion_security_h)1; @@ -146,6 +154,7 @@ int utc_cion_security_set_ca_path_n(void) */ int utc_cion_security_set_cert_path_p(void) { + START_TEST; int ret; cion_security_h security; @@ -167,6 +176,7 @@ int utc_cion_security_set_cert_path_p(void) */ int utc_cion_security_set_cert_path_n(void) { + START_TEST; int ret; cion_security_h security = (cion_security_h)1; @@ -186,6 +196,7 @@ int utc_cion_security_set_cert_path_n(void) */ int utc_cion_security_set_private_key_path_p(void) { + START_TEST; int ret; cion_security_h security; @@ -207,6 +218,7 @@ int utc_cion_security_set_private_key_path_p(void) */ int utc_cion_security_set_private_key_path_n(void) { + START_TEST; int ret; cion_security_h security = (cion_security_h)1; @@ -226,6 +238,7 @@ int utc_cion_security_set_private_key_path_n(void) */ int utc_cion_security_get_ca_path_p(void) { + START_TEST; int ret; cion_security_h security; char *path; @@ -252,6 +265,7 @@ int utc_cion_security_get_ca_path_p(void) */ int utc_cion_security_get_ca_path_n(void) { + START_TEST; int ret; cion_security_h security = (cion_security_h)1; char *path; @@ -272,6 +286,7 @@ int utc_cion_security_get_ca_path_n(void) */ int utc_cion_security_get_cert_path_p(void) { + START_TEST; int ret; cion_security_h security; char *path; @@ -298,6 +313,7 @@ int utc_cion_security_get_cert_path_p(void) */ int utc_cion_security_get_cert_path_n(void) { + START_TEST; int ret; cion_security_h security = (cion_security_h)1; char *path; @@ -318,6 +334,7 @@ int utc_cion_security_get_cert_path_n(void) */ int utc_cion_security_get_private_key_path_p(void) { + START_TEST; int ret; cion_security_h security; char *path; @@ -344,6 +361,7 @@ int utc_cion_security_get_private_key_path_p(void) */ int utc_cion_security_get_private_key_path_n(void) { + START_TEST; int ret; cion_security_h security = (cion_security_h)1; char *path; diff --git a/src/utc/cion/utc-cion-server.c b/src/utc/cion/utc-cion-server.c index 9e790b440..411445271 100644 --- a/src/utc/cion/utc-cion-server.c +++ b/src/utc/cion/utc-cion-server.c @@ -15,6 +15,7 @@ // #include "assert.h" #include "assert_common.h" +#include "utc-cion-common.h" #include #include @@ -48,6 +49,7 @@ static void __stop_polling_loop(void) { void utc_cion_server_startup(void) { + g_bCionNotSupported = CheckLightMemoryFeatureSupported(); } void utc_cion_server_cleanup(void) @@ -61,6 +63,7 @@ void utc_cion_server_cleanup(void) */ int utc_cion_server_create_p(void) { + START_TEST; int ret; cion_server_h server; @@ -80,6 +83,7 @@ int utc_cion_server_create_p(void) */ int utc_cion_server_create_n(void) { + START_TEST; int ret; cion_server_h server = NULL; @@ -101,6 +105,7 @@ int utc_cion_server_create_n(void) */ int utc_cion_server_destroy_p(void) { + START_TEST; int ret; cion_server_h server; @@ -121,6 +126,7 @@ int utc_cion_server_destroy_p(void) */ int utc_cion_server_destroy_n(void) { + START_TEST; int ret; ret = cion_server_destroy(NULL); @@ -141,6 +147,7 @@ static void __server_connection_request_cb(const char *service_name, */ int utc_cion_server_listen_p(void) { + START_TEST; int ret; cion_server_h server; @@ -162,6 +169,7 @@ int utc_cion_server_listen_p(void) */ int utc_cion_server_listen_n(void) { + START_TEST; int ret; cion_server_h server = (cion_server_h)1; @@ -181,6 +189,7 @@ int utc_cion_server_listen_n(void) */ int utc_cion_server_stop_p(void) { + START_TEST; int ret; cion_server_h server; @@ -206,6 +215,7 @@ int utc_cion_server_stop_p(void) */ int utc_cion_server_stop_n(void) { + START_TEST; int ret; cion_server_h server = (cion_server_h)1; @@ -286,6 +296,7 @@ static void __client_server_discovered_cb(const char *service_name, */ int utc_cion_server_disconnect_p(void) { + START_TEST; int ret; cion_client_h client; cion_server_h server; @@ -333,6 +344,7 @@ int utc_cion_server_disconnect_p(void) */ int utc_cion_server_disconnect_n(void) { + START_TEST; int ret; cion_server_h server = (cion_server_h)1; cion_peer_info_h peer = (cion_peer_info_h)1; @@ -353,6 +365,7 @@ int utc_cion_server_disconnect_n(void) */ int utc_cion_server_send_payload_async_p(void) { + START_TEST; int ret; cion_server_h server; cion_client_h client; @@ -414,6 +427,7 @@ static void __server_payload_async_result_cb( */ int utc_cion_server_send_payload_async_n(void) { + START_TEST; int ret; cion_server_h server = (cion_server_h)1; cion_peer_info_h peer = (cion_peer_info_h)1; @@ -443,6 +457,7 @@ static bool __server_connected_peer_info_cb(const cion_peer_info_h peer_info, */ int utc_cion_server_foreach_connected_peer_info_p(void) { + START_TEST; int ret; cion_server_h server; @@ -467,6 +482,7 @@ int utc_cion_server_foreach_connected_peer_info_p(void) */ int utc_cion_server_foreach_connected_peer_info_n(void) { + START_TEST; int ret; cion_server_h server = (cion_server_h)1; @@ -487,6 +503,7 @@ int utc_cion_server_foreach_connected_peer_info_n(void) */ int utc_cion_server_add_connection_result_cb_p(void) { + START_TEST; int ret; cion_server_h server; @@ -511,6 +528,7 @@ int utc_cion_server_add_connection_result_cb_p(void) */ int utc_cion_server_add_connection_result_cb_n(void) { + START_TEST; int ret; cion_server_h server = (cion_server_h)1; @@ -531,6 +549,7 @@ int utc_cion_server_add_connection_result_cb_n(void) */ int utc_cion_server_remove_connection_result_cb_p(void) { + START_TEST; int ret; cion_server_h server; @@ -559,6 +578,7 @@ int utc_cion_server_remove_connection_result_cb_p(void) */ int utc_cion_server_remove_connection_result_cb_n(void) { + START_TEST; int ret; cion_server_h server = (cion_server_h)1; @@ -586,6 +606,7 @@ static void __server_payload_received_cb(const char *service_name, */ int utc_cion_server_add_payload_received_cb_p(void) { + START_TEST; int ret; cion_server_h server; @@ -610,6 +631,7 @@ int utc_cion_server_add_payload_received_cb_p(void) */ int utc_cion_server_add_payload_received_cb_n(void) { + START_TEST; int ret; cion_server_h server = (cion_server_h)1; @@ -630,6 +652,7 @@ int utc_cion_server_add_payload_received_cb_n(void) */ int utc_cion_server_remove_payload_received_cb_p(void) { + START_TEST; int ret; cion_server_h server; @@ -658,6 +681,7 @@ int utc_cion_server_remove_payload_received_cb_p(void) */ int utc_cion_server_remove_payload_received_cb_n(void) { + START_TEST; int ret; cion_server_h server = (cion_server_h)1; @@ -686,6 +710,7 @@ static void __server_data_received_cb(const char *service_name, */ int utc_cion_server_set_data_received_cb_p(void) { + START_TEST; int ret; cion_server_h server; @@ -710,6 +735,7 @@ int utc_cion_server_set_data_received_cb_p(void) */ int utc_cion_server_set_data_received_cb_n(void) { + START_TEST; int ret; cion_server_h server = (cion_server_h)1; @@ -729,6 +755,7 @@ int utc_cion_server_set_data_received_cb_n(void) */ int utc_cion_server_unset_data_received_cb_p(void) { + START_TEST; int ret; cion_server_h server; @@ -756,6 +783,7 @@ int utc_cion_server_unset_data_received_cb_p(void) */ int utc_cion_server_unset_data_received_cb_n(void) { + START_TEST; int ret; ret = cion_server_unset_data_received_cb(NULL); @@ -776,6 +804,7 @@ static void __server_disconnected_cb(const char *service_name, */ int utc_cion_server_add_disconnected_cb_p(void) { + START_TEST; int ret; cion_server_h server; @@ -800,6 +829,7 @@ int utc_cion_server_add_disconnected_cb_p(void) */ int utc_cion_server_add_disconnected_cb_n(void) { + START_TEST; int ret; cion_server_h server = (cion_server_h)1; @@ -820,6 +850,7 @@ int utc_cion_server_add_disconnected_cb_n(void) */ int utc_cion_server_remove_disconnected_cb_p(void) { + START_TEST; int ret; cion_server_h server; @@ -848,6 +879,7 @@ int utc_cion_server_remove_disconnected_cb_p(void) */ int utc_cion_server_remove_disconnected_cb_n(void) { + START_TEST; int ret; cion_server_h server = (cion_server_h)1; @@ -896,6 +928,7 @@ static void __server_connection_request_cb3(const char *service_name, */ int utc_cion_server_accept_p(void) { + START_TEST; int ret; cion_server_h server; cion_client_h client; @@ -949,6 +982,7 @@ int utc_cion_server_accept_p(void) */ int utc_cion_server_accept_n(void) { + START_TEST; int ret; cion_server_h server = (cion_server_h)1; cion_peer_info_h peer = (cion_peer_info_h)1; @@ -997,6 +1031,7 @@ static void __server_connection_request_cb4(const char *service_name, */ int utc_cion_server_reject_p(void) { + START_TEST; int ret; cion_server_h server; cion_client_h client; @@ -1050,6 +1085,7 @@ int utc_cion_server_reject_p(void) */ int utc_cion_server_reject_n(void) { + START_TEST; int ret; cion_server_h server = (cion_server_h)1; cion_peer_info_h peer = (cion_peer_info_h)1; @@ -1070,6 +1106,7 @@ int utc_cion_server_reject_n(void) */ int utc_cion_server_set_display_name_p(void) { + START_TEST; int ret; cion_server_h server; @@ -1093,6 +1130,7 @@ int utc_cion_server_set_display_name_p(void) */ int utc_cion_server_set_display_name_n(void) { + START_TEST; int ret; ret = cion_server_set_display_name(NULL, @@ -1109,6 +1147,7 @@ int utc_cion_server_set_display_name_n(void) */ int utc_cion_server_set_on_demand_launch_enabled_p(void) { + START_TEST; int ret; cion_server_h server; @@ -1132,6 +1171,7 @@ int utc_cion_server_set_on_demand_launch_enabled_p(void) */ int utc_cion_server_set_on_demand_launch_enabled_n(void) { + START_TEST; int ret; ret = cion_server_set_on_demand_launch_enabled(NULL, true);