[ITC][IoTCon][ACR-682] integrate iotcon_initialize() and iotcon_secure_initialize()
authorsung.goo.kim <sung.goo.kim@samsung.com>
Thu, 23 Jun 2016 10:07:31 +0000 (19:07 +0900)
committersung.goo.kim <sung.goo.kim@samsung.com>
Thu, 23 Jun 2016 10:08:12 +0000 (19:08 +0900)
Change-Id: Iacdcd1dda760efdaa41b6f03ea4e1248d99192b3

21 files changed:
packaging/itc/native-iotcon-itc.spec
src/itc/iotcon/ITs-iotcon-common.c
src/itc/iotcon/ITs-iotcon-common.h
src/itc/iotcon/ITs-iotcon-device.c
src/itc/iotcon/ITs-iotcon-list.c
src/itc/iotcon/ITs-iotcon-lite-resource.c
src/itc/iotcon/ITs-iotcon-observers.c
src/itc/iotcon/ITs-iotcon-options.c
src/itc/iotcon/ITs-iotcon-presence-response.c
src/itc/iotcon/ITs-iotcon-presence.c
src/itc/iotcon/ITs-iotcon-query.c
src/itc/iotcon/ITs-iotcon-remote-resource.c
src/itc/iotcon/ITs-iotcon-representation.c
src/itc/iotcon/ITs-iotcon-request.c
src/itc/iotcon/ITs-iotcon-resource.c
src/itc/iotcon/ITs-iotcon-response.c
src/itc/iotcon/ITs-iotcon-state.c
src/itc/iotcon/ITs-iotcon.c
src/itc/iotcon/res/common/svr_db.dat [new file with mode: 0644]
src/itc/iotcon/tct-iotcon-native_tv.h
src/itc/iotcon/tct-iotcon-native_wearable.h

index 2abad78..e9bd49f 100755 (executable)
@@ -69,6 +69,8 @@ mkdir -p %{buildroot}/usr/share/packages/
 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
index 3bed913..87b87c7 100755 (executable)
@@ -53,7 +53,7 @@ char* IotConGetError(int nRet)
 
 int icitc_send_ok_response(iotcon_request_h request)
 {
-       
+
        int ret;
        iotcon_response_h response = NULL;
        iotcon_options_h options = NULL;
@@ -247,21 +247,21 @@ int IotconCreateLiteResource(void)
        //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);
@@ -269,10 +269,34 @@ int IotconCreateLiteResource(void)
                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;
+}
+
+
 /** @} */
index 0dca791..816036e 100755 (executable)
@@ -35,7 +35,7 @@
 #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
@@ -48,7 +48,7 @@
 #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
@@ -95,7 +95,7 @@ int icitc_send_ok_response(iotcon_request_h request);
                return 1;\
        }\
 }
-               
+
 #define RUN_POLLING_LOOP {\
        g_pMainLoop = g_main_loop_new(NULL, false);\
        nIotconTimeoutId = g_timeout_add(TIMEOUT_CB, TimeoutFunction, g_pMainLoop);\
@@ -134,5 +134,7 @@ char *IotConGetError(int nRet);
 gboolean IotConsCallbackTimeout(gpointer data);
 void IotconDestroyLiteResource(void);
 int IotconCreateLiteResource(void);
+int ic_get_svr_db_path(char **path);
+
 /** @} */
 #endif  //_ITS_IOTCON_COMMON_H_
