cp packaging/itc/%{name}.xml %{buildroot}/usr/share/packages/
mkdir -p %{buildroot}%{APP_PATH}%{name}/bin
#cp templates/external_wrapper.sh %{buildroot}%{APP_PATH}%{name}/bin
+mkdir -p %{buildroot}/usr/apps/%{name}/data
+cp src/itc/%{MODULE_NAME}/res/common/* %{buildroot}/usr/apps/%{name}/data/
%post
%postun
int icitc_send_ok_response(iotcon_request_h request)
{
-
+
int ret;
iotcon_response_h response = NULL;
iotcon_options_h options = NULL;
//nRet = iotcon_attributes_add_int(state, "brightness", ++g_nBrightness);
nRet = iotcon_attributes_add_bool(state, "opened", true);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_int", IotConGetError(nRet),iotcon_attributes_destroy(state);iotcon_resource_types_destroy(light_types));
-
+
/* register door resource */
//nRet = iotcon_lite_resource_create("/a/light", light_types,
//(IOTCON_INTERFACE_DEFAULT | IOTCON_INTERFACE_BATCH), state, Iotcon_door_attributes_changed_cb_p, NULL, &g_hLiteLightResource);
-
+
//iotcon_resource_interfaces_h ifaces;
-
+
//nRet = iotcon_resource_interfaces_add(ifaces, IOTCON_INTERFACE_BATCH);
//PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_resource_interfaces_add", IotConGetError(nRet),iotcon_attributes_destroy(state);iotcon_resource_types_destroy(light_types));
-
+
//nRet = iotcon_lite_resource_create("/a/light", light_types,1, state, Iotcon_door_attributes_changed_cb_p, NULL, &g_hLiteLightResource);
//SHILPA
nRet = iotcon_lite_resource_create("/a/light", light_types,1, state, NULL, NULL, &g_hLiteLightResource);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_lite_resource_create", IotConGetError(nRet),iotcon_attributes_destroy(state);iotcon_resource_types_destroy(light_types));
-
+
if(g_hLiteLightResource==NULL)
{
FPRINTF("[Line : %d][%s] iotcon_lite_resource_create fail g_hLiteLightResource is NULL error returned : \\n", __LINE__, API_NAMESPACE);
iotcon_resource_types_destroy(light_types);
return 1;
}
-
+
iotcon_attributes_destroy(state);
iotcon_resource_types_destroy(light_types);
return 0;
}
+
+int ic_get_svr_db_path(char **path)
+{
+ char file_path[PATH_MAX] = {0};
+ char pszValue[CONFIG_VALUE_LEN_MAX] = {0,};
+ const char *svr_db_file = "svr_db.dat";
+
+ if (false == GetValueForTCTSetting("DEVICE_USER_30", pszValue, API_NAMESPACE)) {
+ PRINT_UTC_LOG("[Line : %d][%s] GetValueForTCTSetting returned error for 'DEVICE_SUITE_TARGET_30'\\n", __LINE__, API_NAMESPACE);
+ return -1;
+ }
+
+ PRINT_UTC_LOG("[Line : %d][%s] 'DEVICE_USER_30' Values Received = %s\\n",
+ __LINE__, API_NAMESPACE, pszValue);
+
+ snprintf(file_path, sizeof(file_path), "%s/apps_rw/native-iotcon-itc/data/%s", pszValue,
+ svr_db_file);
+
+ *path = strdup(file_path);
+
+ return 0;
+}
+
+
/** @} */
#define TIMEOUT_CB 5000
#define API_NAMESPACE "IOTCON_SERVICE_ITC"
#define ICL_OPTIONID_MIN 2048
-#define GMAINTIMEOUT 30000
+#define GMAINTIMEOUT 30000
#define REPRESENTATION_KEY "key"
#define REP_NTH_CHILD 1
#define IOTCON_TIMEOUT 10
#define REMOTE_IP "11.22.33.44"
#define REMOTE_RESOURCE_LED "/a/led"
#define REMOTE_RESOURCE_LIGHT "/a/light"
-#define VAL1 0
+#define VAL1 0
#define VAL2 1
#define VAL3 2
#define VAL4 3
return 1;\
}\
}
-
+
#define RUN_POLLING_LOOP {\
g_pMainLoop = g_main_loop_new(NULL, false);\
nIotconTimeoutId = g_timeout_add(TIMEOUT_CB, TimeoutFunction, g_pMainLoop);\
gboolean IotConsCallbackTimeout(gpointer data);
void IotconDestroyLiteResource(void);
int IotconCreateLiteResource(void);
+int ic_get_svr_db_path(char **path);
+
/** @} */
#endif //_ITS_IOTCON_COMMON_H_
{
FPRINTF("[Line : %d][%s] Callback invoked ,info is NULL \\n", __LINE__, API_NAMESPACE);
}
-
+
#if DEBUG
FPRINTF("[Line : %d][%s] IotconGetDeviceInfoCB callback called\\n", __LINE__, API_NAMESPACE);
#endif
#if DEBUG
FPRINTF("[Line : %d][%s] IotconGetPlatformInfoCB callback called\\n", __LINE__, API_NAMESPACE);
#endif
-
+
g_bCheckCb = true;
if ( g_pMainLoop )
{
g_bCheckCb = true;
char *pszValue = NULL;
-
+
int nGetPropertyOption[] = {
IOTCON_DEVICE_INFO_NAME ,
IOTCON_DEVICE_INFO_SPEC_VER,
PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_device_info_get_property", IotConGetError(nRet));
FPRINTF(" property = [EnumVal : %d][ Value : %s] \\n", nEnumStartCount, pszValue);
}
-
+
if ( g_pMainLoop )
{
g_main_loop_quit(g_pMainLoop);
* @parameter NA
* @return NA
*/
-
+
void ITs_iotcon_device_startup(void)
{
struct stat stBuff;
+ char *svr_db_path;
+
if ( stat(ERR_LOG, &stBuff) == 0 )
{
remove(ERR_LOG);
}
g_bIotconConnect = true;
g_bFeatureUnsupported = false;
- int nRet = iotcon_initialize();
-
+
+ ic_get_svr_db_path(&svr_db_path);
+ int nRet = iotcon_initialize(svr_db_path);
+ free(svr_db_path);
if ( !TCTCheckSystemInfoFeatureSupported(IOTCON_FEATURE, API_NAMESPACE) )
{
-
+
if ( nRet != TIZEN_ERROR_NOT_SUPPORTED )
{
FPRINTF("[Line : %d][%s] iotcon_initialize API call returned mismatch %s error for unsupported feature\\n", __LINE__, API_NAMESPACE, IotConGetError(nRet));
}
return;
}
-
+
if ( nRet != IOTCON_ERROR_NONE )
{
FPRINTF("[Line : %d][%s] iotcon_initialize failed API return %s error \\n", __LINE__, API_NAMESPACE, IotConGetError(nRet));
g_bIotconConnect = false;
return;
}
-
+
return;
}
START_TEST;
int nIotconTimeoutId = 0;
g_bCheckCb = false;
-
+
int nRet = iotcon_find_device_info(IOTCON_MULTICAST_ADDRESS, IOTCON_CONNECTIVITY_IPV4,IotconGetDeviceInfoCB, NULL);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_find_device_info", IotConGetError(nRet));
-
+
RUN_POLLING_LOOP;
-
+
if(g_bCheckCb != true)
{
FPRINTF("[Line : %d][%s] callback not invoked : \\n", __LINE__, API_NAMESPACE );
return 1;
}
-
+
return 0;
}
START_TEST;
int nIotconTimeoutId = 0;
g_bCheckCb = false;
-
+
int nRet = iotcon_find_device_info(IOTCON_MULTICAST_ADDRESS, IOTCON_CONNECTIVITY_IPV4, IotconDeviceInfoGetPropertyCB, NULL);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_find_device_info", IotConGetError(nRet));
-
+
RUN_POLLING_LOOP;
-
+
if(g_bCheckCb != true)
{
FPRINTF("[Line : %d][%s] callback not invoked : \\n", __LINE__, API_NAMESPACE );
return 1;
}
-
+
return 0;
}
START_TEST;
int nIotconTimeoutId = 0;
g_bCheckCb = false;
-
+
int nRet = iotcon_find_platform_info(IOTCON_MULTICAST_ADDRESS, IOTCON_CONNECTIVITY_IPV4,IotconGetPlatformInfoCB, NULL);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_find_platform_info", IotConGetError(nRet));
-
+
RUN_POLLING_LOOP;
-
+
if(g_bCheckCb != true)
{
FPRINTF("[Line : %d][%s] callback not invoked : \\n", __LINE__, API_NAMESPACE );
return 1;
}
-
+
return 0;
}
START_TEST;
int nIotconTimeoutId = 0;
g_bCheckCb = false;
-
+
int nRet = iotcon_find_platform_info(IOTCON_MULTICAST_ADDRESS, IOTCON_CONNECTIVITY_IPV4, IotconPlatformInfoGetPropertyCB, NULL);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_find_platform_info", IotConGetError(nRet));
-
+
RUN_POLLING_LOOP;
-
+
if(g_bCheckCb == false)
{
FPRINTF("[Line : %d][%s] callback not invoked : \\n", __LINE__, API_NAMESPACE );
return 1;
}
-
+
return 0;
}
++ (*((int *)user_data));
g_bCheckCb = true;
-
+
return IOTCON_FUNC_CONTINUE;
-
+
}
/**
FPRINTF("[Line : %d][%s] Inside IotconListBoolCB callback\\n", __LINE__, API_NAMESPACE);
if (user_data)
++ (*((int *)user_data));
-
+
g_bCheckCb = true;
-
+
return IOTCON_FUNC_CONTINUE;
}
FPRINTF("[Line : %d][%s] Inside IotconListDoubleCB callback\\n", __LINE__, API_NAMESPACE);
if (user_data)
++ (*((int *)user_data));
-
+
g_bCheckCb = true;
return IOTCON_FUNC_CONTINUE;
}
FPRINTF("[Line : %d][%s] Inside IotconListStrCB callback\\n", __LINE__, API_NAMESPACE);
if (user_data)
++ (*((int *)user_data));
-
+
if(value == NULL)
{
FPRINTF("[Line : %d][%s] IotconListStrCB callback value is NULL\\n", __LINE__, API_NAMESPACE);
return IOTCON_FUNC_CONTINUE;
}
-
+
g_bCheckCb = true;
-
+
return IOTCON_FUNC_CONTINUE;
}
FPRINTF("[Line : %d][%s] Inside IotconListListCB callback\\n", __LINE__, API_NAMESPACE);
if (user_data)
++ (*((int *)user_data));
-
+
if(value == NULL)
{
FPRINTF("[Line : %d][%s] Inside IotconListListCB callback , value is NULL\\n", __LINE__, API_NAMESPACE);
return IOTCON_FUNC_CONTINUE;
}
-
+
g_bCheckCb = true;
return IOTCON_FUNC_CONTINUE;
FPRINTF("[Line : %d][%s] Inside IotconListStateCB callback\\n", __LINE__, API_NAMESPACE);
if (user_data)
++ (*((int *)user_data));
-
+
if(value == NULL)
{
FPRINTF("[Line : %d][%s] IotconListStateCB callback fails as value is NULL \\n", __LINE__, API_NAMESPACE);
return IOTCON_FUNC_CONTINUE;
}
-
+
g_bCheckCb = true;
return IOTCON_FUNC_CONTINUE;
FPRINTF("[Line : %d][%s] Inside IotconListByteStrCB callback\\n", __LINE__, API_NAMESPACE);
if (user_data)
++ (*((int *)user_data));
-
+
if(value == NULL)
{
FPRINTF("[Line : %d][%s] IotconListByteStrCB callback fails as value is NULL \\n", __LINE__, API_NAMESPACE);
}
g_bCheckCb = true;
-
+
return IOTCON_FUNC_CONTINUE;
}
/**
void ITs_iotcon_list_startup(void)
{
struct stat stBuff;
+ char *svr_db_path;
if ( stat(ERR_LOG, &stBuff) == 0 )
{
remove(ERR_LOG);
}
g_bIotconConnect = true;
g_bFeatureUnsupported = false;
- int nRet = iotcon_initialize();
-
+
+ ic_get_svr_db_path(&svr_db_path);
+ int nRet = iotcon_initialize(svr_db_path);
+ free(svr_db_path);
if ( !TCTCheckSystemInfoFeatureSupported(IOTCON_FEATURE, API_NAMESPACE) )
{
-
+
if ( nRet != TIZEN_ERROR_NOT_SUPPORTED )
{
FPRINTF("[Line : %d][%s] iotcon_initialize API call returned mismatch %s error for unsupported feature\\n", __LINE__, API_NAMESPACE, IotConGetError(nRet));
}
return;
}
-
+
if ( nRet != IOTCON_ERROR_NONE )
{
FPRINTF("[Line : %d][%s] iotcon_initialize failed API return %s error \\n", __LINE__, API_NAMESPACE, IotConGetError(nRet));
g_bIotconConnect = false;
return;
}
-
+
nRet = iotcon_attributes_create(&g_hAttributes);
- if ( nRet != IOTCON_ERROR_NONE)
+ if ( nRet != IOTCON_ERROR_NONE)
{
FPRINTF("[Line : %d][%s] iotcon_attributes_create fail in startup \\n", __LINE__, API_NAMESPACE);
iotcon_deinitialize();
FPRINTF("[Line : %d][%s] g_hAttributes is NULL\\n", __LINE__, API_NAMESPACE);
return;
}
-
+
nRet = iotcon_representation_create(&g_hRepr);
- if ( nRet != IOTCON_ERROR_NONE)
+ if ( nRet != IOTCON_ERROR_NONE)
{
FPRINTF("[Line : %d][%s] iotcon_representation_create fail in startup \\n", __LINE__, API_NAMESPACE);
iotcon_attributes_destroy(g_hAttributes);
*/
void ITs_iotcon_list_cleanup(void)
{
-
+
#if DEBUG
FPRINTF("[Line : %d][%s] TEST SUIT clean-up: ITs_Iotcon_List_p\\n", __LINE__, API_NAMESPACE);
#endif
if(g_hRepr)
iotcon_representation_destroy(g_hRepr);
-
- if (g_hAttributes)
+
+ if (g_hAttributes)
iotcon_attributes_destroy(g_hAttributes);
-
+
if (g_bIotconConnect)
iotcon_deinitialize();
}
int ITc_iotcon_list_create_destroy_p(void)
{
START_TEST;
-
+
int nRet = 0;
iotcon_list_h hList = NULL;
- iotcon_type_e eSetIconType [] = { IOTCON_TYPE_INT, IOTCON_TYPE_BOOL,
+ iotcon_type_e eSetIconType [] = { IOTCON_TYPE_INT, IOTCON_TYPE_BOOL,
IOTCON_TYPE_DOUBLE, IOTCON_TYPE_STR, IOTCON_TYPE_NULL, IOTCON_TYPE_LIST, IOTCON_TYPE_ATTRIBUTES};
int nEnumSize = sizeof(eSetIconType) / sizeof(eSetIconType[0]);
nRet = iotcon_list_create(eSetIconType[nEnumCounter],&hList);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet));
CHECK_HANDLE(hList,"iotcon_list_create");
-
+
if(hList)
{
iotcon_list_destroy(hList);
- hList = NULL;
+ hList = NULL;
}
}
-
+
return 0;
}
int ITc_iotcon_list_add_get_nth_int_p(void)
{
START_TEST;
-
+
iotcon_list_h hList = NULL;
int nVal;
-
+
int nRet = iotcon_list_create(IOTCON_TYPE_INT,&hList);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet));
CHECK_HANDLE(hList,"iotcon_list_create");
nRet = iotcon_list_add_int(hList, ASSIGNVAL1, VAL1);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_int", IotConGetError(nRet), iotcon_list_destroy(hList));
-
+
nRet =iotcon_list_add_int(hList, ASSIGNVAL2, VAL2);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_int", IotConGetError(nRet), iotcon_list_destroy(hList));
nRet =iotcon_list_add_int(hList, ASSIGNVAL3, VAL3);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_int", IotConGetError(nRet), iotcon_list_destroy(hList));
-
+
nRet = iotcon_list_get_nth_int(hList, VAL1, &nVal);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_get_nth_int", IotConGetError(nRet), iotcon_list_destroy(hList));
if(ASSIGNVAL1 != nVal)
iotcon_list_destroy(hList);
return 1;
}
-
+
if(hList)
{
iotcon_list_destroy(hList);
- hList = NULL;
+ hList = NULL;
}
-
+
return 0;
}
int ITc_iotcon_list_add_get_nth_bool_p(void)
{
START_TEST;
-
+
bool bVal;
iotcon_list_h hList = NULL;
bool bTrue = true;
bool bFalse = false;
-
+
int nRet = iotcon_list_create(IOTCON_TYPE_BOOL,&hList);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet));
CHECK_HANDLE(hList,"iotcon_list_create");
nRet = iotcon_list_add_bool(hList, bTrue, VAL1);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_bool", IotConGetError(nRet), iotcon_list_destroy(hList));
-
+
nRet =iotcon_list_add_bool(hList, bFalse, VAL2);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_bool", IotConGetError(nRet), iotcon_list_destroy(hList));;
iotcon_list_destroy(hList);
return 1;
}
-
+
if(hList)
{
iotcon_list_destroy(hList);
- hList = NULL;
+ hList = NULL;
}
-
+
return 0;
}
int ITc_iotcon_list_add_get_nth_double_p(void)
{
START_TEST;
-
+
double nGetVal = 0.0;
iotcon_list_h hList = NULL;
double nVal1 = 1.0 ,nVal2 = 2.0, nVal3 = 3.0;
-
+
int nRet = iotcon_list_create(IOTCON_TYPE_DOUBLE,&hList);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet));
CHECK_HANDLE(hList,"iotcon_list_create");
nRet = iotcon_list_add_double(hList, nVal1, VAL1);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_double", IotConGetError(nRet), iotcon_list_destroy(hList));
-
+
nRet =iotcon_list_add_double(hList, nVal2, VAL2);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_double", IotConGetError(nRet), iotcon_list_destroy(hList));
-
+
nRet =iotcon_list_add_double(hList, nVal3, VAL3);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_double", IotConGetError(nRet), iotcon_list_destroy(hList));
-
+
nRet = iotcon_list_get_nth_double(hList, VAL1, &nGetVal);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_get_nth_double", IotConGetError(nRet), iotcon_list_destroy(hList));
if(nVal1 != nGetVal)
iotcon_list_destroy(hList);
return 1;
}
-
+
if(hList)
{
iotcon_list_destroy(hList);
- hList = NULL;
+ hList = NULL;
}
-
+
return 0;
}
int ITc_iotcon_list_add_get_nth_str_p(void)
{
START_TEST;
-
+
char *pszGetVal;
iotcon_list_h hList = NULL;
char *pszSetVal1 = "first";
char *pszSetVal2 = "second";
-
+
int nRet = iotcon_list_create(IOTCON_TYPE_STR,&hList);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet));
CHECK_HANDLE(hList,"iotcon_list_create");
nRet = iotcon_list_add_str(hList, pszSetVal1, VAL1);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_str", IotConGetError(nRet), iotcon_list_destroy(hList));
-
+
nRet =iotcon_list_add_str(hList, pszSetVal2, VAL2);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_str", IotConGetError(nRet), iotcon_list_destroy(hList));
-
+
nRet =iotcon_list_add_str(hList, pszSetVal1, VAL3);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_str", IotConGetError(nRet), iotcon_list_destroy(hList));
-
+
nRet = iotcon_list_get_nth_str(hList, VAL1, &pszGetVal);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_get_nth_str", IotConGetError(nRet), iotcon_list_destroy(hList));
if ( strcmp(pszGetVal,pszSetVal1) != 0 )
iotcon_list_destroy(hList);
return 1;
}
-
+
if(hList)
{
iotcon_list_destroy(hList);
- hList = NULL;
+ hList = NULL;
}
-
+
return 0;
}
int ITc_iotcon_list_add_get_nth_list_p(void)
{
START_TEST;
-
+
iotcon_list_h hList1 = NULL;
iotcon_list_h hList2 = NULL;
iotcon_list_h hList3 = NULL;
-
+
int nRet = iotcon_list_create(IOTCON_TYPE_LIST,&hList1);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet));
CHECK_HANDLE(hList1,"iotcon_list_create");
-
+
nRet = iotcon_list_create(IOTCON_TYPE_INT,&hList2);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet),iotcon_list_destroy(hList1));
CHECK_HANDLE(hList2,"iotcon_list_create");
-
+
nRet =iotcon_list_add_list(hList1, hList2, VAL1);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_list", IotConGetError(nRet),iotcon_list_destroy(hList2); iotcon_list_destroy(hList1));
-
+
nRet = iotcon_list_get_nth_list(hList1, VAL1, &hList3);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_get_nth_list", IotConGetError(nRet),iotcon_list_destroy(hList2); iotcon_list_destroy(hList1));
-
+
if( hList3 == NULL)
{
FPRINTF("[Line : %d][%s] iotcon_list_get_nth_list failed, error returned = Invalid output parameter\\n", __LINE__, API_NAMESPACE);
iotcon_list_destroy(hList1);
iotcon_list_destroy(hList2);
- hList1 = NULL;
- hList2 = NULL;
+ hList1 = NULL;
+ hList2 = NULL;
return 1;
}
-
+
if(hList1)
{
iotcon_list_destroy(hList1);
- hList1 = NULL;
+ hList1 = NULL;
}
if(hList2)
{
iotcon_list_destroy(hList2);
- hList2 = NULL;
+ hList2 = NULL;
}
if(hList3)
{
iotcon_list_destroy(hList3);
- hList3 = NULL;
+ hList3 = NULL;
}
-
+
return 0;
}
int ITc_iotcon_list_add_get_nth_attributes_p(void)
{
START_TEST;
-
+
iotcon_attributes_h hState = NULL;
iotcon_list_h hList = NULL;
nRet = iotcon_list_add_attributes(hList, hState, VAL1);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_attributes", IotConGetError(nRet),iotcon_list_destroy(hList); iotcon_attributes_destroy(hState));
-
+
nRet = iotcon_list_get_nth_attributes(hList, VAL1, &hState);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_get_nth_attributes", IotConGetError(nRet),iotcon_list_destroy(hList); iotcon_attributes_destroy(hState));
-
+
if( hState == NULL )
{
FPRINTF("[Line : %d][%s] iotcon_list_get_nth_attributes failed, error returned = Invalid output parameter\\n", __LINE__, API_NAMESPACE);
iotcon_list_destroy(hList);
return 1;
}
-
+
iotcon_attributes_destroy(hState);
hState = NULL;
-
+
if(hList)
{
iotcon_list_destroy(hList);
- hList = NULL;
+ hList = NULL;
}
-
+
return 0;
}
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet));
CHECK_HANDLE(hList,"iotcon_list_create");
- for (i = 0; i < nTotal; i++)
+ for (i = 0; i < nTotal; i++)
{
nRet = iotcon_list_add_int(hList, i, -1);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_attributes", IotConGetError(nRet),iotcon_list_destroy(hList));
if(hList)
{
iotcon_list_destroy(hList);
- hList = NULL;
+ hList = NULL;
}
return 0;
int ITc_iotcon_list_get_type_p(void)
{
START_TEST;
-
+
iotcon_type_e eType;
iotcon_list_h hList = NULL;
-
+
int nRet = iotcon_list_create(IOTCON_TYPE_INT,&hList);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet));
CHECK_HANDLE(hList,"iotcon_list_create");
nRet = iotcon_list_get_type(hList, &eType);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_get_type", IotConGetError(nRet),iotcon_list_destroy(hList));
PRINT_RESULT_CLEANUP(IOTCON_TYPE_INT, eType, "iotcon_list_get_type", IotConGetError(nRet),iotcon_list_destroy(hList));
-
+
if(hList)
{
iotcon_list_destroy(hList);
- hList = NULL;
+ hList = NULL;
}
return 0;
int ITc_iotcon_list_get_length_p(void)
{
START_TEST;
-
+
unsigned int nLength;
iotcon_list_h hList = NULL;
-
+
int nRet = iotcon_list_create(IOTCON_TYPE_INT,&hList);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet));
CHECK_HANDLE(hList,"iotcon_list_create");
nRet =iotcon_list_add_int(hList, ASSIGNVAL1, VAL1);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_int", IotConGetError(nRet),iotcon_list_destroy(hList));
-
+
nRet =iotcon_list_add_int(hList, ASSIGNVAL1, VAL2);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_int", IotConGetError(nRet),iotcon_list_destroy(hList));
-
+
nRet =iotcon_list_add_int(hList, ASSIGNVAL1, VAL3);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_int", IotConGetError(nRet),iotcon_list_destroy(hList));
iotcon_list_destroy(hList);
return 1;
}
-
+
if(hList)
{
iotcon_list_destroy(hList);
- hList = NULL;
+ hList = NULL;
}
return 0;
int ITc_iotcon_list_foreach_int_p(void)
{
START_TEST;
-
+
int nCount = 0;
g_bCheckCb = false;
-
+
iotcon_list_h hList = NULL;
-
+
int nRet = iotcon_list_create(IOTCON_TYPE_INT,&hList);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet));
CHECK_HANDLE(hList,"iotcon_list_create");
nRet = iotcon_list_foreach_int(hList, IotconListIntCB, &nCount);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_foreach_int", IotConGetError(nRet),iotcon_list_destroy(hList));
-
+
if(g_bCheckCb == false)
{
FPRINTF("[Line : %d][%s] callback not invoked : \\n", __LINE__, API_NAMESPACE );
iotcon_list_destroy(hList);
return 1;
}
-
+
if(3 != nCount)
{
FPRINTF("[Line : %d][%s] value mismatch : \\n", __LINE__, API_NAMESPACE );
iotcon_list_destroy(hList);
return 1;
}
-
+
if(hList)
{
iotcon_list_destroy(hList);
- hList = NULL;
+ hList = NULL;
}
-
+
return 0;
}
int ITc_iotcon_list_foreach_bool_p(void)
{
START_TEST;
-
+
int nCount = 0;
g_bCheckCb = false;
iotcon_list_h hList = NULL;
bool bFalse = false;
bool bTrue = true;
-
+
int nRet = iotcon_list_create(IOTCON_TYPE_BOOL,&hList);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet));
CHECK_HANDLE(hList,"iotcon_list_create");
nRet = iotcon_list_add_bool(hList, bTrue, VAL1);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_bool", IotConGetError(nRet),iotcon_list_destroy(hList));
-
+
nRet =iotcon_list_add_bool(hList, bFalse, VAL2);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_bool", IotConGetError(nRet),iotcon_list_destroy(hList));
nRet = iotcon_list_foreach_bool(hList, IotconListBoolCB, &nCount);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_foreach_bool", IotConGetError(nRet),iotcon_list_destroy(hList));
-
+
if(g_bCheckCb == false)
{
FPRINTF("[Line : %d][%s] callback not invoked : \\n", __LINE__, API_NAMESPACE );
iotcon_list_destroy(hList);
return 1;
}
-
+
if(3 != nCount)
{
FPRINTF("[Line : %d][%s] value mismatch : \\n", __LINE__, API_NAMESPACE );
iotcon_list_destroy(hList);
return 1;
}
-
+
if(hList)
{
iotcon_list_destroy(hList);
- hList = NULL;
+ hList = NULL;
}
-
+
return 0;
}
int ITc_iotcon_list_foreach_double_p(void)
{
START_TEST;
-
+
int nCount = 0;
g_bCheckCb = false;
-
+
iotcon_list_h hList = NULL;
double nVal = 3.0;
-
+
int nRet = iotcon_list_create(IOTCON_TYPE_DOUBLE,&hList);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet));
CHECK_HANDLE(hList,"iotcon_list_create");
nRet = iotcon_list_add_double(hList, nVal, VAL1);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_double", IotConGetError(nRet),iotcon_list_destroy(hList));
-
+
nRet =iotcon_list_add_double(hList, nVal, VAL2);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_double", IotConGetError(nRet),iotcon_list_destroy(hList));
nRet =iotcon_list_add_double(hList, nVal, VAL3);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_double", IotConGetError(nRet),iotcon_list_destroy(hList));
-
+
nRet = iotcon_list_foreach_double(hList, IotconListDoubleCB, &nCount);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_foreach_double", IotConGetError(nRet),iotcon_list_destroy(hList));
-
+
if(g_bCheckCb == false)
{
FPRINTF("[Line : %d][%s] callback not invoked : \\n", __LINE__, API_NAMESPACE );
iotcon_list_destroy(hList);
return 1;
}
-
+
if(3 != nCount)
{
FPRINTF("[Line : %d][%s] value mismatch : \\n", __LINE__, API_NAMESPACE );
iotcon_list_destroy(hList);
return 1;
}
-
+
if(hList)
{
iotcon_list_destroy(hList);
- hList = NULL;
+ hList = NULL;
}
return 0;
int ITc_iotcon_list_foreach_str_p(void)
{
START_TEST;
-
+
int nCount = 0;
g_bCheckCb = false;
-
+
iotcon_list_h hList = NULL;
-
+
int nRet = iotcon_list_create(IOTCON_TYPE_STR,&hList);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet));
CHECK_HANDLE(hList,"iotcon_list_create");
nRet = iotcon_list_add_str(hList, VALUE, VAL1);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_str", IotConGetError(nRet),iotcon_list_destroy(hList));
-
+
nRet =iotcon_list_add_str(hList, VALUE, VAL2);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_str", IotConGetError(nRet),iotcon_list_destroy(hList));
nRet = iotcon_list_foreach_str(hList, IotconListStrCB, &nCount);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_foreach_str", IotConGetError(nRet),iotcon_list_destroy(hList));
-
+
if(g_bCheckCb == false)
{
FPRINTF("[Line : %d][%s] callback not invoked : \\n", __LINE__, API_NAMESPACE );
iotcon_list_destroy(hList);
return 1;
}
-
+
if(3 != nCount)
{
FPRINTF("[Line : %d][%s] value mismatch : \\n", __LINE__, API_NAMESPACE );
iotcon_list_destroy(hList);
return 1;
}
-
+
if(hList)
{
iotcon_list_destroy(hList);
- hList = NULL;
+ hList = NULL;
}
-
+
return 0;
}
int ITc_iotcon_list_foreach_list_p(void)
{
START_TEST;
-
+
int nCount = 0;
iotcon_list_h hList1, hList2;
g_bCheckCb = false;
iotcon_list_h hList = NULL;
-
+
int nRet = iotcon_list_create(IOTCON_TYPE_LIST,&hList);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet));
CHECK_HANDLE(hList,"iotcon_list_create");
-
+
nRet = iotcon_list_create(IOTCON_TYPE_INT,&hList1);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet),iotcon_list_destroy(hList));
CHECK_HANDLE(hList1,"iotcon_list_create");
-
+
nRet = iotcon_list_create(IOTCON_TYPE_DOUBLE,&hList2);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet),iotcon_list_destroy(hList1);iotcon_list_destroy(hList));
CHECK_HANDLE(hList2,"iotcon_list_create");
-
+
nRet =iotcon_list_add_list(hList, hList1, VAL1);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_list", IotConGetError(nRet),iotcon_list_destroy(hList2);iotcon_list_destroy(hList1);iotcon_list_destroy(hList));
nRet = iotcon_list_foreach_list(hList, IotconListListCB, &nCount);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_foreach_list", IotConGetError(nRet),iotcon_list_destroy(hList2);iotcon_list_destroy(hList1);iotcon_list_destroy(hList));
-
-
+
+
if(g_bCheckCb == false)
{
FPRINTF("[Line : %d][%s] callback not invoked : \\n", __LINE__, API_NAMESPACE );
iotcon_list_destroy(hList1);
hList1 = NULL;
iotcon_list_destroy(hList);
- hList = NULL;
+ hList = NULL;
return 1;
}
-
- if (2 != nCount)
+
+ if (2 != nCount)
{
FPRINTF("[Line : %d][%s] value mismatch : \\n", __LINE__, API_NAMESPACE );
iotcon_list_destroy(hList2);hList2 = NULL;
iotcon_list_destroy(hList1);hList1 = NULL;
iotcon_list_destroy(hList);
- hList = NULL;
+ hList = NULL;
return 1;
}
-
+
iotcon_list_destroy(hList2);hList2 = NULL;
iotcon_list_destroy(hList1);hList1 = NULL;
-
+
if(hList)
{
iotcon_list_destroy(hList);
- hList = NULL;
+ hList = NULL;
}
-
+
return 0;
}
int ITc_iotcon_list_foreach_attributes_p(void)
{
START_TEST;
-
+
int nCount = 0;
iotcon_attributes_h hState1, hState2;
g_bCheckCb = false;
-
+
iotcon_list_h hList = NULL;
-
+
int nRet = iotcon_list_create(IOTCON_TYPE_ATTRIBUTES,&hList);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet));
CHECK_HANDLE(hList,"iotcon_list_create");
nRet = iotcon_list_foreach_attributes(hList, IotconListStateCB, &nCount);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_foreach_attributes", IotConGetError(nRet),iotcon_attributes_destroy(hState2);iotcon_attributes_destroy(hState1);iotcon_list_destroy(hList));
-
-
-
+
+
+
if(g_bCheckCb == false)
{
FPRINTF("[Line : %d][%s] callback not invoked : \\n", __LINE__, API_NAMESPACE );
iotcon_attributes_destroy(hState1);
hState1 = NULL;
iotcon_list_destroy(hList);
- hList = NULL;
+ hList = NULL;
return 1;
}
-
- if (2 != nCount)
+
+ if (2 != nCount)
{
FPRINTF("[Line : %d][%s] value mismatch : \\n", __LINE__, API_NAMESPACE );
iotcon_attributes_destroy(hState2);hState2 = NULL;
iotcon_attributes_destroy(hState1);hState1 = NULL;
iotcon_list_destroy(hList);
- hList = NULL;
+ hList = NULL;
return 1;
}
-
+
iotcon_attributes_destroy(hState2);
hState2 = NULL;
iotcon_attributes_destroy(hState1);
hState1 = NULL;
-
+
if(hList)
{
iotcon_list_destroy(hList);
- hList = NULL;
+ hList = NULL;
}
-
+
return 0;
}
iotcon_list_h hList = NULL;
unsigned char temp_byte_str[3] = {70, 71, 72};
int nStrLen = 3;
-
+
int nRet = iotcon_list_create(IOTCON_TYPE_BYTE_STR,&hList);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet));
CHECK_HANDLE(hList,"iotcon_list_create");
nRet = iotcon_list_add_byte_str(hList, temp_byte_str, nStrLen, VAL1);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_byte_str", IotConGetError(nRet),iotcon_list_destroy(hList));
-
+
iotcon_list_destroy(hList);
hList = NULL;
return 0;
-
+
}
int len ;
unsigned char temp_byte_str[3] = {70, 71, 72};
int nStrLen = 3;
-
+
int nRet = iotcon_list_create(IOTCON_TYPE_BYTE_STR,&hList);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet));
CHECK_HANDLE(hList,"iotcon_list_create");
nRet = iotcon_list_add_byte_str(hList, temp_byte_str, nStrLen, VAL1);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_byte_str", IotConGetError(nRet),iotcon_list_destroy(hList));
-
+
nRet = iotcon_list_get_nth_byte_str(hList,VAL1, &val, &len);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_get_nth_byte_str", IotConGetError(nRet),iotcon_list_destroy(hList));
-
+
if(val == NULL)
{
FPRINTF("[Line : %d][%s] ITc_iotcon_list_get_nth_byte_str_p failed as val or len is NULL : \\n", __LINE__, API_NAMESPACE );
iotcon_list_destroy(hList);
hList = NULL;
- return 1;
+ return 1;
}
-
+
iotcon_list_destroy(hList);
hList = NULL;
return 0;
unsigned char temp_byte_str[3] = {70, 71, 72};
int count =0;
int nStrLen = 3;
-
+
int nRet = iotcon_list_create(IOTCON_TYPE_BYTE_STR,&hList);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet));
CHECK_HANDLE(hList,"iotcon_list_create");
-
+
nRet = iotcon_list_add_byte_str(hList, temp_byte_str, nStrLen, VAL1);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_byte_str", IotConGetError(nRet),iotcon_list_destroy(hList));
-
+
g_bCheckCb =false;
nRet = iotcon_list_foreach_byte_str( hList,IotconListByteStrCB,&count);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_foreach_byte_str", IotConGetError(nRet),iotcon_list_destroy(hList));
hList = NULL;
return 1;
}
-
+
iotcon_list_destroy(hList);
hList = NULL;
return 0;
/** @} */
-/** @} */
\ No newline at end of file
+/** @} */
void ITs_iotcon_lite_resource_startup(void)
{
struct stat stBuff;
+ char *svr_db_path;
if ( stat(ERR_LOG, &stBuff) == 0 )
{
remove(ERR_LOG);
}
g_bIotconConnect = true;
g_bFeatureUnsupported = false;
- int nRet = iotcon_initialize();
-
+
+ ic_get_svr_db_path(&svr_db_path);
+ int nRet = iotcon_initialize(svr_db_path);
+ free(svr_db_path);
+
if ( !TCTCheckSystemInfoFeatureSupported(IOTCON_FEATURE, API_NAMESPACE) )
{
-
+
if ( nRet != TIZEN_ERROR_NOT_SUPPORTED )
{
FPRINTF("[Line : %d][%s] iotcon_initialize API call returned mismatch %s error for unsupported feature\\n", __LINE__, API_NAMESPACE, IotConGetError(nRet));
}
return;
}
-
+
if ( nRet != IOTCON_ERROR_NONE )
{
FPRINTF("[Line : %d][%s] iotcon_initialize failed API return %s error \\n", __LINE__, API_NAMESPACE, IotConGetError(nRet));
g_bIotconConnect = false;
return;
}
-
+
return;
}
int ITc_iotcon_lite_resource_create_destroy_p(void)
{
IotconCreateLiteResource();
-
+
if (g_hLiteLightResource)
{
int nRet = iotcon_lite_resource_destroy(g_hLiteLightResource);
* @scenario create iotcon resource \n
* create state iotcon resource \n
* add state iotcon resource \n
-* update state iotcon resource \n
+* update state iotcon resource \n
* @apicovered iotcon_attributes_add_int, iotcon_lite_resource_update_attributes, iotcon_attributes_destroy
* @passcase if iotcon_lite_resource_update_attributes passes
* @failcase if iotcon_lite_resource_update_attributes fails
IotconDestroyLiteResource();
return 1;
}
-
+
nRet = iotcon_attributes_add_int(state, LITE_RESOURCE_BR, ++g_nBrightness);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_int", IotConGetError(nRet));
}
/** @} */
-/** @} */
\ No newline at end of file
+/** @} */
void ITs_iotcon_observers_startup(void)
{
struct stat stBuff;
+ char *svr_db_path;
if ( stat(ERR_LOG, &stBuff) == 0 )
{
remove(ERR_LOG);
}
g_bIotconConnect = true;
g_bFeatureUnsupported = false;
- int nRet = iotcon_initialize();
-
+
+ ic_get_svr_db_path(&svr_db_path);
+ int nRet = iotcon_initialize(svr_db_path);
+ free(svr_db_path);
+
if ( !TCTCheckSystemInfoFeatureSupported(IOTCON_FEATURE, API_NAMESPACE) )
{
-
+
if ( nRet != TIZEN_ERROR_NOT_SUPPORTED )
{
FPRINTF("[Line : %d][%s] iotcon_initialize API call returned mismatch %s error for unsupported feature\\n", __LINE__, API_NAMESPACE, IotConGetError(nRet));
}
return;
}
-
+
if ( nRet != IOTCON_ERROR_NONE )
{
FPRINTF("[Line : %d][%s] iotcon_initialize failed API return %s error \\n", __LINE__, API_NAMESPACE, IotConGetError(nRet));
g_bIotconConnect = false;
return;
}
-
+
nRet = iotcon_observers_create(&g_hIotconObservers);
- if (IOTCON_ERROR_NONE != nRet)
+ if (IOTCON_ERROR_NONE != nRet)
{
FPRINTF("[Line : %d][%s] iotcon_observers_create fail in startup error returned : \\n", __LINE__, API_NAMESPACE);
iotcon_deinitialize();
g_bIotconConnect = false;
return;
}
-
+
if( g_hIotconObservers == NULL)
{
FPRINTF("[Line : %d][%s] iotcon_observers_create failed ,as g_hIotconObservers is NULL : \\n", __LINE__, API_NAMESPACE);
{
iotcon_observers_destroy(g_hIotconObservers);
}
-
+
if( g_bIotconConnect )
{
iotcon_deinitialize();
- }
+ }
return;
}
int ITc_iotcon_observers_create_destroy_p(void)
{
START_TEST;
-
+
iotcon_observers_h hIotconObservers = NULL;
-
+
int nRet = iotcon_observers_create(&hIotconObservers);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_observers_create", IotConGetError(nRet));
-
+
if( hIotconObservers == NULL)
{
FPRINTF("[Line : %d][%s] iotcon_observers_create failed ,as hIotconObservers is NULL : \\n", __LINE__, API_NAMESPACE);
return 1;
}
-
+
iotcon_observers_destroy(hIotconObservers);
-
+
return 0;
}
//& type: auto
int nRet = iotcon_observers_add(g_hIotconObservers, 1);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_observers_add", IotConGetError(nRet));
-
+
nRet = iotcon_observers_remove(g_hIotconObservers, 1);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_observers_remove", IotConGetError(nRet));
-
+
return 0;
}
/** @} */
-/** @} */
\ No newline at end of file
+/** @} */
FPRINTF("[Line : %d][%s] Inside IotconOptionsForeachCB callback\\n", __LINE__, API_NAMESPACE);
if (user_data)
++ (*((int *)user_data));
-
+
if(data== NULL)
{
FPRINTF("[Line : %d][%s] IotconOptionsForeachCB callback, data is NULL\\n", __LINE__, API_NAMESPACE);
return IOTCON_FUNC_CONTINUE;
}
-
+
g_bCheckCb = true;
-
+
return IOTCON_FUNC_CONTINUE;
}
void ITs_iotcon_options_startup(void)
{
struct stat stBuff;
+ char *svr_db_path;
if ( stat(ERR_LOG, &stBuff) == 0 )
{
remove(ERR_LOG);
}
g_bIotconConnect = true;
g_bFeatureUnsupported = false;
- int nRet = iotcon_initialize();
-
+
+ ic_get_svr_db_path(&svr_db_path);
+ int nRet = iotcon_initialize(svr_db_path);
+ free(svr_db_path);
+
if ( !TCTCheckSystemInfoFeatureSupported(IOTCON_FEATURE, API_NAMESPACE) )
{
-
+
if ( nRet != TIZEN_ERROR_NOT_SUPPORTED )
{
FPRINTF("[Line : %d][%s] iotcon_initialize API call returned mismatch %s error for unsupported feature\\n", __LINE__, API_NAMESPACE, IotConGetError(nRet));
}
return;
}
-
+
if ( nRet != IOTCON_ERROR_NONE )
{
FPRINTF("[Line : %d][%s] iotcon_initialize failed API return %s error \\n", __LINE__, API_NAMESPACE, IotConGetError(nRet));
g_bIotconConnect = false;
return;
}
-
+
nRet = iotcon_options_create(&g_hOptions);
- if ( nRet != IOTCON_ERROR_NONE)
+ if ( nRet != IOTCON_ERROR_NONE)
{
FPRINTF("[Line : %d][%s] iotcon_options_create fail in startup \\n", __LINE__, API_NAMESPACE);
iotcon_deinitialize();
*/
void ITs_iotcon_options_cleanup(void)
{
-
+
#if DEBUG
FPRINTF("[Line : %d][%s] TEST SUIT clean-up: ITs_Iotcon_Options_p\\n", __LINE__, API_NAMESPACE);
#endif
if ( g_bIotconConnect )
iotcon_deinitialize();
-
+
return;
}
int ITc_iotcon_options_create_destroy_p(void)
{
START_TEST;
-
+
iotcon_options_h hOptions = NULL;
-
+
int nRet = iotcon_options_create(&hOptions);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_options_create", IotConGetError(nRet));
CHECK_HANDLE(hOptions,"iotcon_options_create");
-
+
iotcon_options_destroy(hOptions);
hOptions = NULL;
-
+
return 0;
}
int ITc_iotcon_options_add_remove_p(void)
{
START_TEST;
-
+
int nRet = iotcon_options_add(g_hOptions, ICL_OPTIONID_MIN, VALUE);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_options_add", IotConGetError(nRet),iotcon_options_destroy(g_hOptions));
-
+
nRet = iotcon_options_remove(g_hOptions, ICL_OPTIONID_MIN);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_options_remove", IotConGetError(nRet),iotcon_options_destroy(g_hOptions));
int ITc_iotcon_options_lookup_p(void)
{
START_TEST;
-
+
char *pszGetData;
int nRet = iotcon_options_add(g_hOptions, ICL_OPTIONID_MIN, VALUE);
nRet = iotcon_options_lookup(g_hOptions, ICL_OPTIONID_MIN, &pszGetData);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_options_lookup", IotConGetError(nRet),iotcon_options_destroy(g_hOptions));
-
- if (0 != strcmp(pszGetData, VALUE))
+
+ if (0 != strcmp(pszGetData, VALUE))
{
FPRINTF("[Line : %d][%s] value mismatch : \\n", __LINE__, API_NAMESPACE );
iotcon_options_destroy(g_hOptions);
return 1;
}
-
+
nRet = iotcon_options_remove(g_hOptions, ICL_OPTIONID_MIN);
PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_options_remove", IotConGetError(nRet));
-
+
return 0;
}
int ITc_iotcon_options_foreach_p(void)
{
START_TEST;
-
+
int nCount =0;
g_bCheckCb = false;
char *pszSetData1 = "data1";
char *pszSetData2 = "data2";
-
+
int nRet = iotcon_options_add(g_hOptions, ICL_OPTIONID_MIN, pszSetData1);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_options_add", IotConGetError(nRet),iotcon_options_destroy(g_hOptions));
-
+
nRet = iotcon_options_add(g_hOptions, ICL_OPTIONID_MIN + 1, pszSetData2);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_options_add", IotConGetError(nRet),iotcon_options_destroy(g_hOptions));
-
+
nRet = iotcon_options_foreach(g_hOptions, IotconOptionsForeachCB, &nCount);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_options_foreach", IotConGetError(nRet),iotcon_options_destroy(g_hOptions));
-
+
if(g_bCheckCb == false)
{
FPRINTF("[Line : %d][%s] callback not invoked : \\n", __LINE__, API_NAMESPACE );
iotcon_options_destroy(g_hOptions);
return 1;
}
- if ( nCount != 2 )
+ if ( nCount != 2 )
{
FPRINTF("[Line : %d][%s] value mismatch : \\n", __LINE__, API_NAMESPACE );
iotcon_options_destroy(g_hOptions);
return 1;
}
-
+
nRet = iotcon_options_remove(g_hOptions, ICL_OPTIONID_MIN);
PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_options_remove", IotConGetError(nRet));
-
+
nRet = iotcon_options_remove(g_hOptions, ICL_OPTIONID_MIN + 1);
PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_options_remove", IotConGetError(nRet));
return 0;
}
-
+
+/** @} */
/** @} */
-/** @} */
\ No newline at end of file
void ITs_iotcon_presence_response_startup(void)
{
struct stat stBuff;
+ char *svr_db_path;
if ( stat(ERR_LOG, &stBuff) == 0 )
{
remove(ERR_LOG);
}
g_bIotconConnect = true;
g_bFeatureUnsupported = false;
- int nRet = iotcon_initialize();
+
+ ic_get_svr_db_path(&svr_db_path);
+ int nRet = iotcon_initialize(svr_db_path);
+ free(svr_db_path);
if ( !TCTCheckSystemInfoFeatureSupported(IOTCON_FEATURE, API_NAMESPACE) )
{
void ITs_iotcon_presence_startup(void)
{
struct stat stBuff;
+ char *svr_db_path;
if ( stat(ERR_LOG, &stBuff) == 0 )
{
remove(ERR_LOG);
}
g_bIotconConnect = true;
g_bFeatureUnsupported = false;
- int nRet = iotcon_initialize();
+
+ ic_get_svr_db_path(&svr_db_path);
+ int nRet = iotcon_initialize(svr_db_path);
+ free(svr_db_path);
if ( !TCTCheckSystemInfoFeatureSupported(IOTCON_FEATURE, API_NAMESPACE) )
{
void ITs_iotcon_query_startup(void)
{
struct stat stBuff;
+ char *svr_db_path;
if ( stat(ERR_LOG, &stBuff) == 0 )
{
remove(ERR_LOG);
}
g_bIotconConnect = true;
g_bFeatureUnsupported = false;
- int nRet = iotcon_initialize();
-
+
+ ic_get_svr_db_path(&svr_db_path);
+ int nRet = iotcon_initialize(svr_db_path);
+ free(svr_db_path);
+
if ( !TCTCheckSystemInfoFeatureSupported(IOTCON_FEATURE, API_NAMESPACE) )
{
-
+
if ( nRet != TIZEN_ERROR_NOT_SUPPORTED )
{
FPRINTF("[Line : %d][%s] iotcon_initialize API call returned mismatch %s error for unsupported feature\\n", __LINE__, API_NAMESPACE, IotConGetError(nRet));
}
return;
}
-
+
if ( nRet != IOTCON_ERROR_NONE )
{
FPRINTF("[Line : %d][%s] iotcon_initialize failed API return %s error \\n", __LINE__, API_NAMESPACE, IotConGetError(nRet));
g_bIotconConnect = false;
return;
}
-
+
nRet = iotcon_query_create(&g_hQuery);
- if (IOTCON_ERROR_NONE != nRet)
+ if (IOTCON_ERROR_NONE != nRet)
{
FPRINTF("[Line : %d][%s] iotcon_query_create fail in startup error returned : %s\\n", __LINE__, API_NAMESPACE,IotConGetError(nRet));
iotcon_deinitialize();
* @{
*/
-//& purpose: Creates a new query handle.
-//& type: auto
+//& purpose: Creates a new query handle.
+//& type: auto
/**
* @testcase ITc_iotcon_query_create_destroy_p
* @since_tizen 3.0
* @author SRID(manu.tiwari)
* @reviewer SRID(parshant.v)
* @type auto
-* @description Creates a new query handle.
+* @description Creates a new query handle.
* @scenario call iotcon_query_create
-* @apicovered iotcon_query_create
+* @apicovered iotcon_query_create
* @passcase When iotcon_query_create is successful.
* @failcase If target API iotcon_query_create or any precondition API fails.
* @precondition NA
int ITc_iotcon_query_create_destroy_p(void)
{
START_TEST;
-
+
iotcon_query_h hQuery = NULL;
//target api
int nRet = iotcon_query_create(&hQuery);
CHECK_HANDLE(hQuery,"iotcon_query_create");
//target api
iotcon_query_destroy(hQuery);
-
+
return 0;
}
-//& purpose: Sets and gets resource types from the query.
-//& type: auto
+//& purpose: Sets and gets resource types from the query.
+//& type: auto
/**
* @testcase ITc_iotcon_query_set_get_resource_types_p
* @since_tizen 3.0
* @author SRID(manu.tiwari)
* @reviewer SRID(parshant.v)
* @type auto
-* @description Sets and gets resource types from the query.
+* @description Sets and gets resource types from the query.
* @scenario call iotcon_query_set_resource_types and iotcon_query_get_resource_types
-* @apicovered iotcon_query_set_resource_types and iotcon_query_get_resource_types
+* @apicovered iotcon_query_set_resource_types and iotcon_query_get_resource_types
* @passcase When iotcon_query_set_resource_types and iotcon_query_get_resource_types are successful.
* @failcase If target API iotcon_query_set_resource_types and iotcon_query_get_resource_types or any precondition API fails.
* @precondition NA
/*int ITc_iotcon_query_set_get_resource_types_p(void)
{
START_TEST;
-
+
iotcon_resource_types_h types = NULL;
char *Gettypes = NULL;
-
+
int nRet = iotcon_resource_types_create(&types);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_resource_types_create", IotConGetError(nRet));
if(types == NULL)
FPRINTF("[Line : %d][%s] iotcon_resource_types_create failed as types is NULL\\n", __LINE__, API_NAMESPACE );
return 1;
}
-
+
nRet = iotcon_resource_types_add(types, "core.led");
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_resource_types_add", IotConGetError(nRet),iotcon_resource_types_destroy(types));
-
+
//target api
nRet = iotcon_query_set_resource_types(g_hQuery, "org.tizen.light");
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_query_set_resource_types", IotConGetError(nRet),iotcon_resource_types_destroy(types));
-
+
//target api
nRet = iotcon_query_get_resource_types(g_hQuery, &Gettypes);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_query_get_resource_types", IotConGetError(nRet),iotcon_resource_types_destroy(types););
-
-
+
+
if( strcmp("org.tizen.light",Gettypes) != 0)
{
FPRINTF("[Line : %d][%s] Values of set get not matched!!!\\n", __LINE__, API_NAMESPACE);
iotcon_resource_types_destroy(types);
return 1;
}
-
+
iotcon_resource_types_destroy(types);
return 0;
}*/
-//& purpose: Sets and gets the interface from the query.
-//& type: auto
+//& purpose: Sets and gets the interface from the query.
+//& type: auto
/**
* @testcase ITc_iotcon_query_set_get_interface_p
* @since_tizen 3.0
* @author SRID(manu.tiwari)
* @reviewer SRID(parshant.v)
* @type auto
-* @description Sets and gets the interface from the query.
+* @description Sets and gets the interface from the query.
* @scenario call iotcon_query_set_interface and iotcon_query_get_interface
-* @apicovered iotcon_query_set_interface and iotcon_query_get_interface
+* @apicovered iotcon_query_set_interface and iotcon_query_get_interface
* @passcase When iotcon_query_set_interface and iotcon_query_get_interface are successful.
* @failcase If target API iotcon_query_set_interface and iotcon_query_get_interface or any precondition API fails.
* @precondition NA
int ITc_iotcon_query_set_get_interface_p(void)
{
START_TEST;
-
- char *pszface = NULL;
-
+
+ char *pszface = NULL;
+
//target api
int nRet = iotcon_query_set_interface(g_hQuery, IOTCON_INTERFACE_DEFAULT);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_query_set_interface", IotConGetError(nRet));
return 0;
}
-//& purpose: Add and remove a new key and corresponding value into the query.
-//& type: auto
+//& purpose: Add and remove a new key and corresponding value into the query.
+//& type: auto
/**
* @testcase ITc_iotcon_query_add_remove_p
* @since_tizen 3.0
* @type auto
* @description Add and remove a new key and corresponding value into the query.
* @scenario call iotcon_query_add and iotcon_query_remove
-* @apicovered iotcon_query_add and iotcon_query_remove
+* @apicovered iotcon_query_add and iotcon_query_remove
* @passcase When iotcon_query_add and iotcon_query_remove are successful.
* @failcase If target API iotcon_query_add and iotcon_query_remove or any precondition API fails.
* @precondition NA
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_query_remove", IotConGetError(nRet));
return 0;
}
-//& purpose: Looks up data at the given key from the query.
-//& type: auto
+//& purpose: Looks up data at the given key from the query.
+//& type: auto
/**
* @testcase ITc_iotcon_query_lookup_p
* @since_tizen 3.0
* @type auto
* @description Looks up data at the given key from the query.
* @scenario call iotcon_query_lookup
-* @apicovered iotcon_query_lookup
+* @apicovered iotcon_query_lookup
* @passcase When iotcon_query_lookup is successful.
* @failcase If target API iotcon_query_lookup or any precondition API fails.
* @precondition NA
char *data = NULL;
int nRet = iotcon_query_add(g_hQuery, KEY, VALUE);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_query_add", IotConGetError(nRet));
-
+
//target api
nRet = iotcon_query_lookup(g_hQuery, KEY, &data);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_query_lookup", IotConGetError(nRet));
PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_query_remove", IotConGetError(nRet));
return 1;
}
- if (0 != strcmp(VALUE, data))
+ if (0 != strcmp(VALUE, data))
{
FPRINTF("[Line : %d][%s] look up data does not match with actual data!!!\\n", __LINE__, API_NAMESPACE);
nRet = iotcon_query_remove(g_hQuery, KEY);
- PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_query_remove", IotConGetError(nRet));
+ PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_query_remove", IotConGetError(nRet));
return 1;
}
-
+
nRet = iotcon_query_remove(g_hQuery, KEY);
PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_query_remove", IotConGetError(nRet));
-
+
return 0;
}
/**
* @description Specifies the type of function passed to iotcon_query_foreach()
* @parameter[IN] key The key of the query
* @parameter[IN] value The value of the query
-* @parameter[IN] user_data The user data to pass to the function
+* @parameter[IN] user_data The user data to pass to the function
* @return true to continue with the next iteration of the loop.
*/
static bool IotconQueryForeachCB(const char *key, const char *value,void *user_data)
g_bIotconQueryForeachCompletedCallback = true;
if (user_data)
++ (*((int *)user_data));
-
+
return IOTCON_FUNC_CONTINUE;
}
-//& purpose: Gets all data of the query by invoking the callback function.
-//& type: auto
+//& purpose: Gets all data of the query by invoking the callback function.
+//& type: auto
/**
* @testcase ITc_iotcon_query_foreach_p
* @since_tizen 3.0
* @type auto
* @description Gets all data of the query by invoking the callback function
* @scenario call iotcon_query_foreach
-* @apicovered iotcon_query_foreach
+* @apicovered iotcon_query_foreach
* @passcase When iotcon_query_foreach is successful.
* @failcase If target API iotcon_query_foreach or any precondition API fails.
* @precondition NA
int ITc_iotcon_query_foreach_p(void)
{
START_TEST;
-
+
int count = 0;
-
+
int nRet = iotcon_query_add(g_hQuery, "key1", "val1");
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_query_add", IotConGetError(nRet));
-
+
nRet = iotcon_query_add(g_hQuery, "key2", "val2");
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_query_add", IotConGetError(nRet));
-
+
nRet = iotcon_query_add(g_hQuery, "key3", "val3");
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_query_add", IotConGetError(nRet));
g_bIotconQueryForeachCompletedCallback = false;
-
+
//target api
nRet = iotcon_query_foreach(g_hQuery, IotconQueryForeachCB, &count);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_query_foreach", IotConGetError(nRet));
-
+
if ( !g_bIotconQueryForeachCompletedCallback )
{
FPRINTF("[Line : %d][%s] callback not invoked\\n", __LINE__, API_NAMESPACE);
FPRINTF("[Line : %d][%s] iotcon_query_foreach is successful\\n", __LINE__, API_NAMESPACE);
#endif
}
- if (count != VAL4)
+ if (count != VAL4)
{
FPRINTF("[Line : %d][%s] iotcon_query_foreach is not successful!!!\\n", __LINE__, API_NAMESPACE);
return 1;
}
-
+
nRet = iotcon_query_remove(g_hQuery, "key1");
PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_query_remove", IotConGetError(nRet));
-
+
nRet = iotcon_query_remove(g_hQuery, "key2");
PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_query_remove", IotConGetError(nRet));
-
+
nRet = iotcon_query_remove(g_hQuery, "key3");
PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_query_remove", IotConGetError(nRet));
-
+
return 0;
}
void ITs_iotcon_remote_resource_startup(void)
{
struct stat stBuff;
+ char *svr_db_path;
if ( stat(ERR_LOG, &stBuff) == 0 )
{
remove(ERR_LOG);
}
g_bIotconConnect = true;
g_bFeatureUnsupported = false;
- int nRet = iotcon_initialize();
+
+ ic_get_svr_db_path(&svr_db_path);
+ int nRet = iotcon_initialize(svr_db_path);
+ free(svr_db_path);
if ( !TCTCheckSystemInfoFeatureSupported(IOTCON_FEATURE, API_NAMESPACE) )
{
*/
int ITc_remote_resource_get_device_name_p(void)
{
-
+
char *pszDeviceName =NULL;
int nIotconTimeoutId = 0;
-
+
g_bCheckCb = false;
int nRet = IotconCreateLiteResource();
IotconDestroyLiteResource();
return 1;
}
-
+
nRet = iotcon_remote_resource_get_device_name(g_hResourceHandle, &pszDeviceName);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_remote_resource_get_device_name", IotConGetError(nRet), IotconDestroyLiteResource();iotcon_remote_resource_destroy(g_hResourceHandle));
iotcon_remote_resource_destroy(g_hResourceHandle);
IotconDestroyLiteResource();
return 1;
-
+
}
iotcon_remote_resource_destroy(g_hResourceHandle);
IotconDestroyLiteResource();
-
+
return 0;
}
void ITs_iotcon_representation_startup(void)
{
struct stat stBuff;
+ char *svr_db_path;
if ( stat(ERR_LOG, &stBuff) == 0 )
{
remove(ERR_LOG);
}
g_bIotconConnect = true;
g_bFeatureUnsupported = false;
- int nRet = iotcon_initialize();
-
+
+ ic_get_svr_db_path(&svr_db_path);
+ int nRet = iotcon_initialize(svr_db_path);
+ free(svr_db_path);
+
if ( !TCTCheckSystemInfoFeatureSupported(IOTCON_FEATURE, API_NAMESPACE) )
{
-
+
if ( nRet != TIZEN_ERROR_NOT_SUPPORTED )
{
FPRINTF("[Line : %d][%s] iotcon_initialize API call returned mismatch %s error for unsupported feature\\n", __LINE__, API_NAMESPACE, IotConGetError(nRet));
}
return;
}
-
+
if ( nRet != IOTCON_ERROR_NONE )
{
FPRINTF("[Line : %d][%s] iotcon_initialize failed API return %s error \\n", __LINE__, API_NAMESPACE, IotConGetError(nRet));
}
nRet = iotcon_representation_create(&g_hRepresentation);
- if (IOTCON_ERROR_NONE != nRet)
+ if (IOTCON_ERROR_NONE != nRet)
{
FPRINTF("[Line : %d][%s] iotcon_representation_create: %s\\n", __LINE__, API_NAMESPACE,IotConGetError(nRet));
iotcon_deinitialize();
g_bIotconConnect = false;
return;
}
-
+
if (g_hRepresentation == NULL )
{
FPRINTF("[Line : %d][%s] Handle to representation object is returned NULL \n", __LINE__, API_NAMESPACE);
iotcon_representation_destroy (g_hRepresentation);
iotcon_deinitialize();
g_bIotconConnect = false;
- return;
+ return;
}
return;
}
int ITc_iotcon_representation_create_destroy_p(void)
{
START_TEST;
- iotcon_representation_h hRepresentation = NULL;
+ iotcon_representation_h hRepresentation = NULL;
int nRet = iotcon_representation_create(&hRepresentation);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_representation_create", IotConGetError(nRet));
CHECK_HANDLE(hRepresentation,"iotcon_representation_create");
-
+
iotcon_representation_destroy (hRepresentation);
return 0;
}
int ITc_iotcon_representation_clone_p(void)
{
START_TEST;
-
+
iotcon_representation_h hRepr = NULL;
-
+
int nRet = iotcon_representation_clone(g_hRepresentation, &hRepr);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_representation_clone", IotConGetError(nRet));
CHECK_HANDLE(hRepr,"iotcon_representation_clone");
-
+
iotcon_representation_destroy(hRepr);
-
+
return 0;
}
char *uri=NULL;
int nRet = iotcon_representation_set_uri_path(g_hRepresentation, "/a/led");
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_representation_set_uri_path", IotConGetError(nRet));
-
+
nRet = iotcon_representation_get_uri_path(g_hRepresentation, &uri);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_representation_get_uri_path", IotConGetError(nRet));
CHECK_HANDLE(uri,"iotcon_representation_get_uri_path");
-
- if (0 != strcmp("/a/led", uri))
+
+ if (0 != strcmp("/a/led", uri))
{
FPRINTF("[Line : %d][%s] Values of set get not matched!!! !!!\\n", __LINE__, API_NAMESPACE);
return 1;
ret = iotcon_resource_types_create(&hTypes);
PRINT_RESULT(IOTCON_ERROR_NONE, ret, "iotcon_resource_types_create", IotConGetError(ret));
CHECK_HANDLE(hTypes,"iotcon_resource_types_create");
-
+
ret = iotcon_resource_types_add(hTypes, REMOTE_RESOURCE);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, ret, "iotcon_resource_types_add", IotConGetError(ret),iotcon_resource_types_destroy(hTypes));
ret = iotcon_representation_set_resource_types(g_hRepresentation, hTypes);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, ret, "iotcon_representation_set_resource_types", IotConGetError(ret),iotcon_resource_types_destroy(hTypes));
-
+
ret = iotcon_representation_get_resource_types(g_hRepresentation, &hGettype);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, ret, "iotcon_representation_get_resource_types", IotConGetError(ret),iotcon_resource_types_destroy(hTypes));
if (hGettype == NULL )
{
FPRINTF("[Line : %d][%s] Handle to resource type object is returned NULL \n", __LINE__, API_NAMESPACE);
iotcon_resource_types_destroy(hTypes);
- return 1;
+ return 1;
}
if(hTypes != hGettype)
{
}
iotcon_resource_types_destroy(hTypes);
-
+
return 0;
}
/**
int ITc_iotcon_representation_set_get_resource_interfaces_p(void)
{
START_TEST;
-
+
int nRet = 0;
iotcon_resource_interfaces_h hfaces = NULL;
iotcon_resource_interfaces_h hfacesOut;
-
+
nRet = iotcon_resource_interfaces_create(&hfaces);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_resource_interfaces_create", IotConGetError(nRet));
CHECK_HANDLE(hfaces,"iotcon_resource_interfaces_create");
-
+
nRet = iotcon_resource_interfaces_add(hfaces, IOTCON_INTERFACE_DEFAULT);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_resource_interfaces_add", IotConGetError(nRet),iotcon_resource_interfaces_destroy(hfaces));
nRet = iotcon_representation_get_resource_interfaces(g_hRepresentation, &hfacesOut);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_representation_get_resource_interfaces", IotConGetError(nRet) ,iotcon_resource_interfaces_destroy(hfaces));
-
+
if(hfaces != hfacesOut)
{
FPRINTF("[Line : %d][%s] Values of set get not matched!!!\\n", __LINE__, API_NAMESPACE);
{
FPRINTF("[Line : %d][%s] Handle to hGetState object is returned NULL \n", __LINE__, API_NAMESPACE);
iotcon_attributes_destroy(hSetAttributes);
- return 1;
+ return 1;
}
if(hSetAttributes != hGetState)
{
iotcon_attributes_destroy(hSetAttributes);
return 1;
}
-
+
iotcon_attributes_destroy(hSetAttributes);
return 0;
}
*/
int ITc_iotcon_representation_add_remove_child_p(void)
{
- START_TEST;
+ START_TEST;
int ret;
iotcon_representation_h hRepr = NULL;
ret = iotcon_representation_create(&hRepr);
PRINT_RESULT(IOTCON_ERROR_NONE, ret, "iotcon_representation_create", IotConGetError(ret));
CHECK_HANDLE(hRepr,"iotcon_representation_create");
-
+
ret = iotcon_representation_add_child(g_hRepresentation, hRepr);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, ret, "iotcon_representation_add_child", IotConGetError(ret),iotcon_representation_destroy(hRepr));
* @function IotconForeachChildrenCB
* @description Specifies the type of function passed to iotcon_representation_foreach_children()
* @parameter[IN] child is iotcon representation handle
-* @parameter[IN] user_data The user data to pass to the function
+* @parameter[IN] user_data The user data to pass to the function
* @return true to continue with the next iteration of the loop.
*/
FPRINTF("[Line : %d][%s] IotconForeachChildrenCB input resource is NULL failed !!!\\n", __LINE__, API_NAMESPACE);
}
g_bCheckCb = true;
-
+
return IOTCON_FUNC_CONTINUE;
}
/**
*/
int ITc_iotcon_representation_foreach_children_p(void)
{
- START_TEST;
+ START_TEST;
int ret;
int count = 0;
-
+
iotcon_representation_h hRepr1=NULL;
iotcon_representation_h hRepr2=NULL;
iotcon_representation_h hRepr3=NULL;
g_bCheckCb = false;
-
+
ret = iotcon_representation_create(&hRepr1);
PRINT_RESULT(IOTCON_ERROR_NONE, ret, "iotcon_representation_create", IotConGetError(ret));
CHECK_HANDLE(hRepr1,"iotcon_representation_create");
{
FPRINTF("[Line : %d][%s] Handle to representation object is returned NULL \n", __LINE__, API_NAMESPACE);
iotcon_representation_destroy(hRepr1);
- return 1;
+ return 1;
}
-
+
ret = iotcon_representation_create(&hRepr3);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, ret, "iotcon_representation_create", IotConGetError(ret),iotcon_representation_destroy(hRepr2);iotcon_representation_destroy(hRepr1));
if (hRepr3 == NULL )
FPRINTF("[Line : %d][%s] Handle to representation object is returned NULL \n", __LINE__, API_NAMESPACE);
iotcon_representation_destroy(hRepr2);
iotcon_representation_destroy(hRepr1);
- return 1;
+ return 1;
}
-
+
ret = iotcon_representation_add_child(g_hRepresentation, hRepr1);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, ret, "iotcon_representation_add_child", IotConGetError(ret),iotcon_representation_destroy(hRepr3);iotcon_representation_destroy(hRepr2);iotcon_representation_destroy(hRepr1));
-
+
ret = iotcon_representation_add_child(g_hRepresentation, hRepr2);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, ret, "iotcon_representation_add_child", IotConGetError(ret),iotcon_representation_destroy(hRepr3);iotcon_representation_destroy(hRepr2);iotcon_representation_destroy(hRepr1));
-
+
ret = iotcon_representation_add_child(g_hRepresentation, hRepr3);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, ret, "iotcon_representation_add_child", IotConGetError(ret),iotcon_representation_destroy(hRepr3);iotcon_representation_destroy(hRepr2);iotcon_representation_destroy(hRepr1));
-
+
ret = iotcon_representation_foreach_children(g_hRepresentation, IotconForeachChildrenCB, &count);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, ret, "iotcon_representation_foreach_children", IotConGetError(ret),iotcon_representation_destroy(hRepr3);iotcon_representation_destroy(hRepr2);iotcon_representation_destroy(hRepr1));
-
+
if (count != 3)
{
FPRINTF("[Line : %d][%s] Count values of foreach_children not matched!!!\\n", __LINE__, API_NAMESPACE);
*/
int ITc_iotcon_representation_get_child_count_p(void)
{
- START_TEST;
+ START_TEST;
int ret;
unsigned int count = 0;
iotcon_representation_h hRepr1 = NULL;
ret = iotcon_representation_create(&hReprChld);
PRINT_RESULT(IOTCON_ERROR_NONE, ret, "iotcon_representation_create", IotConGetError(ret));
CHECK_HANDLE(hReprChld,"iotcon_representation_create");
-
+
ret = iotcon_representation_create(&hRepr1);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, ret, "iotcon_representation_create", IotConGetError(ret), iotcon_representation_destroy(hReprChld));
if (hRepr1 == NULL )
{
FPRINTF("[Line : %d][%s] Handle to representation object is returned NULL \n", __LINE__, API_NAMESPACE);
iotcon_representation_destroy(hReprChld);
- return 1;
+ return 1;
}
ret = iotcon_representation_create(&hRepr2);
FPRINTF("[Line : %d][%s] Handle to representation object is returned NULL \n", __LINE__, API_NAMESPACE);
iotcon_representation_destroy(hReprChld);
iotcon_representation_destroy(hRepr1);
- return 1;
+ return 1;
}
ret = iotcon_representation_add_child(hReprChld, hRepr1);
ret = iotcon_representation_add_child(hReprChld, hRepr2);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, ret, "iotcon_representation_add_child", IotConGetError(ret),iotcon_representation_destroy(hRepr2);iotcon_representation_destroy(hRepr1);iotcon_representation_destroy(hReprChld));
-
+
ret = iotcon_representation_get_child_count(hReprChld, &count);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, ret, " iotcon_representation_get_child_count", IotConGetError(ret),iotcon_representation_destroy(hRepr2);iotcon_representation_destroy(hRepr1);iotcon_representation_destroy(hReprChld));
-
+
if (count != VAL3)
{
FPRINTF("[Line : %d][%s] Count values of iotcon_representation_get_child_count not matched!!!\\n", __LINE__, API_NAMESPACE);
* @type auto
* @since_tizen 3.0
* @description scenario to add child sequentially and fetch a particular child for representation
-* @scenario create and add children to representation one by one and get 2nd child using API
+* @scenario create and add children to representation one by one and get 2nd child using API
* iotcon_representation_get_nth_child and match the result.
* @apicovered iotcon_representation_create,iotcon_representation_add_child,iotcon_representation_get_nth_child
* @passcase When iotcon_representation_add_child and iotcon_representation_get_nth_child are successful.
* @precondition NA
* @postcondition NA
*/
-int ITc_iotcon_representation_get_nth_child_p(void)
+int ITc_iotcon_representation_get_nth_child_p(void)
{
- START_TEST;
+ START_TEST;
int i;
int ret;
iotcon_representation_h hRepr = NULL;
iotcon_representation_h hReprChld = NULL;
-
+
ret = iotcon_representation_create(&hRepr);
PRINT_RESULT(IOTCON_ERROR_NONE, ret, "iotcon_representation_create", IotConGetError(ret));
CHECK_HANDLE(hRepr,"iotcon_representation_create");
- for (i = 0; i < LOOP_COUNT; i++)
+ for (i = 0; i < LOOP_COUNT; i++)
{
ret = iotcon_representation_create(&hReprChld);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, ret, "iotcon_representation_create", IotConGetError(ret),iotcon_representation_destroy(hRepr));
{
FPRINTF("[Line : %d][%s] Handle to representation object is returned NULL \n", __LINE__, API_NAMESPACE);
iotcon_representation_destroy(hRepr);
- return 1;
+ return 1;
}
ret = iotcon_representation_add_child(hRepr, hReprChld);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, ret, "iotcon_representation_add_child", IotConGetError(ret), iotcon_representation_destroy(hReprChld));
-
+
iotcon_representation_destroy(hReprChld);
hReprChld = NULL;
}
- for (i = 0; i < LOOP_COUNT; i++)
+ for (i = 0; i < LOOP_COUNT; i++)
{
ret = iotcon_representation_get_nth_child(hRepr, i, &hReprChld);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, ret, "iotcon_representation_get_nth_child", IotConGetError(ret), iotcon_representation_destroy(hRepr));
}
-
+
iotcon_representation_destroy(hRepr);
return 0;
}
void ITs_iotcon_request_startup(void)
{
struct stat stBuff;
+ char *svr_db_path;
if ( stat(ERR_LOG, &stBuff) == 0 )
{
remove(ERR_LOG);
}
g_bIotconConnect = true;
g_bFeatureUnsupported = false;
- int nRet = iotcon_initialize();
+
+ ic_get_svr_db_path(&svr_db_path);
+ int nRet = iotcon_initialize(svr_db_path);
+ free(svr_db_path);
if ( !TCTCheckSystemInfoFeatureSupported(IOTCON_FEATURE, API_NAMESPACE) )
{
g_bRequestHandlerCB = true;
nRet = CreateRepresentation(&hRep);
- if (IOTCON_ERROR_NONE != nRet) {
- FPRINTF("CreateRepresentation() Fail(%d)", nRet);
- QuitGmainLoopIdle(false);
- return;
- }
-
- nRet = iotcon_response_create(request, &hResponse);
- if (IOTCON_ERROR_NONE != nRet) {
- FPRINTF("iotcon_response_create() Fail(%d)", nRet);
- QuitGmainLoopIdle(false);
- return;
- }
-
- nRet = iotcon_response_set_representation(hResponse, hRep);
- if (IOTCON_ERROR_NONE != nRet) {
- FPRINTF("iotcon_response_set_representation() Fail(%d)", nRet);
- iotcon_response_destroy(hResponse);
- QuitGmainLoopIdle(false);
- return;
- }
-
- nRet = iotcon_response_set_result(hResponse, IOTCON_RESPONSE_OK);
- if (IOTCON_ERROR_NONE != nRet) {
- FPRINTF("iotcon_response_set_result() Fail(%d)", nRet);
- iotcon_response_destroy(hResponse);
- QuitGmainLoopIdle(false);
- return;
+ if (IOTCON_ERROR_NONE != nRet) {
+ FPRINTF("CreateRepresentation() Fail(%d)", nRet);
+ QuitGmainLoopIdle(false);
+ return;
+ }
+
+ nRet = iotcon_response_create(request, &hResponse);
+ if (IOTCON_ERROR_NONE != nRet) {
+ FPRINTF("iotcon_response_create() Fail(%d)", nRet);
+ QuitGmainLoopIdle(false);
+ return;
+ }
+
+ nRet = iotcon_response_set_representation(hResponse, hRep);
+ if (IOTCON_ERROR_NONE != nRet) {
+ FPRINTF("iotcon_response_set_representation() Fail(%d)", nRet);
+ iotcon_response_destroy(hResponse);
+ QuitGmainLoopIdle(false);
+ return;
+ }
+
+ nRet = iotcon_response_set_result(hResponse, IOTCON_RESPONSE_OK);
+ if (IOTCON_ERROR_NONE != nRet) {
+ FPRINTF("iotcon_response_set_result() Fail(%d)", nRet);
+ iotcon_response_destroy(hResponse);
+ QuitGmainLoopIdle(false);
+ return;
}
iotcon_representation_destroy(hRep);
void ITs_iotcon_resource_startup(void)
{
struct stat stBuff;
+ char *svr_db_path;
if ( stat(ERR_LOG, &stBuff) == 0 )
{
remove(ERR_LOG);
}
g_bIotconConnect = true;
g_bFeatureUnsupported = false;
- int nRet = iotcon_initialize();
+
+ ic_get_svr_db_path(&svr_db_path);
+ int nRet = iotcon_initialize(svr_db_path);
+ free(svr_db_path);
if ( !TCTCheckSystemInfoFeatureSupported(IOTCON_FEATURE, API_NAMESPACE) )
{
}
nRet = iotcon_resource_get_policies(g_hLightResource, &nProperties);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_resource_get_policies", IotConGetError(nRet),IotconDestroyRes());
- if ((IOTCON_RESOURCE_DISCOVERABLE | IOTCON_RESOURCE_OBSERVABLE) != nProperties)
+ if ((IOTCON_RESOURCE_DISCOVERABLE | IOTCON_RESOURCE_OBSERVABLE) != nProperties)
{
IotconDestroyRes();
return 1;
/**
* @function CreateAttributes
-* @description Function to create iotcon attributes
+* @description Function to create iotcon attributes
* @parameter iotcon_attributes_h : iotcon attributes handle
-* @return intiger : 0 if sussess
+* @return intiger : 0 if sussess
*/
int CreateAttributes(iotcon_attributes_h *attributes_h)
{
nRet = iotcon_attributes_create(&hAttributes);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_create", IotConGetError(nRet));
-
+
nRet = iotcon_attributes_add_int(hAttributes, "int", 1);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_int", IotConGetError(nRet),iotcon_attributes_destroy(hAttributes));
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_int", IotConGetError(nRet),iotcon_attributes_destroy(hAttributes));
nRet = iotcon_attributes_add_bool(hAttributes, "bool", true);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_bool", IotConGetError(nRet),iotcon_attributes_destroy(hAttributes));
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_bool", IotConGetError(nRet),iotcon_attributes_destroy(hAttributes));
nRet = iotcon_attributes_add_double(hAttributes, "double", 1.1);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_double", IotConGetError(nRet),iotcon_attributes_destroy(hAttributes));
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_double", IotConGetError(nRet),iotcon_attributes_destroy(hAttributes));
nRet = iotcon_attributes_add_null(hAttributes, "null");
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_null", IotConGetError(nRet),iotcon_attributes_destroy(hAttributes));
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_null", IotConGetError(nRet),iotcon_attributes_destroy(hAttributes));
nRet = iotcon_attributes_add_str(hAttributes, "str", "string");
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_str", IotConGetError(nRet),iotcon_attributes_destroy(hAttributes));
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_str", IotConGetError(nRet),iotcon_attributes_destroy(hAttributes));
nRet = iotcon_attributes_add_byte_str(hAttributes, "bytestr", byte_str, 3);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_byte_str", IotConGetError(nRet),iotcon_attributes_destroy(hAttributes));
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_byte_str", IotConGetError(nRet),iotcon_attributes_destroy(hAttributes));
/* attributes */
nRet = iotcon_attributes_create(&hValAttributes);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_create", IotConGetError(nRet),iotcon_attributes_destroy(hAttributes));
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_create", IotConGetError(nRet),iotcon_attributes_destroy(hAttributes));
nRet = iotcon_attributes_add_int(hValAttributes, "hValAttributes", 10);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_int", IotConGetError(nRet),iotcon_attributes_destroy(hValAttributes);iotcon_attributes_destroy(hAttributes));
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_int", IotConGetError(nRet),iotcon_attributes_destroy(hValAttributes);iotcon_attributes_destroy(hAttributes));
nRet = iotcon_attributes_add_attributes(hAttributes, "attributes", hValAttributes);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_attributes", IotConGetError(nRet),iotcon_attributes_destroy(hValAttributes);iotcon_attributes_destroy(hAttributes));
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_attributes", IotConGetError(nRet),iotcon_attributes_destroy(hValAttributes);iotcon_attributes_destroy(hAttributes));
/* attributes list */
nRet = iotcon_list_create(IOTCON_TYPE_ATTRIBUTES, &list6);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet),iotcon_attributes_destroy(hValAttributes);iotcon_attributes_destroy(hAttributes));
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet),iotcon_attributes_destroy(hValAttributes);iotcon_attributes_destroy(hAttributes));
nRet = iotcon_list_add_attributes(list6, hValAttributes, -1);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_attributes", IotConGetError(nRet),iotcon_list_destroy(list6);iotcon_attributes_destroy(hValAttributes);iotcon_attributes_destroy(hAttributes));
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_attributes", IotConGetError(nRet),iotcon_list_destroy(list6);iotcon_attributes_destroy(hValAttributes);iotcon_attributes_destroy(hAttributes));
iotcon_attributes_destroy(hValAttributes);
nRet = iotcon_attributes_add_list(hAttributes, "state_list", list6);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_list", IotConGetError(nRet),iotcon_list_destroy(list6);iotcon_attributes_destroy(hAttributes));
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_list", IotConGetError(nRet),iotcon_list_destroy(list6);iotcon_attributes_destroy(hAttributes));
iotcon_list_destroy(list6);
/* int list */
nRet = iotcon_list_create(IOTCON_TYPE_INT, &list1);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet),iotcon_attributes_destroy(hAttributes));
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet),iotcon_attributes_destroy(hAttributes));
nRet = iotcon_list_add_int(list1, 1, -1);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_int", IotConGetError(nRet),iotcon_list_destroy(list1);iotcon_attributes_destroy(hAttributes));
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_int", IotConGetError(nRet),iotcon_list_destroy(list1);iotcon_attributes_destroy(hAttributes));
nRet = iotcon_attributes_add_list(hAttributes, "int_list", list1);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_list", IotConGetError(nRet),iotcon_list_destroy(list1);iotcon_attributes_destroy(hAttributes));
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_list", IotConGetError(nRet),iotcon_list_destroy(list1);iotcon_attributes_destroy(hAttributes));
iotcon_list_destroy(list1);
/* boolean list */
nRet = iotcon_list_create(IOTCON_TYPE_BOOL, &list2);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet),iotcon_attributes_destroy(hAttributes));
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet),iotcon_attributes_destroy(hAttributes));
nRet = iotcon_list_add_bool(list2, true, -1);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_bool", IotConGetError(nRet),iotcon_list_destroy(list2);iotcon_attributes_destroy(hAttributes));
-
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_bool", IotConGetError(nRet),iotcon_list_destroy(list2);iotcon_attributes_destroy(hAttributes));
+
nRet = iotcon_attributes_add_list(hAttributes, "bool_list", list2);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_list", IotConGetError(nRet),iotcon_list_destroy(list2);iotcon_attributes_destroy(hAttributes));
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_list", IotConGetError(nRet),iotcon_list_destroy(list2);iotcon_attributes_destroy(hAttributes));
iotcon_list_destroy(list2);
/* string list */
nRet = iotcon_list_create(IOTCON_TYPE_STR, &list3);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet),iotcon_attributes_destroy(hAttributes));
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet),iotcon_attributes_destroy(hAttributes));
nRet = iotcon_list_add_str(list3, "string", -1);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_str", IotConGetError(nRet),iotcon_list_destroy(list3);iotcon_attributes_destroy(hAttributes));
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_str", IotConGetError(nRet),iotcon_list_destroy(list3);iotcon_attributes_destroy(hAttributes));
nRet = iotcon_attributes_add_list(hAttributes, "str_list", list3);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_list", IotConGetError(nRet),iotcon_list_destroy(list3);iotcon_attributes_destroy(hAttributes));
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_list", IotConGetError(nRet),iotcon_list_destroy(list3);iotcon_attributes_destroy(hAttributes));
iotcon_list_destroy(list3);
/* byte string list */
nRet = iotcon_list_create(IOTCON_TYPE_BYTE_STR, &list4);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet),iotcon_attributes_destroy(hAttributes));
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet),iotcon_attributes_destroy(hAttributes));
nRet = iotcon_list_add_byte_str(list4, byte_str, 3, -1);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_byte_str", IotConGetError(nRet),iotcon_list_destroy(list4);iotcon_attributes_destroy(hAttributes));
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_byte_str", IotConGetError(nRet),iotcon_list_destroy(list4);iotcon_attributes_destroy(hAttributes));
nRet = iotcon_attributes_add_list(hAttributes, "byte_str_list", list4);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_list", IotConGetError(nRet),iotcon_list_destroy(list4);iotcon_attributes_destroy(hAttributes));
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_list", IotConGetError(nRet),iotcon_list_destroy(list4);iotcon_attributes_destroy(hAttributes));
/* list list */
nRet = iotcon_list_create(IOTCON_TYPE_LIST, &list5);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet),iotcon_list_destroy(list4);iotcon_attributes_destroy(hAttributes));
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet),iotcon_list_destroy(list4);iotcon_attributes_destroy(hAttributes));
nRet = iotcon_list_add_list(list5, list4, -1);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_list", IotConGetError(nRet),iotcon_list_destroy(list5);iotcon_list_destroy(list4);iotcon_attributes_destroy(hAttributes));
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_list", IotConGetError(nRet),iotcon_list_destroy(list5);iotcon_list_destroy(list4);iotcon_attributes_destroy(hAttributes));
iotcon_list_destroy(list4);
nRet = iotcon_attributes_add_list(hAttributes, "list_list", list5);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_list", IotConGetError(nRet),iotcon_list_destroy(list5);iotcon_attributes_destroy(hAttributes));
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_list", IotConGetError(nRet),iotcon_list_destroy(list5);iotcon_attributes_destroy(hAttributes));
iotcon_list_destroy(list5);
/* double list */
nRet = iotcon_list_create(IOTCON_TYPE_DOUBLE, &list7);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet),iotcon_attributes_destroy(hAttributes));
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet),iotcon_attributes_destroy(hAttributes));
nRet = iotcon_list_add_double(list7, 1.1, -1);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_double", IotConGetError(nRet),iotcon_list_destroy(list7);iotcon_attributes_destroy(hAttributes));
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_list_add_double", IotConGetError(nRet),iotcon_list_destroy(list7);iotcon_attributes_destroy(hAttributes));
nRet =iotcon_attributes_add_list(hAttributes, "double_list", list7);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_list", IotConGetError(nRet),iotcon_list_destroy(list7);iotcon_attributes_destroy(hAttributes));
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_list", IotConGetError(nRet),iotcon_list_destroy(list7);iotcon_attributes_destroy(hAttributes));
iotcon_list_destroy(list7);
*attributes_h = hAttributes;
void ITs_iotcon_response_startup(void)
{
struct stat stBuff;
+ char *svr_db_path;
if ( stat(ERR_LOG, &stBuff) == 0 )
{
remove(ERR_LOG);
}
g_bIotconConnect = true;
g_bFeatureUnsupported = false;
- int nRet = iotcon_initialize();
+
+ ic_get_svr_db_path(&svr_db_path);
+ int nRet = iotcon_initialize(svr_db_path);
+ free(svr_db_path);
if ( !TCTCheckSystemInfoFeatureSupported(IOTCON_FEATURE, API_NAMESPACE) )
{
nRet = iotcon_representation_create(&hRep);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_representation_create", IotConGetError(nRet),iotcon_response_destroy(hResponse));
CHECK_HANDLE_CLEANUP(hRep,"iotcon_representation_create",iotcon_response_destroy(hResponse));
-
+
nRet = iotcon_response_set_representation(hResponse, hRep);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_response_set_representation", IotConGetError(nRet),iotcon_representation_destroy(hRep);iotcon_response_destroy(hResponse););
-
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_response_set_representation", IotConGetError(nRet),iotcon_representation_destroy(hRep);iotcon_response_destroy(hResponse););
+
nRet = iotcon_response_get_representation(hResponse, &hRepresentation);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_response_get_representation", IotConGetError(nRet),iotcon_representation_destroy(hRep);iotcon_response_destroy(hResponse));
CHECK_HANDLE(hRepresentation,"iotcon_response_get_representation");
nRet = iotcon_representation_create(&hRep);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_representation_create", IotConGetError(nRet),iotcon_options_destroy(hOptions);iotcon_response_destroy(hResponse));
CHECK_HANDLE_CLEANUP(hRep,"iotcon_representation_create",iotcon_options_destroy(hOptions);iotcon_representation_destroy(hRep);iotcon_response_destroy(hResponse));
-
+
nRet = iotcon_response_set_representation(hResponse, hRep);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_response_set_representation", IotConGetError(nRet),iotcon_representation_destroy(hRep);iotcon_options_destroy(hOptions);iotcon_response_destroy(hResponse));
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_response_set_representation", IotConGetError(nRet),iotcon_representation_destroy(hRep);iotcon_options_destroy(hOptions);iotcon_response_destroy(hResponse));
//target api
nRet = iotcon_response_send(hResponse);
bool IotconStateCB(iotcon_attributes_h hAttributes, const char *key, void *user_data)
{
FPRINTF("[Line : %d][%s] Inside IotconStateCB callback\\n", __LINE__, API_NAMESPACE);
-
+
if((hAttributes == NULL) || (key == NULL))
{
FPRINTF("[Line : %d][%s] Inside IotconStateCB fails as input values are NULL \\n", __LINE__, API_NAMESPACE);
void ITs_iotcon_attributes_startup(void)
{
struct stat stBuff;
+ char *svr_db_path;
if ( stat(ERR_LOG, &stBuff) == 0 )
{
remove(ERR_LOG);
}
g_bIotconConnect = true;
g_bFeatureUnsupported = false;
- int nRet = iotcon_initialize();
+
+ ic_get_svr_db_path(&svr_db_path);
+ int nRet = iotcon_initialize(svr_db_path);
+ free(svr_db_path);
if ( !TCTCheckSystemInfoFeatureSupported(IOTCON_FEATURE, API_NAMESPACE) )
{
g_bIotconConnect = false;
return;
}
-
+
nRet = iotcon_attributes_create(&g_hAttributes);
if (IOTCON_ERROR_NONE != nRet)
{
if(g_hRepr)
iotcon_representation_destroy(g_hRepr);
-
- if (g_hAttributes)
+
+ if (g_hAttributes)
iotcon_attributes_destroy(g_hAttributes);
if (g_bIotconConnect)
int ITc_iotcon_attributes_create_destroy_p(void)
{
START_TEST;
-
+
iotcon_attributes_h hState = NULL;
int nRet = iotcon_attributes_create(&hState);
iotcon_attributes_destroy(hState);
hState = NULL;
-
+
return 0;
}
int ITc_iotcon_attributes_clone_p(void)
{
START_TEST;
-
+
iotcon_attributes_h hState = NULL;
int nRet = iotcon_attributes_clone(g_hAttributes, &hState);
int nSetIntVal = 10;
int nGetIntVal;
-
+
int nRet = iotcon_attributes_add_int(g_hAttributes, KEY, nSetIntVal);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_int", IotConGetError(nRet));
FPRINTF("[Line : %d][%s] value mismatch \\n", __LINE__, API_NAMESPACE );
return 1;
}
-
+
nRet = iotcon_attributes_remove(g_hAttributes, KEY);
PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_remove", IotConGetError(nRet));
-
+
return 0;
}
FPRINTF("[Line : %d][%s] value mismatch \\n", __LINE__, API_NAMESPACE );
return 1;
}
-
+
nRet = iotcon_attributes_remove(g_hAttributes, KEY);
PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_remove", IotConGetError(nRet));
-
+
return 0;
}
nRet = iotcon_attributes_remove(g_hAttributes, KEY);
PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_remove", IotConGetError(nRet));
-
+
return 0;
}
int nRet = iotcon_list_create(IOTCON_TYPE_INT,&hList);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_list_create", IotConGetError(nRet));
CHECK_HANDLE(hList,"iotcon_list_create");
-
+
nRet = iotcon_attributes_add_list(g_hAttributes, KEY, hList);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_list", IotConGetError(nRet));
nRet = iotcon_attributes_get_list(g_hAttributes, KEY, &hList);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_get_list", IotConGetError(nRet));
CHECK_HANDLE(hList,"iotcon_attributes_get_list");
-
+
nRet = iotcon_attributes_remove(g_hAttributes, KEY);
PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_remove", IotConGetError(nRet));
-
+
if(hList)
{
iotcon_list_destroy(hList);
int ITc_iotcon_attributes_add_get_attributes_p(void)
{
START_TEST;
-
+
iotcon_attributes_h hState1, hState2;
-
+
int nRet = iotcon_attributes_create(&hState1);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_create", IotConGetError(nRet));
CHECK_HANDLE(hState1,"iotcon_attributes_create");
nRet = iotcon_attributes_add_attributes(g_hAttributes, KEY, hState1);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_attributes", IotConGetError(nRet),iotcon_attributes_destroy(hState1));
-
+
iotcon_attributes_destroy(hState1);
nRet = iotcon_attributes_get_attributes(g_hAttributes, KEY, &hState2);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_get_attributes", IotConGetError(nRet));
CHECK_HANDLE(hState2,"iotcon_attributes_get_attributes");
-
+
nRet = iotcon_attributes_remove(g_hAttributes, KEY);
PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_remove", IotConGetError(nRet));
FPRINTF("[Line : %d][%s] value is not null : \\n", __LINE__, API_NAMESPACE );
return 1;
}
-
+
nRet = iotcon_attributes_remove(g_hAttributes, KEY);
PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_remove", IotConGetError(nRet));
* @since_tizen 3.0
* @description scenario to remove hAttributes
* @scenario add different states like int,double,bool,null \n
-* iotcon_attributes_remove
+* iotcon_attributes_remove
* @apicovered iotcon_attributes_remove
* @passcase if iotcon_attributes_remove passes
* @failcase if iotcon_attributes_remove fails
int nSetIntVal = 10;
bool bSetVal = true;
double nSetDbVal = 3.4;
-
+
int nRet = iotcon_attributes_add_int(g_hAttributes, KEY, nSetIntVal);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_int", IotConGetError(nRet));
nRet = iotcon_attributes_remove(g_hAttributes, KEY);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_remove", IotConGetError(nRet));
-
+
return 0;
}
nRet = iotcon_attributes_get_type(g_hAttributes, KEY, &eType);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_get_type", IotConGetError(nRet));
-
+
if(eType != IOTCON_TYPE_INT)
{
FPRINTF("[Line : %d][%s] value mismatch : \\n", __LINE__, API_NAMESPACE );
return 1;
}
-
+
nRet = iotcon_attributes_remove(g_hAttributes, KEY);
PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_remove", IotConGetError(nRet));
int ITc_iotcon_attributes_foreach_p(void)
{
START_TEST;
-
+
iotcon_attributes_h hState1, hState2;
g_bCheckCb = false;
-
+
int nRet = iotcon_attributes_create(&hState1);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_create", IotConGetError(nRet));
CHECK_HANDLE(hState1,"iotcon_attributes_create");
nRet = iotcon_attributes_create(&hState2);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_create", IotConGetError(nRet),iotcon_attributes_destroy(hState2);iotcon_attributes_destroy(hState1));
CHECK_HANDLE(hState2,"iotcon_attributes_create");
-
+
nRet = iotcon_attributes_add_attributes(g_hAttributes, VALUE, hState1);
PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_add_attributes", IotConGetError(nRet),iotcon_attributes_destroy(hState2);iotcon_attributes_destroy(hState1));
iotcon_attributes_destroy(hState1);hState1 = NULL;
return 1;
}
-
+
nRet = iotcon_attributes_remove(g_hAttributes, VALUE);
PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_remove", IotConGetError(nRet));
-
+
nRet = iotcon_attributes_remove(g_hAttributes, KEY);
PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_remove", IotConGetError(nRet));
-
+
iotcon_attributes_destroy(hState2);hState2 = NULL;
iotcon_attributes_destroy(hState1);hState1 = NULL;
-
+
return 0;
}
iotcon_attributes_destroy(hState1);hState1 = NULL;
return 1;
}
-
+
nRet = iotcon_attributes_remove(g_hAttributes, VALUE);
PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_remove", IotConGetError(nRet));
-
+
nRet = iotcon_attributes_remove(g_hAttributes, KEY);
PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_remove", IotConGetError(nRet));
iotcon_attributes_destroy(hState2);hState2 = NULL;
iotcon_attributes_destroy(hState1);hState1 = NULL;
-
+
return 0;
}
void ITs_iotcon_startup(void)
{
struct stat stBuff;
+ char *svr_db_path;
if ( stat(ERR_LOG, &stBuff) == 0 )
{
remove(ERR_LOG);
}
g_bIotconConnect = true;
g_bFeatureUnsupported = false;
-
- int nRet = iotcon_initialize();
-
+
+ ic_get_svr_db_path(&svr_db_path);
+ int nRet = iotcon_initialize(svr_db_path);
+ free(svr_db_path);
+
if ( !TCTCheckSystemInfoFeatureSupported(IOTCON_FEATURE, API_NAMESPACE) )
{
-
+
if ( nRet != TIZEN_ERROR_NOT_SUPPORTED )
{
FPRINTF("[Line : %d][%s] iotcon_initialize API call returned mismatch %s error for unsupported feature\\n", __LINE__, API_NAMESPACE, IotConGetError(nRet));
g_bIotconConnect = false;
-
+
}
else
{
}
return;
}
-
+
if ( nRet != IOTCON_ERROR_NONE )
{
FPRINTF("[Line : %d][%s] iotcon_initialize failed API return %s error \\n", __LINE__, API_NAMESPACE, IotConGetError(nRet));
int ITc_iotcon_initialize_deinitialize_p(void)
{
START_TEST;
-
+ char *svr_db_path;
+
iotcon_deinitialize();
- int nRet = iotcon_initialize();
+ ic_get_svr_db_path(&svr_db_path);
+ int nRet = iotcon_initialize(svr_db_path);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_initialize", IotConGetError(nRet));
-
+
iotcon_deinitialize();
- nRet = iotcon_initialize();
+ nRet = iotcon_initialize(svr_db_path);
+ free(svr_db_path);
PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_initialize", IotConGetError(nRet));
-
+
if(nRet != IOTCON_ERROR_NONE)
g_bIotconConnect = false;
-
+
return 0;
}
int ITc_iotcon_set_get_timeout_p(void)
{
START_TEST;
-
+
int nTimeoutSec = 0;
int nRet = iotcon_set_timeout(IOTCON_TIMEOUT);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_set_timeout", IotConGetError(nRet));
-
+
nRet = iotcon_get_timeout(&nTimeoutSec);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_get_timeout", IotConGetError(nRet));
-
+
if(nTimeoutSec != IOTCON_TIMEOUT)
{
FPRINTF("[Line : %d][%s] Failed testcase, as value set by API iotcon_set_timeout is not same as provided by API iotcon_get_timeout : \\n", __LINE__, API_NAMESPACE);
return 1;
}
-
+
return 0;
}
//& type: auto
* @reviewer SRID(a.pandia1)
* @type auto
* @since_tizen 3.0
-* @description sets the device name
-* @scenario sets the device name *
+* @description sets the device name
+* @scenario sets the device name *
* @apicovered iotcon_set_device_name
* @passcase if iotcon_set_device_name passes
* @failcase if iotcon_set_device_name fails
* @precondition NA
* @postcondition NA
*/
-int ITc_iotcon_set_device_name_p(void)
-{
+int ITc_iotcon_set_device_name_p(void)
+{
START_TEST;
char*pszDeviceName = "device_name";
- int nRet = iotcon_set_device_name(pszDeviceName);
+ int nRet = iotcon_set_device_name(pszDeviceName);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_set_device_name", IotConGetError(nRet));
-
- return 0;
-}
+
+ return 0;
+}
#if 0
* @reviewer SRID(parshant.v)
* @type auto
* @since_tizen 3.0
-* @description sets and gets polling value
+* @description sets and gets polling value
* @scenario sets polling value \n
* gets polling value\n
* @apicovered iotcon_polling_set_interval, iotcon_polling_get_interval
int nRet;
int getInterval;
int setInterval = 100;
-
+
nRet = iotcon_polling_set_interval(setInterval);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_polling_set_interval", IotConGetError(nRet));
-
+
nRet = iotcon_polling_get_interval(&getInterval);
PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_polling_get_interval", IotConGetError(nRet));
-
+
if(setInterval != getInterval)
{
FPRINTF("[Line : %d][%s] Failed testcase, as value set by API is not same as provided by get API: \\n", __LINE__, API_NAMESPACE);
{"ITc_iotcon_remote_resource_get_policies_p", ITc_iotcon_remote_resource_get_policies_p, ITs_iotcon_remote_resource_startup, ITs_iotcon_remote_resource_cleanup},
{"ITc_iotcon_remote_resource_set_get_options_p", ITc_iotcon_remote_resource_set_get_options_p, ITs_iotcon_remote_resource_startup, ITs_iotcon_remote_resource_cleanup},
{"ITc_iotcon_remote_resource_get_cached_representation_p", ITc_iotcon_remote_resource_get_cached_representation_p, ITs_iotcon_remote_resource_startup, ITs_iotcon_remote_resource_cleanup},
- {"ITc_iotcon_remote_resource_set_get_time_interval_p", ITc_iotcon_remote_resource_set_get_time_interval_p, ITs_iotcon_remote_resource_startup, ITs_iotcon_remote_resource_cleanup},
+ {"ITc_iotcon_remote_resource_set_get_time_interval_p", ITc_iotcon_remote_resource_set_get_time_interval_p, ITs_iotcon_remote_resource_startup, ITs_iotcon_remote_resource_cleanup},
{"ITc_iotcon_representation_create_destroy_p", ITc_iotcon_representation_create_destroy_p, ITs_iotcon_representation_startup, ITs_iotcon_representation_cleanup},
{"ITc_iotcon_representation_clone_p", ITc_iotcon_representation_clone_p, ITs_iotcon_representation_startup, ITs_iotcon_representation_cleanup},
{"ITc_iotcon_representation_set_get_uri_path_p", ITc_iotcon_representation_set_get_uri_path_p, ITs_iotcon_representation_startup, ITs_iotcon_representation_cleanup},
{"ITc_iotcon_attributes_get_keys_count_p", ITc_iotcon_attributes_get_keys_count_p, ITs_iotcon_attributes_startup, ITs_iotcon_attributes_cleanup},
{"ITc_iotcon_attributes_add_get_byte_str_p", ITc_iotcon_attributes_add_get_byte_str_p, ITs_iotcon_attributes_startup, ITs_iotcon_attributes_cleanup},
{"ITc_iotcon_set_device_name_p", ITc_iotcon_set_device_name_p, ITs_iotcon_startup, ITs_iotcon_cleanup},
- {"ITc_remote_resource_get_device_name_p", ITc_remote_resource_get_device_name_p, ITs_iotcon_remote_resource_startup, ITs_iotcon_remote_resource_cleanup},
+ {"ITc_remote_resource_get_device_name_p", ITc_remote_resource_get_device_name_p, ITs_iotcon_remote_resource_startup, ITs_iotcon_remote_resource_cleanup},
// {"ITc_iotcon_set_persistent_storage_p", ITc_iotcon_set_persistent_storage_p, ITs_iotcon_security_startup, ITs_iotcon_security_cleanup},
{NULL, NULL}
};
{"ITc_iotcon_remote_resource_get_policies_p", ITc_iotcon_remote_resource_get_policies_p, ITs_iotcon_remote_resource_startup, ITs_iotcon_remote_resource_cleanup},
{"ITc_iotcon_remote_resource_set_get_options_p", ITc_iotcon_remote_resource_set_get_options_p, ITs_iotcon_remote_resource_startup, ITs_iotcon_remote_resource_cleanup},
{"ITc_iotcon_remote_resource_get_cached_representation_p", ITc_iotcon_remote_resource_get_cached_representation_p, ITs_iotcon_remote_resource_startup, ITs_iotcon_remote_resource_cleanup},
- {"ITc_iotcon_remote_resource_set_get_time_interval_p", ITc_iotcon_remote_resource_set_get_time_interval_p, ITs_iotcon_remote_resource_startup, ITs_iotcon_remote_resource_cleanup},
+ {"ITc_iotcon_remote_resource_set_get_time_interval_p", ITc_iotcon_remote_resource_set_get_time_interval_p, ITs_iotcon_remote_resource_startup, ITs_iotcon_remote_resource_cleanup},
{"ITc_iotcon_representation_create_destroy_p", ITc_iotcon_representation_create_destroy_p, ITs_iotcon_representation_startup, ITs_iotcon_representation_cleanup},
{"ITc_iotcon_representation_clone_p", ITc_iotcon_representation_clone_p, ITs_iotcon_representation_startup, ITs_iotcon_representation_cleanup},
{"ITc_iotcon_representation_set_get_uri_path_p", ITc_iotcon_representation_set_get_uri_path_p, ITs_iotcon_representation_startup, ITs_iotcon_representation_cleanup},
{"ITc_iotcon_attributes_get_keys_count_p", ITc_iotcon_attributes_get_keys_count_p, ITs_iotcon_attributes_startup, ITs_iotcon_attributes_cleanup},
{"ITc_iotcon_attributes_add_get_byte_str_p", ITc_iotcon_attributes_add_get_byte_str_p, ITs_iotcon_attributes_startup, ITs_iotcon_attributes_cleanup},
{"ITc_iotcon_set_device_name_p", ITc_iotcon_set_device_name_p, ITs_iotcon_startup, ITs_iotcon_cleanup},
- {"ITc_remote_resource_get_device_name_p", ITc_remote_resource_get_device_name_p, ITs_iotcon_remote_resource_startup, ITs_iotcon_remote_resource_cleanup},
+ {"ITc_remote_resource_get_device_name_p", ITc_remote_resource_get_device_name_p, ITs_iotcon_remote_resource_startup, ITs_iotcon_remote_resource_cleanup},
// {"ITc_iotcon_set_persistent_storage_p", ITc_iotcon_set_persistent_storage_p, ITs_iotcon_security_startup, ITs_iotcon_security_cleanup},
{NULL, NULL}
};