index 4dbdd62..df4bc06 100755 (executable)
@@ -30,7 +30,7 @@ static void IotconGetDeviceInfoCB(iotcon_device_info_h info, iotcon_error_e resu
        {
                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
@@ -58,7 +58,7 @@ static void IotconGetPlatformInfoCB(iotcon_platform_info_h info,iotcon_error_e r
 #if DEBUG
        FPRINTF("[Line : %d][%s] IotconGetPlatformInfoCB callback called\\n", __LINE__, API_NAMESPACE);
 #endif
-       
+
        g_bCheckCb = true;
        if ( g_pMainLoop )
        {
@@ -84,7 +84,7 @@ static void IotconDeviceInfoGetPropertyCB(iotcon_device_info_h info, iotcon_erro
        g_bCheckCb = true;
 
        char *pszValue = NULL;
-       
+
        int nGetPropertyOption[] = {
                        IOTCON_DEVICE_INFO_NAME ,
                        IOTCON_DEVICE_INFO_SPEC_VER,
@@ -103,7 +103,7 @@ static void IotconDeviceInfoGetPropertyCB(iotcon_device_info_h info, iotcon_erro
                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);
@@ -169,21 +169,25 @@ int nGetPropertyOption[] = {
  * @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));
@@ -196,14 +200,14 @@ void ITs_iotcon_device_startup(void)
                }
                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;
 }
 
@@ -246,18 +250,18 @@ int ITc_iotcon_find_device_info_p(void)
        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;
 }
 
@@ -283,18 +287,18 @@ int ITc_iotcon_device_info_get_property_p(void)
        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;
 }
 
@@ -320,18 +324,18 @@ int ITc_iotcon_find_platform_info_p(void)
        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;
 }
 
@@ -357,18 +361,18 @@ int ITc_iotcon_platform_info_get_property_p(void)
        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;
 }
 
index d5de8cd..0db5cd7 100755 (executable)
@@ -38,9 +38,9 @@ bool IotconListIntCB(int pos, int value, void *user_data)
                ++ (*((int *)user_data));
 
        g_bCheckCb = true;
-               
+
        return IOTCON_FUNC_CONTINUE;
-       
+
 }
 
 /**
@@ -54,9 +54,9 @@ bool IotconListBoolCB(int pos, bool value, void *user_data)
        FPRINTF("[Line : %d][%s] Inside IotconListBoolCB callback\\n", __LINE__, API_NAMESPACE);
        if (user_data)
                ++ (*((int *)user_data));
-       
+
        g_bCheckCb = true;
-       
+
        return IOTCON_FUNC_CONTINUE;
 }
 
@@ -71,7 +71,7 @@ bool IotconListDoubleCB(int pos, const double value, void *user_data)
        FPRINTF("[Line : %d][%s] Inside IotconListDoubleCB callback\\n", __LINE__, API_NAMESPACE);
        if (user_data)
                ++ (*((int *)user_data));
-       
+
        g_bCheckCb = true;
        return IOTCON_FUNC_CONTINUE;
 }
@@ -87,15 +87,15 @@ bool IotconListStrCB(int pos, const char *value, void *user_data)
        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;
 }
 
@@ -110,13 +110,13 @@ bool IotconListListCB(int pos, iotcon_list_h value, void *user_data)
        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;
@@ -133,13 +133,13 @@ bool IotconListStateCB(int pos, iotcon_attributes_h value, void *user_data)
        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;
@@ -156,7 +156,7 @@ bool IotconListByteStrCB(int pos, const unsigned char *value, int len, void *use
        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);
@@ -164,7 +164,7 @@ bool IotconListByteStrCB(int pos, const unsigned char *value, int len, void *use
        }
 
        g_bCheckCb = true;
-               
+
        return IOTCON_FUNC_CONTINUE;
 }
 /**
@@ -176,17 +176,20 @@ bool IotconListByteStrCB(int pos, const unsigned char *value, int len, void *use
 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));
@@ -199,16 +202,16 @@ void ITs_iotcon_list_startup(void)
                }
                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();
@@ -222,9 +225,9 @@ void ITs_iotcon_list_startup(void)
                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);
@@ -253,17 +256,17 @@ void ITs_iotcon_list_startup(void)
  */
 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();
 }
@@ -294,10 +297,10 @@ void ITs_iotcon_list_cleanup(void)
 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]);
@@ -308,14 +311,14 @@ int ITc_iotcon_list_create_destroy_p(void)
                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;
 }
 
@@ -341,23 +344,23 @@ int ITc_iotcon_list_create_destroy_p(void)
 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)
@@ -384,13 +387,13 @@ int ITc_iotcon_list_add_get_nth_int_p(void)
                iotcon_list_destroy(hList);
                return 1;
        }
-       
+
        if(hList)
        {
                iotcon_list_destroy(hList);
-               hList = NULL;                   
+               hList = NULL;
        }
-       
+
     return 0;
 }
 
@@ -415,19 +418,19 @@ int ITc_iotcon_list_add_get_nth_int_p(void)
 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));;
 
@@ -461,13 +464,13 @@ int ITc_iotcon_list_add_get_nth_bool_p(void)
                iotcon_list_destroy(hList);
                return 1;
        }
-               
+
        if(hList)
        {
                iotcon_list_destroy(hList);
-               hList = NULL;                   
+               hList = NULL;
        }
-       
+
     return 0;
 }
 
@@ -493,24 +496,24 @@ int ITc_iotcon_list_add_get_nth_bool_p(void)
 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)
@@ -537,13 +540,13 @@ int ITc_iotcon_list_add_get_nth_double_p(void)
                iotcon_list_destroy(hList);
                return 1;
        }
-       
+
        if(hList)
        {
                iotcon_list_destroy(hList);
-               hList = NULL;                   
+               hList = NULL;
        }
-       
+
     return 0;
 }
 
@@ -569,25 +572,25 @@ int ITc_iotcon_list_add_get_nth_double_p(void)
 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 )
@@ -614,13 +617,13 @@ int ITc_iotcon_list_add_get_nth_str_p(void)
                iotcon_list_destroy(hList);
                return 1;
        }
-       
+
        if(hList)
        {
                iotcon_list_destroy(hList);
-               hList = NULL;                   
+               hList = NULL;
        }
-       
+
     return 0;
 }
 
@@ -646,51 +649,51 @@ int ITc_iotcon_list_add_get_nth_str_p(void)
 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;
 }
 
@@ -716,7 +719,7 @@ int ITc_iotcon_list_add_get_nth_list_p(void)
 int ITc_iotcon_list_add_get_nth_attributes_p(void)
 {
        START_TEST;
-       
+
        iotcon_attributes_h hState = NULL;
        iotcon_list_h hList = NULL;
 
@@ -730,26 +733,26 @@ int ITc_iotcon_list_add_get_nth_attributes_p(void)
 
        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;
 }
 
@@ -783,7 +786,7 @@ int ITc_iotcon_list_remove_nth_p(void)
     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));
@@ -796,7 +799,7 @@ int ITc_iotcon_list_remove_nth_p(void)
     if(hList)
     {
         iotcon_list_destroy(hList);
-        hList = NULL;            
+        hList = NULL;
     }
 
     return 0;
@@ -824,10 +827,10 @@ int ITc_iotcon_list_remove_nth_p(void)
 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");
@@ -835,11 +838,11 @@ int ITc_iotcon_list_get_type_p(void)
        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;
@@ -867,20 +870,20 @@ int ITc_iotcon_list_get_type_p(void)
 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));
 
@@ -892,11 +895,11 @@ int ITc_iotcon_list_get_length_p(void)
                iotcon_list_destroy(hList);
                return 1;
        }
-               
+
        if(hList)
        {
                iotcon_list_destroy(hList);
-               hList = NULL;                   
+               hList = NULL;
        }
 
     return 0;
@@ -924,12 +927,12 @@ int ITc_iotcon_list_get_length_p(void)
 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");
@@ -945,27 +948,27 @@ int ITc_iotcon_list_foreach_int_p(void)
 
        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;
 }
 
@@ -991,20 +994,20 @@ int ITc_iotcon_list_foreach_int_p(void)
 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));
 
@@ -1013,27 +1016,27 @@ int ITc_iotcon_list_foreach_bool_p(void)
 
        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;
 }
 
@@ -1059,47 +1062,47 @@ int ITc_iotcon_list_foreach_bool_p(void)
 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;
@@ -1127,19 +1130,19 @@ int ITc_iotcon_list_foreach_double_p(void)
 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));
 
@@ -1148,27 +1151,27 @@ int ITc_iotcon_list_foreach_str_p(void)
 
        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;
 }
 
@@ -1194,24 +1197,24 @@ int ITc_iotcon_list_foreach_str_p(void)
 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));
 
@@ -1220,8 +1223,8 @@ int ITc_iotcon_list_foreach_list_p(void)
 
        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 );
@@ -1230,29 +1233,29 @@ int ITc_iotcon_list_foreach_list_p(void)
                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;
 }
 
@@ -1278,13 +1281,13 @@ int ITc_iotcon_list_foreach_list_p(void)
 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");
@@ -1305,9 +1308,9 @@ int ITc_iotcon_list_foreach_attributes_p(void)
 
        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 );
@@ -1316,31 +1319,31 @@ int ITc_iotcon_list_foreach_attributes_p(void)
                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;
 }
 
@@ -1369,18 +1372,18 @@ int ITc_iotcon_list_add_byte_str_p(void)
        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;
-       
+
 }
 
 
@@ -1411,25 +1414,25 @@ int ITc_iotcon_list_get_nth_byte_str_p(void)
        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;
@@ -1462,14 +1465,14 @@ int ITc_iotcon_list_foreach_byte_str_p(void)
        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));
@@ -1481,7 +1484,7 @@ int ITc_iotcon_list_foreach_byte_str_p(void)
                hList = NULL;
                return 1;
        }
-       
+
        iotcon_list_destroy(hList);
        hList = NULL;
        return 0;
@@ -1489,4 +1492,4 @@ int ITc_iotcon_list_foreach_byte_str_p(void)
 
 
 /** @} */
-/** @} */
\ No newline at end of file
+/** @} */
index 4c3efae..cfb3847 100755 (executable)
 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));
@@ -56,14 +60,14 @@ void ITs_iotcon_lite_resource_startup(void)
                }
                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;
 }
 
@@ -110,7 +114,7 @@ void ITs_iotcon_lite_resource_cleanup(void)
 int ITc_iotcon_lite_resource_create_destroy_p(void)
 {
        IotconCreateLiteResource();
-       
+
        if (g_hLiteLightResource)
        {
                int nRet = iotcon_lite_resource_destroy(g_hLiteLightResource);
@@ -135,7 +139,7 @@ int ITc_iotcon_lite_resource_create_destroy_p(void)
 * @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
@@ -157,7 +161,7 @@ int ITc_iotcon_lite_resource_update_attributes_p(void)
                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));
 
@@ -209,4 +213,4 @@ int ITc_iotcon_lite_resource_get_attributes_p(void)
 }
 
 /** @} */
-/** @} */
\ No newline at end of file
+/** @} */
index adaccc7..f52514b 100755 (executable)
@@ -33,17 +33,21 @@ iotcon_observers_h g_hIotconObservers = NULL;
 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));
@@ -56,23 +60,23 @@ void ITs_iotcon_observers_startup(void)
                }
                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);
@@ -97,11 +101,11 @@ void ITs_iotcon_observers_cleanup(void)
        {
                iotcon_observers_destroy(g_hIotconObservers);
        }
-       
+
        if( g_bIotconConnect )
        {
                iotcon_deinitialize();
-       }       
+       }
        return;
 }
 
@@ -125,20 +129,20 @@ void ITs_iotcon_observers_cleanup(void)
 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
@@ -163,11 +167,11 @@ int ITc_iotcon_observers_add_remove_p(void)
        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
+/** @} */
index dd4fbbe..259e98e 100755 (executable)
@@ -34,15 +34,15 @@ static bool IotconOptionsForeachCB(unsigned short id, const char *data, void *us
        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;
 }
 
@@ -56,17 +56,21 @@ static bool IotconOptionsForeachCB(unsigned short id, const char *data, void *us
 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));
@@ -79,16 +83,16 @@ void ITs_iotcon_options_startup(void)
                }
                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();
@@ -113,7 +117,7 @@ void ITs_iotcon_options_startup(void)
  */
 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
@@ -123,7 +127,7 @@ void ITs_iotcon_options_cleanup(void)
 
        if ( g_bIotconConnect )
                iotcon_deinitialize();
-               
+
        return;
 }
 
@@ -153,16 +157,16 @@ void ITs_iotcon_options_cleanup(void)
 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;
 }
 
@@ -187,10 +191,10 @@ int ITc_iotcon_options_create_destroy_p(void)
 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));
 
@@ -217,7 +221,7 @@ int ITc_iotcon_options_add_remove_p(void)
 int ITc_iotcon_options_lookup_p(void)
 {
        START_TEST;
-       
+
        char *pszGetData;
 
        int nRet = iotcon_options_add(g_hOptions, ICL_OPTIONID_MIN, VALUE);
@@ -225,17 +229,17 @@ int ITc_iotcon_options_lookup_p(void)
 
        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;
 }
 
@@ -259,45 +263,45 @@ int ITc_iotcon_options_lookup_p(void)
 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
index 48bc858..a21bd75 100755 (executable)
@@ -326,13 +326,17 @@ static int CreateAndFindResource(int tc_index)
  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) )
        {
index a1c940f..ee60a27 100755 (executable)
@@ -291,13 +291,17 @@ static int CreateAndFindResource(int tc_index)
 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) )
        {
index 0e19079..d39341b 100755 (executable)
@@ -33,17 +33,21 @@ bool g_bIotconQueryForeachCompletedCallback;
 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));
@@ -56,16 +60,16 @@ void ITs_iotcon_query_startup(void)
                }
                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();
@@ -109,17 +113,17 @@ void ITs_iotcon_query_cleanup(void)
 *  @{
 */
 
-//& 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
@@ -128,7 +132,7 @@ void ITs_iotcon_query_cleanup(void)
 int ITc_iotcon_query_create_destroy_p(void)
 {
        START_TEST;
-       
+
        iotcon_query_h hQuery = NULL;
        //target api
        int nRet = iotcon_query_create(&hQuery);
@@ -136,20 +140,20 @@ int ITc_iotcon_query_create_destroy_p(void)
        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
@@ -160,10 +164,10 @@ int ITc_iotcon_query_create_destroy_p(void)
 /*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)
@@ -171,42 +175,42 @@ int ITc_iotcon_query_create_destroy_p(void)
                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
@@ -215,9 +219,9 @@ int ITc_iotcon_query_create_destroy_p(void)
 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));
@@ -233,8 +237,8 @@ int ITc_iotcon_query_set_get_interface_p(void)
 
        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
@@ -243,7 +247,7 @@ int ITc_iotcon_query_set_get_interface_p(void)
 * @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
@@ -260,8 +264,8 @@ int ITc_iotcon_query_add_remove_p(void)
        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
@@ -270,7 +274,7 @@ int ITc_iotcon_query_add_remove_p(void)
 * @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
@@ -282,7 +286,7 @@ int ITc_iotcon_query_lookup_p(void)
        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));
@@ -293,17 +297,17 @@ int ITc_iotcon_query_lookup_p(void)
            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;
 }
 /**
@@ -311,7 +315,7 @@ int ITc_iotcon_query_lookup_p(void)
 * @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)
@@ -327,11 +331,11 @@ static bool IotconQueryForeachCB(const char *key, const char *value,void *user_d
        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
@@ -340,7 +344,7 @@ static bool IotconQueryForeachCB(const char *key, const char *value,void *user_d
 * @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
@@ -349,23 +353,23 @@ static bool IotconQueryForeachCB(const char *key, const char *value,void *user_d
 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);
@@ -377,21 +381,21 @@ int ITc_iotcon_query_foreach_p(void)
                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;
 }
 
index 55d4646..df738ff 100755 (executable)
@@ -1014,13 +1014,17 @@ static void IotconRemoteResourceObserveCB(iotcon_remote_resource_h resource, iot
 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) )
        {
@@ -1826,10 +1830,10 @@ int ITc_iotcon_remote_resource_set_get_time_interval_p(void)
 */
 int ITc_remote_resource_get_device_name_p(void)
 {
-       
+
        char *pszDeviceName =NULL;
        int nIotconTimeoutId = 0;
-       
+
        g_bCheckCb = false;
 
     int nRet = IotconCreateLiteResource();
@@ -1848,7 +1852,7 @@ int ITc_remote_resource_get_device_name_p(void)
                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));
@@ -1858,12 +1862,12 @@ int ITc_remote_resource_get_device_name_p(void)
                iotcon_remote_resource_destroy(g_hResourceHandle);
                IotconDestroyLiteResource();
                return 1;
-               
+
        }
        iotcon_remote_resource_destroy(g_hResourceHandle);
        IotconDestroyLiteResource();
 
-       
+
        return 0;
 }
 
index 4585abf..746b299 100755 (executable)
@@ -36,17 +36,21 @@ iotcon_representation_h g_hRepresentation = NULL;
 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));
@@ -59,7 +63,7 @@ void ITs_iotcon_representation_startup(void)
                }
                return;
        }
-       
+
        if ( nRet != IOTCON_ERROR_NONE )
        {
                FPRINTF("[Line : %d][%s] iotcon_initialize failed API return %s error \\n", __LINE__, API_NAMESPACE, IotConGetError(nRet));
@@ -68,21 +72,21 @@ void ITs_iotcon_representation_startup(void)
        }
 
        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;
 }
@@ -130,11 +134,11 @@ void ITs_iotcon_representation_cleanup(void)
 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;
 }
@@ -156,15 +160,15 @@ int ITc_iotcon_representation_create_destroy_p(void)
 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;
 }
 
@@ -188,12 +192,12 @@ int ITc_iotcon_representation_set_get_uri_path_p(void)
        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;
@@ -224,20 +228,20 @@ int ITc_iotcon_representation_set_get_resource_types_p(void)
        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)
        {
@@ -247,7 +251,7 @@ int ITc_iotcon_representation_set_get_resource_types_p(void)
        }
 
        iotcon_resource_types_destroy(hTypes);
-               
+
     return 0;
 }
 /**
@@ -267,15 +271,15 @@ int ITc_iotcon_representation_set_get_resource_types_p(void)
 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));
 
@@ -284,7 +288,7 @@ int ITc_iotcon_representation_set_get_resource_interfaces_p(void)
 
        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);
@@ -333,7 +337,7 @@ int ITc_iotcon_representation_set_get_attributes_p(void)
        {
                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)
        {
@@ -341,7 +345,7 @@ int ITc_iotcon_representation_set_get_attributes_p(void)
                iotcon_attributes_destroy(hSetAttributes);
         return 1;
        }
-       
+
        iotcon_attributes_destroy(hSetAttributes);
     return 0;
 }
@@ -362,14 +366,14 @@ int ITc_iotcon_representation_set_get_attributes_p(void)
 */
 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));
 
@@ -384,7 +388,7 @@ int ITc_iotcon_representation_add_remove_child_p(void)
 * @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.
 */
 
@@ -397,7 +401,7 @@ static bool IotconForeachChildrenCB(iotcon_representation_h child, void *user_da
                FPRINTF("[Line : %d][%s] IotconForeachChildrenCB input resource is NULL failed !!!\\n", __LINE__, API_NAMESPACE);
        }
        g_bCheckCb = true;
-       
+
        return IOTCON_FUNC_CONTINUE;
 }
 /**
@@ -416,15 +420,15 @@ static bool IotconForeachChildrenCB(iotcon_representation_h child, void *user_da
 */
 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");
@@ -435,9 +439,9 @@ int ITc_iotcon_representation_foreach_children_p(void)
        {
                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 )
@@ -445,21 +449,21 @@ int ITc_iotcon_representation_foreach_children_p(void)
                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);
@@ -491,7 +495,7 @@ int ITc_iotcon_representation_foreach_children_p(void)
 */
 int ITc_iotcon_representation_get_child_count_p(void)
 {
-       START_TEST;     
+       START_TEST;
        int ret;
        unsigned int count = 0;
        iotcon_representation_h hRepr1 = NULL;
@@ -501,14 +505,14 @@ int ITc_iotcon_representation_get_child_count_p(void)
        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);
@@ -518,7 +522,7 @@ int ITc_iotcon_representation_get_child_count_p(void)
                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);
@@ -526,10 +530,10 @@ int ITc_iotcon_representation_get_child_count_p(void)
 
        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);
@@ -552,7 +556,7 @@ int ITc_iotcon_representation_get_child_count_p(void)
 * @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.
@@ -560,19 +564,19 @@ int ITc_iotcon_representation_get_child_count_p(void)
 * @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));
@@ -580,22 +584,22 @@ int ITc_iotcon_representation_get_nth_child_p(void)
                {
                        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;
 }
index 3eee218..4c252a3 100755 (executable)
@@ -463,13 +463,17 @@ static int CreateAndFindResource(int tc_index)
 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) )
        {
index b3e44da..786265d 100755 (executable)
@@ -570,33 +570,33 @@ static void RequestHandlerCB(iotcon_resource_h resource, iotcon_request_h reques
        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);
@@ -1147,13 +1147,17 @@ bool IotconCreateLedResource(void)
 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) )
        {
@@ -1641,7 +1645,7 @@ int ITc_iotcon_resource_get_policies_p(void)
        }
        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;
index 67af9a3..756fcf9 100755 (executable)
@@ -267,9 +267,9 @@ int CreateResourceTypes(const char *type, iotcon_resource_types_h *types_h)
 
 /**
 * @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)
 {
@@ -280,111 +280,111 @@ 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;
@@ -488,13 +488,17 @@ int CreateRepresentation(iotcon_representation_h *representation)
 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) )
        {
@@ -680,10 +684,10 @@ int ITc_iotcon_response_set_get_representation_p(void)
        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");
@@ -790,9 +794,9 @@ int ITc_iotcon_response_send_p(void)
        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);
index ac0f351..08342c1 100755 (executable)
@@ -34,7 +34,7 @@ static iotcon_representation_h g_hRepr;
 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);
@@ -53,13 +53,17 @@ bool IotconStateCB(iotcon_attributes_h hAttributes, const char *key, void *user_
 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) )
        {
@@ -83,7 +87,7 @@ void ITs_iotcon_attributes_startup(void)
                g_bIotconConnect = false;
                return;
        }
-               
+
        nRet = iotcon_attributes_create(&g_hAttributes);
        if (IOTCON_ERROR_NONE != nRet)
        {
@@ -137,8 +141,8 @@ void ITs_iotcon_attributes_cleanup(void)
 
        if(g_hRepr)
                iotcon_representation_destroy(g_hRepr);
-       
-       if (g_hAttributes) 
+
+       if (g_hAttributes)
                iotcon_attributes_destroy(g_hAttributes);
 
        if (g_bIotconConnect)
@@ -173,7 +177,7 @@ void ITs_iotcon_attributes_cleanup(void)
 int ITc_iotcon_attributes_create_destroy_p(void)
 {
        START_TEST;
-               
+
        iotcon_attributes_h hState = NULL;
 
        int nRet = iotcon_attributes_create(&hState);
@@ -182,7 +186,7 @@ int ITc_iotcon_attributes_create_destroy_p(void)
 
        iotcon_attributes_destroy(hState);
        hState = NULL;
-               
+
     return 0;
 }
 
@@ -205,7 +209,7 @@ int ITc_iotcon_attributes_create_destroy_p(void)
 int ITc_iotcon_attributes_clone_p(void)
 {
        START_TEST;
-               
+
        iotcon_attributes_h hState = NULL;
 
        int nRet = iotcon_attributes_clone(g_hAttributes, &hState);
@@ -241,7 +245,7 @@ int ITc_iotcon_attributes_add_get_int_p(void)
 
        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));
 
@@ -291,10 +295,10 @@ int ITc_iotcon_attributes_add_get_bool_p(void)
                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;
 }
 
@@ -332,10 +336,10 @@ int ITc_iotcon_attributes_add_get_double_p(void)
                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;
 }
 
@@ -375,7 +379,7 @@ int ITc_iotcon_attributes_add_get_str_p(void)
 
        nRet = iotcon_attributes_remove(g_hAttributes, KEY);
        PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_remove", IotConGetError(nRet));
-       
+
        return 0;
 
 }
@@ -407,17 +411,17 @@ int ITc_iotcon_attributes_add_get_list_p(void)
        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);
@@ -448,22 +452,22 @@ int ITc_iotcon_attributes_add_get_list_p(void)
 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));
 
@@ -502,7 +506,7 @@ int ITc_iotcon_attributes_add_is_null_p(void)
                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));
 
@@ -520,7 +524,7 @@ int ITc_iotcon_attributes_add_is_null_p(void)
 * @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
@@ -534,7 +538,7 @@ int ITc_iotcon_attributes_remove_p(void)
        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));
 
@@ -564,7 +568,7 @@ int ITc_iotcon_attributes_remove_p(void)
 
        nRet = iotcon_attributes_remove(g_hAttributes, KEY);
        PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_attributes_remove", IotConGetError(nRet));
-       
+
        return 0;
 }
 
@@ -599,13 +603,13 @@ int ITc_iotcon_attributes_get_type_p(void)
 
        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));
 
@@ -633,10 +637,10 @@ int ITc_iotcon_attributes_get_type_p(void)
 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");
@@ -644,7 +648,7 @@ int ITc_iotcon_attributes_foreach_p(void)
        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));
 
@@ -661,16 +665,16 @@ int ITc_iotcon_attributes_foreach_p(void)
                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;
 }
 
@@ -722,16 +726,16 @@ int ITc_iotcon_attributes_get_keys_count_p(void)
                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;
 }
 
index 6cd1461..fab67d3 100755 (executable)
@@ -34,23 +34,26 @@ bool g_bCallbackHit = false;
 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
                {
@@ -59,7 +62,7 @@ void ITs_iotcon_startup(void)
                }
                return;
        }
-       
+
        if ( nRet != IOTCON_ERROR_NONE )
        {
                FPRINTF("[Line : %d][%s] iotcon_initialize failed API return %s error \\n", __LINE__, API_NAMESPACE, IotConGetError(nRet));
@@ -112,19 +115,22 @@ void ITs_iotcon_cleanup(void)
 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;
 }
 
@@ -148,21 +154,21 @@ int ITc_iotcon_initialize_deinitialize_p(void)
 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
@@ -173,23 +179,23 @@ int ITc_iotcon_set_get_timeout_p(void)
 * @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
@@ -201,7 +207,7 @@ int ITc_iotcon_set_device_name_p(void)
 * @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
@@ -216,13 +222,13 @@ int ITc_iotcon_set_get_polling_interval_p(void)
        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);
diff --git a/src/itc/iotcon/res/common/svr_db.dat b/src/itc/iotcon/res/common/svr_db.dat
new file mode 100644 (file)
index 0000000..80088b2
Binary files /dev/null and b/src/itc/iotcon/res/common/svr_db.dat differ
index dd957f5..d56b53a 100755 (executable)
@@ -240,7 +240,7 @@ testcase tc_array[] = {
     {"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},
@@ -299,7 +299,7 @@ testcase tc_array[] = {
     {"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}
 };
index dd957f5..d56b53a 100755 (executable)
@@ -240,7 +240,7 @@ testcase tc_array[] = {
     {"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},
@@ -299,7 +299,7 @@ testcase tc_array[] = {
     {"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}
 };