[CTC][SVACE-Fix][Non-ACR][Fixed SVACE defects for CTC modules]
authorABHISHEK JAIN <j.abhishek@samsung.com>
Wed, 21 Feb 2018 07:03:01 +0000 (12:33 +0530)
committerAmritanshu Pandia <a.pandia1@samsung.com>
Thu, 22 Feb 2018 05:16:05 +0000 (05:16 +0000)
Signed-off-by: ABHISHEK JAIN <j.abhishek@samsung.com>
Change-Id: I1950c47c37d2f4d5d4e5d042ce47c168199767f2

78 files changed:
src/ctc/audio-io/CTs-audio-io.c
src/ctc/camera/CTs-camera.c
src/ctc/connection/CTs-connection.c
src/ctc/device/CTs-device.c
src/ctc/filesystem-permission/CTs-filesystem-permission-common.c
src/ctc/filesystem-permission/CTs-filesystem-permission.c
src/ctc/image-util/CTs-image-util-common.c
src/ctc/image-util/CTs-image-util.c
src/ctc/libstorage/CTs-libstorage-common.c
src/ctc/libstorage/CTs-libstorage.c
src/ctc/location-manager/CTs-location-manager.c
src/ctc/mediacodec/CTs-mediacodec.c
src/ctc/opengl/CTs-opengl.c
src/ctc/platform-permission/CTs-platform-permission-accountsvc.c
src/ctc/platform-permission/CTs-platform-permission-app-manager.c
src/ctc/platform-permission/CTs-platform-permission-application.c
src/ctc/platform-permission/CTs-platform-permission-attach-panel.c
src/ctc/platform-permission/CTs-platform-permission-audio-io.c
src/ctc/platform-permission/CTs-platform-permission-badge.c
src/ctc/platform-permission/CTs-platform-permission-bluetooth.c
src/ctc/platform-permission/CTs-platform-permission-calendar-service.c
src/ctc/platform-permission/CTs-platform-permission-camera.c
src/ctc/platform-permission/CTs-platform-permission-common.c
src/ctc/platform-permission/CTs-platform-permission-connection.c
src/ctc/platform-permission/CTs-platform-permission-contacts-service.c
src/ctc/platform-permission/CTs-platform-permission-context.c
src/ctc/platform-permission/CTs-platform-permission-datacontrol.c
src/ctc/platform-permission/CTs-platform-permission-device.c
src/ctc/platform-permission/CTs-platform-permission-efl-util.c
src/ctc/platform-permission/CTs-platform-permission-email.c
src/ctc/platform-permission/CTs-platform-permission-http.c
src/ctc/platform-permission/CTs-platform-permission-ime.c
src/ctc/platform-permission/CTs-platform-permission-inputmethod-manager.c
src/ctc/platform-permission/CTs-platform-permission-iotcon.c
src/ctc/platform-permission/CTs-platform-permission-libfeedback.c
src/ctc/platform-permission/CTs-platform-permission-location-manager.c
src/ctc/platform-permission/CTs-platform-permission-maps-service.c
src/ctc/platform-permission/CTs-platform-permission-media-content.c
src/ctc/platform-permission/CTs-platform-permission-media-controller.c
src/ctc/platform-permission/CTs-platform-permission-media-streamer.c
src/ctc/platform-permission/CTs-platform-permission-messages.c
src/ctc/platform-permission/CTs-platform-permission-nfc.c
src/ctc/platform-permission/CTs-platform-permission-notification.c
src/ctc/platform-permission/CTs-platform-permission-oauth2-manager.c
src/ctc/platform-permission/CTs-platform-permission-package-manager.c
src/ctc/platform-permission/CTs-platform-permission-phonenumber-utils.c
src/ctc/platform-permission/CTs-platform-permission-recorder.c
src/ctc/platform-permission/CTs-platform-permission-runtime-info.c
src/ctc/platform-permission/CTs-platform-permission-sensor.c
src/ctc/platform-permission/CTs-platform-permission-service-adaptor-client.c
src/ctc/platform-permission/CTs-platform-permission-shortcut.c
src/ctc/platform-permission/CTs-platform-permission-smartcard.c
src/ctc/platform-permission/CTs-platform-permission-sound-manager.c
src/ctc/platform-permission/CTs-platform-permission-sppc.c
src/ctc/platform-permission/CTs-platform-permission-stt.c
src/ctc/platform-permission/CTs-platform-permission-sync-manager.c
src/ctc/platform-permission/CTs-platform-permission-telephony.c
src/ctc/platform-permission/CTs-platform-permission-thumbnail-util.c
src/ctc/platform-permission/CTs-platform-permission-url-download.c
src/ctc/platform-permission/CTs-platform-permission-voice-control.c
src/ctc/platform-permission/CTs-platform-permission-vpn-service.c
src/ctc/platform-permission/CTs-platform-permission-widget-service.c
src/ctc/platform-permission/CTs-platform-permission-widget-viewer.c
src/ctc/platform-permission/CTs-platform-permission-wifi-direct.c
src/ctc/platform-permission/CTs-platform-permission-wifi-manager.c
src/ctc/platform-permission/CTs-platform-permission-wifi.c
src/ctc/player/CTs-player-common.c
src/ctc/player/CTs-player.c
src/ctc/runtime-info/CTs-runtime-info.c
src/ctc/sensor/CTs-sensor.c
src/ctc/sound-manager/CTs-sound-manager.c
src/ctc/system-info/CTs-system-info.c
src/ctc/telephony/CTs-telephony.c
src/ctc/video-util/CTs-video-util.c
src/ctc/vulkan/CTs-vulkan-draw.c
src/ctc/vulkan/CTs-vulkan-instance.c
src/ctc/vulkan/tct-vulkan-native.c
src/ctc/wifi-direct/CTs-wifi-direct.c

index 972df73..f15472d 100755 (executable)
@@ -33,7 +33,10 @@ void CTs_audio_io_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index 3424bb2..498d03d 100755 (executable)
@@ -35,7 +35,11 @@ void CTs_camera_startup(void)
        struct stat stBuff;   
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
+
        }
 
 #if DEBUG
index 2098e83..d337b7a 100755 (executable)
@@ -33,7 +33,10 @@ void CTs_connection_startup(void)
        struct stat stBuff;   
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index 2310164..34bde2f 100755 (executable)
@@ -33,7 +33,10 @@ void CTs_device_startup(void)
        struct stat stBuff;   
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index c8acc42..662976b 100755 (executable)
@@ -68,8 +68,8 @@ bool FilePermissionCreateFile(int nStorageID, storage_directory_e eStorageDirect
                return  false;
        }
        
-       strcpy(pszPath, pszFilePath);
-       strcat(pszPath, "/newFile.txt");
+       strncpy(pszPath, pszFilePath, strlen(pszFilePath)+1);
+       strncat(pszPath, "/newFile.txt", strlen("/newFile.txt")+1);
 
        pFile = fopen(pszPath, "w+");
        if ( pFile == NULL )
@@ -161,7 +161,7 @@ bool FilePermissionCreateDirectory(int nStorageID, storage_directory_e eStorageD
                return  false;
        }
        
-       strcpy(pszPath, pszFilePath);
+       strncpy(pszPath, pszFilePath, strlen(pszFilePath)+1);
 
        if ( IsPathValid(pszFilePath) == false )
        {
@@ -178,8 +178,13 @@ bool FilePermissionCreateDirectory(int nStorageID, storage_directory_e eStorageD
                return false;
        }
 
-       strcat(pszPath, "/testFolder");
+       strncat(pszPath, "/testFolder", strlen("/testFolder")+1);
+
        nRet = mkdir(pszPath, 0777);
+       if ( nRet != 0 )
+       {
+               FPRINTF("[Line : %d][%s] Directory creation is failed in %s\\n", __LINE__, API_NAMESPACE, pszPath);
+       }
 
        nRet = rmdir(pszPath);
        if ( nRet != 0 )
index dd7cb13..021b032 100755 (executable)
@@ -48,7 +48,10 @@ void CTs_filesystem_permission_startup(void)
        struct stat stBuff;   
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
        storage_foreach_device_supported(get_storage, NULL);
index 65c1235..66db028 100755 (executable)
@@ -138,7 +138,7 @@ char* ImageUtilGetDataPath(char *pszFileName)
        }
        
        pszImgPath = (char*) calloc(1, strlen(pszAppData) + strlen(pszFileName)+1);
-       sprintf(pszImgPath, "%s%s",pszAppData, pszFileName );
+       snprintf(pszImgPath, strlen(pszAppData) + strlen(pszFileName)+2, "%s%s",pszAppData, pszFileName);
        return pszImgPath;
 }
 
index b34aec6..7ebc49f 100755 (executable)
@@ -34,7 +34,10 @@ void CTs_image_util_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index 8cdf941..2e3613f 100755 (executable)
@@ -130,8 +130,8 @@ char* StorageGetError(int nResult)
 */
 void AppendFileName(char *pszDirPath, char *pszTragetPath)
 {
-       strcpy(pszTragetPath, pszDirPath);
-       strcat(pszTragetPath, "/newFile.txt");
+       strncpy(pszTragetPath, pszDirPath, strlen(pszDirPath)+1);
+       strncat(pszTragetPath, "/newFile.txt", strlen("/newFile.txt")+1);
        FPRINTF("[Line : %d][%s] File path : %s\\n", __LINE__, API_NAMESPACE, pszTragetPath);
 }
 
@@ -166,4 +166,4 @@ bool IsPathValid(char *pszPath)
        return false;
 }
 
-/** @} */ //end of ctc-libstorage
\ No newline at end of file
+/** @} */ //end of ctc-libstorage
index 84172cd..ee31938 100755 (executable)
@@ -33,7 +33,10 @@ void CTs_libstorage_startup(void)
        struct stat stBuff;   
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index f5b2796..7d2484c 100755 (executable)
@@ -33,7 +33,10 @@ void CTs_location_manager_startup(void)
        struct stat stBuff;   
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index 00ccdae..25160b2 100755 (executable)
@@ -36,7 +36,11 @@ void CTs_media_codec_startup(void)
        mediacodec_h stMediacodec = NULL;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
+
        }
 #if DEBUG
        FPRINTF("[Line : %d][%s] TEST SUIT start-up: CTs_Media_Codec_p\\n", __LINE__, API_NAMESPACE);
index e87bc2e..65a9937 100755 (executable)
@@ -34,7 +34,10 @@ void CTs_opengl_startup(void)
        g_elm_init = false;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index 08373a9..b42ca4c 100755 (executable)
@@ -96,11 +96,11 @@ static bool ServiceProviderFeatureCB(char* app_id, char* key, void* user_data)
        g_nPackageIdCB = 1;
        if ( app_id != NULL )
        {
-               strcpy(g_szAppID, app_id);
+               strncpy(g_szAppID, app_id, strlen(app_id)+1);
        }
        if ( key != NULL )
        {
-               strcpy(g_szProviderFeatureArr[g_nProviderCount++], key);
+               strncpy(g_szProviderFeatureArr[g_nProviderCount++], key, strlen(key)+1);
        }
 
        if(user_data != NULL)
@@ -156,15 +156,15 @@ static bool AccountLabelCB(char* app_id, char* label, char* locale, void *user_d
 #endif
        if ( app_id != NULL )
        {
-               strcpy(g_szAppID, app_id);
+               strncpy(g_szAppID, app_id, strlen(app_id)+1);
        }
        if ( locale != NULL )
        {
-               strcpy(g_szLocale, locale);
+               strncpy(g_szLocale, locale, strlen(locale)+1);
        }
        if ( label != NULL )
        {
-               strcpy(g_szLabel, label);
+               strncpy(g_szLabel, label, strlen(label)+1);
        }
 
        if ( mainloop )
@@ -290,15 +290,25 @@ static bool AccountTypeCallback(account_type_h account_type, void *user_data)
        char *pszGetAppId = NULL;
        account_type_get_app_id(account_type, &pszGetAppId);
        
-       if ( strcmp(g_pstrAppId, pszGetAppId)== 0 )
+       if ( pszGetAppId == NULL )
+       {
+               if ( mainloop )
+               {
+                       g_main_loop_quit(mainloop);
+               }
+               return false;
+       }
+
+       if ( strncmp(g_pstrAppId, pszGetAppId, strlen(pszGetAppId))== 0 )
        {
                g_bAccountTypeCB = true;
        }
+
        if ( pszGetAppId != NULL )
        {
-               free(pszGetAppId);
-               pszGetAppId = NULL;
+               FREE_MEMORY(pszGetAppId);
        }
+
 #if DEBUG
        FPRINTF("[Line : %d][%s] reached AccountTypeCallback callback\\n", __LINE__, API_NAMESPACE);
 #endif
@@ -369,11 +379,15 @@ void CTs_platform_permission_accountsvc_startup(void)
                return;
        }
        memset(g_pstrAppId, 0, sizeof(g_pstrAppId));
-       strcpy(g_pstrAppId, APPID);
+       strncpy(g_pstrAppId, APPID, strlen(APPID)+1);
+
        g_bAccountCreation = true;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index 36fa3e4..c6d7462 100755 (executable)
@@ -90,7 +90,10 @@ void CTs_platform_permission_appmanager_startup(void)
     struct stat stBuff;
     if ( stat(ERR_LOG, &stBuff) == 0 )
     {
-        remove(ERR_LOG);
+       if (remove(ERR_LOG))
+       {
+               FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+       }
     }
 
 #if DEBUG
index cd95209..6d27e8e 100755 (executable)
@@ -140,7 +140,10 @@ void CTs_platform_permission_Application_startup(void)
     struct stat stBuff;
     if ( stat(ERR_LOG, &stBuff) == 0 )
     {
-        remove(ERR_LOG);
+       if (remove(ERR_LOG))
+       {
+               FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+       }
     }
 
 #if DEBUG
index de7d659..22e4cee 100755 (executable)
@@ -74,7 +74,10 @@ void CTs_platform_permission_Attach_Panel_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
        s_info.win = elm_win_add(NULL, "Attach Panel Sample", ELM_WIN_BASIC);
        if (!s_info.win) {
index 11914a3..6dcb9ae 100755 (executable)
@@ -76,7 +76,10 @@ void CTs_platform_permission_audioio_startup(void)
     struct stat stBuff;
     if ( stat(ERR_LOG, &stBuff) == 0 )
     {
-        remove(ERR_LOG);
+       if (remove(ERR_LOG))
+       {
+               FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+       }
     }
 
 #if DEBUG
index daa4242..b554bdc 100755 (executable)
@@ -29,7 +29,10 @@ void CTs_platform_permission_badge_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
@@ -135,7 +138,7 @@ int CTc_Badge_PrivilegeNotification_new(void)
                FPRINTF("[Line : %d][%s] memory allocation of pszImgPath failed \\n", __LINE__, API_NAMESPACE);
                return 1;
        }
-       sprintf(pszImgPath, "%s%s",pszAppData, BADGE_PACKAGE);
+       snprintf(pszImgPath, "%s%s",pszAppData, BADGE_PACKAGE, strlen(pszAppData) + strlen(BADGE_PACKAGE));
        FREE_MEMORY(pszAppData);
 
        
index 0128d5b..d855b47 100755 (executable)
@@ -105,7 +105,7 @@ bool BluetoothGetStorageDownloadsPath(char *pszPath)
        else
        {
                FPRINTF("[Line : %d][%s] STORAGE_DIRECTORY_DOWNLOADS path is = %s\\n", __LINE__, API_NAMESPACE, pszTempPath);
-               strcpy(pszPath, pszTempPath);
+               strncpy(pszPath, pszTempPath, strlen(pszTempPath)+1);
                free(pszTempPath);
                pszTempPath = NULL;             
        }
@@ -201,7 +201,10 @@ void CTs_platform_permission_bluetooth_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index fbc7f49..d070d2e 100755 (executable)
@@ -80,19 +80,20 @@ static void CalenderServiceRecordChangeCallback(const char *view_uri, void *user
 * @parameter           2d array
 * @return                      None
 */
+
 void GetViewURIforDB(char szArr[MAX_ROW][MAX_COL])
 {
-       strcpy(szArr[0], _calendar_book._uri);
-       strcpy(szArr[1], _calendar_event._uri);
-       strcpy(szArr[2], _calendar_todo._uri);
-       strcpy(szArr[3], _calendar_timezone._uri);
-       strcpy(szArr[4], _calendar_attendee._uri);
-       strcpy(szArr[5], _calendar_alarm._uri);
-       strcpy(szArr[6], _calendar_extended_property._uri);
-       strcpy(szArr[7], _calendar_instance_utime_calendar_book._uri);
-       strcpy(szArr[8], _calendar_instance_localtime_calendar_book._uri);
-       strcpy(szArr[9], _calendar_instance_utime_calendar_book_extended._uri);
-       strcpy(szArr[10], _calendar_instance_localtime_calendar_book_extended._uri);
+       strncpy(szArr[0], _calendar_book._uri, strlen(_calendar_book._uri)+1);
+       strncpy(szArr[1], _calendar_event._uri, strlen(_calendar_event._uri)+1);
+       strncpy(szArr[2], _calendar_todo._uri, strlen(_calendar_todo._uri)+1);
+       strncpy(szArr[3], _calendar_timezone._uri, strlen(_calendar_timezone._uri)+1);
+       strncpy(szArr[4], _calendar_attendee._uri, strlen(_calendar_attendee._uri)+1);
+       strncpy(szArr[5], _calendar_alarm._uri, strlen(_calendar_alarm._uri)+1);
+       strncpy(szArr[6], _calendar_extended_property._uri, strlen(_calendar_extended_property._uri)+1);
+       strncpy(szArr[7], _calendar_instance_utime_calendar_book._uri, strlen(_calendar_instance_utime_calendar_book._uri)+1);
+       strncpy(szArr[8], _calendar_instance_localtime_calendar_book._uri, strlen(_calendar_instance_localtime_calendar_book._uri)+1);
+       strncpy(szArr[9], _calendar_instance_utime_calendar_book_extended._uri, strlen(_calendar_instance_utime_calendar_book_extended._uri)+1);
+       strncpy(szArr[10], _calendar_instance_localtime_calendar_book_extended._uri, strlen(_calendar_instance_localtime_calendar_book_extended._uri)+1);
 }
 
 
@@ -300,7 +301,10 @@ void CTs_platform_permission_CalendarService_startup(void)
     struct stat stBuff;
     if ( stat(ERR_LOG, &stBuff) == 0 )
     {
-        remove(ERR_LOG);
+       if (remove(ERR_LOG))
+       {
+               FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+       }
     }
 
 #if DEBUG
index 1dfda3d..f276d51 100755 (executable)
@@ -11,7 +11,10 @@ void CTs_platform_permission_camera_startup(void)
     struct stat stBuff;
     if ( stat(ERR_LOG, &stBuff) == 0 )
     {
-        remove(ERR_LOG);
+       if (remove(ERR_LOG))
+       {
+               FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+       }
     }
 
 #if DEBUG
index e9a7c73..487f56f 100755 (executable)
@@ -1685,25 +1685,6 @@ bool AppControlDestroy()
        return true;
 }
 
-/**
-* @function            GetArchType
-* @description                 Get architecture type of the device
-* @parameter           NA
-* @return                      true if success else false
-*/
-bool GetArchType(char* pszArch)
-{
-       FILE *fp = popen("uname -m", "r");
-       if (fp == NULL) 
-       {
-               return false;
-       }
-       fscanf(fp, "%s", pszArch);
-       pclose(fp);
-       
-       return true;
-}
-
 #ifdef MOBILE  //Starts MOBILE
 /**
 * @function            ContextHistDestroy
@@ -1748,10 +1729,13 @@ bool ContextHistCreate()
        }
 
        nRet = context_history_filter_create(&g_hContxtHistFilter);
-       PRINT_RESULT_CLEANUP(CONTEXT_HISTORY_ERROR_NONE, nRet, "context_history_filter_create", ContextHistoryGetError(nRet), context_history_destroy(g_hContxtHist));
        if ( nRet != CONTEXT_HISTORY_ERROR_NONE )
        {
                ContextHistoryGetError(nRet);
+               if(g_hContxtHist)
+               {
+                       context_history_destroy(g_hContxtHist);
+               }
                return false;
        }
 
index 138fe40..c1481ac 100755 (executable)
@@ -11,7 +11,10 @@ void CTs_platform_permission_connection_startup(void)
     struct stat stBuff;
     if ( stat(ERR_LOG, &stBuff) == 0 )
     {
-        remove(ERR_LOG);
+       if (remove(ERR_LOG))
+       {
+               FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+       }
     }
 
 #if DEBUG
index cd0e054..451ceed 100755 (executable)
@@ -321,7 +321,10 @@ void CTs_platform_permission_ContactsService_startup(void)
     struct stat stBuff;
     if ( stat(ERR_LOG, &stBuff) == 0 )
     {
-        remove(ERR_LOG);
+       if (remove(ERR_LOG))
+       {
+               FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+       }
     }
 
 #if DEBUG
index e694d6c..cabc9b7 100755 (executable)
@@ -27,7 +27,10 @@ void CTs_platform_permission_context_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index 98338e4..d4f25dc 100755 (executable)
@@ -121,7 +121,10 @@ void CTs_platform_permission_datacontrol_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
@@ -714,7 +717,7 @@ int CTc_DataControl_PrivilegeDataControlConsumer_sql_insert_cb(void)
 
        bundle_add_str(pstData, DUMMYKEY, DUMMYVALUE);
        memset(g_szWhere, 0, QUERYSIZE);
-       sprintf(g_szWhere, "rowid=1");
+       snprintf(g_szWhere, strlen("rowid=1")+1, "rowid=1");
 
        data_control_sql_response_cb stSqlCallBack = {0};
        stSqlCallBack.insert_cb = DataControlSqlInsertResponseCb;
@@ -783,7 +786,7 @@ int CTc_DataControl_PrivilegeDataControlConsumer_data_control_sql_update(void)
 
        bundle_add_str(pstData, DUMMYKEY, DUMMYVALUE);
        memset(g_szWhere, 0, QUERYSIZE);
-       sprintf(g_szWhere, "rowid=1");
+       snprintf(g_szWhere, strlen("rowid=1")+1, "rowid=1");
 
        data_control_sql_response_cb stSqlCallBack = {0};
        stSqlCallBack.insert_cb = DataControlSqlInsertResponseCb;
@@ -932,7 +935,7 @@ int CTc_DataControl_PrivilegeDataControlprovider_send_data_change_noti(void)
 
        bundle_add_str(pstData, DUMMYKEY, DUMMYVALUE);
        memset(g_szWhere, 0, QUERYSIZE);
-       sprintf(g_szWhere, "rowid=1");
+       snprintf(g_szWhere, strlen("rowid=1")+1, "rowid=1");
        g_bAddCallbackResult = false;
 
 
index 86ecdc2..6bec0a3 100755 (executable)
@@ -22,7 +22,10 @@ void CTs_platform_permission_device_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index 66524c6..a39323c 100755 (executable)
@@ -10,7 +10,7 @@
 */
 char *EFLUTILGetError(int nResult)
 {
-       char *pszErrorMsg = NULL;
+       char *pszErrorMsg = "UNDEFINED ERROR \n";
 
        switch ( nResult )
        {
@@ -43,8 +43,6 @@ char *EFLUTILGetError(int nResult)
                break;
        case EFL_UTIL_ERROR_SCREENSHOT_EXECUTION_FAIL :
                pszErrorMsg = "EFL_UTIL_ERROR_SCREENSHOT_EXECUTION_FAIL  \n";
-       default:
-               pszErrorMsg = "UNDEFINED ERROR \n";
                break;
        }
        return pszErrorMsg;
@@ -62,7 +60,10 @@ void CTs_platform_permission_efl_util_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index 563f4b3..c52656e 100755 (executable)
@@ -8,7 +8,7 @@
 */
 char* EmailGetError(int nRet)
 {
-       char *szErrorVal = NULL;
+       char *szErrorVal = "Undefined Error";
 
        switch ( nRet )
        {
@@ -21,7 +21,6 @@ char* EmailGetError(int nRet)
        case EMAILS_ERROR_ACCOUNT_NOT_FOUND:                                    szErrorVal = "EMAILS_ERROR_ACCOUNT_NOT_FOUND";                                  break;
        case EMAILS_ERROR_DB_FAILED:                                                    szErrorVal = "EMAILS_ERROR_DB_FAILED";                                                  break;
        case EMAILS_ERROR_PERMISSION_DENIED:                                    szErrorVal = "EMAILS_ERROR_PERMISSION_DENIED";                                  break;
-       default:                                                                                                szErrorVal = "Undefined Error";                                                                 break;
        }
 
        return szErrorVal;
@@ -37,7 +36,10 @@ void CTs_platform_permission_email_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index f28b8f1..895a56d 100755 (executable)
@@ -12,7 +12,7 @@ bool g_bHttpInit =false;
 */
 char* HttpGetError(int nRet)
 {
-    char *szErrorVal = NULL;
+    char *szErrorVal = "Unknown Error";
 
     switch ( nRet )
     {
@@ -27,7 +27,6 @@ char* HttpGetError(int nRet)
         case HTTP_ERROR_OPERATION_TIMEDOUT:        szErrorVal = "HTTP_ERROR_OPERATION_TIMEDOUT";        break;
         case HTTP_ERROR_SSL_CONNECT_ERROR:        szErrorVal = "HTTP_ERROR_SSL_CONNECT_ERROR";        break;
         case HTTP_ERROR_NOT_SUPPORTED:            szErrorVal = "HTTP_ERROR_NOT_SUPPORTED";            break;
-        default:                                szErrorVal = "Unknown Error";                        break;
     }
     return szErrorVal;
 }
@@ -43,7 +42,10 @@ void CTs_platform_permission_http_startup(void)
     struct stat stBuff;
     if ( stat(ERR_LOG, &stBuff) == 0 )
     {
-        remove(ERR_LOG);
+       if (remove(ERR_LOG))
+       {
+               FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+       }
     }
     g_bHttpInit = true;
 
index cda69db..cf4aa71 100755 (executable)
@@ -44,7 +44,10 @@ void CTs_platform_permission_ime_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
        
     win = elm_win_add(NULL, "test", ELM_WIN_BASIC);
index 7abd248..e54a292 100755 (executable)
@@ -33,7 +33,10 @@ void CTs_platform_permission_inputmethodmanager_startup(void)
     struct stat stBuff;
     if ( stat(ERR_LOG, &stBuff) == 0 )
     {
-        remove(ERR_LOG);
+       if (remove(ERR_LOG))
+       {
+               FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+       }
     }
 
 #if DEBUG
index 254379a..171aba7 100755 (executable)
@@ -108,7 +108,7 @@ static void QuitGmainLoopIdle(bool result)
 */
 char* IotConGetError(int nRet)
 {
-       char *szErrorVal = NULL;
+       char *szErrorVal = "Unknown Error";
        switch ( nRet )
        {
                case IOTCON_ERROR_NONE:                                 szErrorVal = "IOTCON_ERROR_NONE";                                       break;
@@ -124,7 +124,6 @@ char* IotConGetError(int nRet)
                case IOTCON_ERROR_INVALID_TYPE:         szErrorVal = "IOTCON_ERROR_INVALID_TYPE";                       break;
                case IOTCON_ERROR_ALREADY:                              szErrorVal = "IOTCON_ERROR_ALREADY";                            break;
                case IOTCON_ERROR_SYSTEM:               szErrorVal = "IOTCON_ERROR_SYSTEM";                                     break;
-               default :                                                       szErrorVal = "Unknown Error";                                           break;
        }
        return szErrorVal;
 }
@@ -255,7 +254,10 @@ void CTs_platform_permission_iotcon_startup(void)
        
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
        
 
index 6cd0b03..7c80eb1 100755 (executable)
@@ -100,7 +100,10 @@ void CTs_platform_permission_Libfeedback_startup(void)
     struct stat stBuff;
     if ( stat(ERR_LOG, &stBuff) == 0 )
     {
-        remove(ERR_LOG);
+       if (remove(ERR_LOG))
+       {
+               FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+       }
     }
 
 #if DEBUG
index c2b4260..5d2ffce 100755 (executable)
@@ -12,7 +12,7 @@
 */
 char* LocationManagerGetError(location_error_e nRet)
 {
-       char *szErrorVal = NULL;
+       char *szErrorVal = "Unknown Error";
        switch ( nRet )
        {
        case LOCATIONS_ERROR_NONE:                                                      szErrorVal = "LOCATIONS_ERROR_NONE";                                                    break;
@@ -25,7 +25,6 @@ char* LocationManagerGetError(location_error_e nRet)
        case LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE:                     szErrorVal = "LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE";                   break;
        case LOCATIONS_ERROR_GPS_SETTING_OFF:                           szErrorVal = "LOCATIONS_ERROR_GPS_SETTING_OFF";                                 break;
        case LOCATIONS_ERROR_SECURITY_RESTRICTED:                       szErrorVal = "LOCATIONS_ERROR_SECURITY_RESTRICTED";                             break;
-       default:                                                                                        szErrorVal = "Unknown Error";                                                                   break;
        }
 
        return szErrorVal;
@@ -69,7 +68,10 @@ void CTs_platform_permission_locationmanager_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index f768203..112792e 100755 (executable)
@@ -63,7 +63,10 @@ void CTs_platform_permission_MapsService_startup(void)
     struct stat stBuff;
     if ( stat(ERR_LOG, &stBuff) == 0 )
     {
-        remove(ERR_LOG);
+       if (remove(ERR_LOG))
+       {
+               FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+       }
     }
 
 #if DEBUG
@@ -114,7 +117,7 @@ int CTc_MapsService_PrivilegeMapSservice_maps_service_create(void)
                }
 
        memset( g_szMapsProvider, '\0', sizeof(char)*BUFFER);
-       strcpy(g_szMapsProvider, "HERE");
+       strncpy(g_szMapsProvider, "HERE", strlen("HERE")+1);
        FPRINTF("[Line : %d][%s] Provider list from maps_service_foreach_provider is = %s\\n", __LINE__, API_NAMESPACE, g_szMapsProvider);
 
        int nRet = maps_service_create(g_szMapsProvider, &hMapsService);
index 921d173..eecec0f 100755 (executable)
@@ -315,7 +315,7 @@ static bool ForeachMediaCb(media_info_h media, void *user_data)
                PRINT_RESULTFALSE_CLEANUP(MEDIA_CONTENT_ERROR_NONE, nRet, "media_info_get_media_id", MediaGetError(nRet), QuitGmainLoopMedia());
 
                memset(g_szMediaId, 0, PATHLEN);
-               strcpy(g_szMediaId, szMediaId);
+               strncpy(g_szMediaId, szMediaId, strlen(szMediaId)-1);
                FREE_MEMORY(szMediaId);
                g_CallBackHit = true;
                QuitGmainLoopMedia();
@@ -476,7 +476,7 @@ bool GetFolderPath(int WhichFolder, char *FinalPath)
        CHECK_HANDLE(pszTempPath, "storage_get_directory");
 
        memset(FinalPath, 0, PATHLEN);
-       strcpy(FinalPath, pszTempPath);
+       strncpy(FinalPath, pszTempPath, strlen(pszTempPath)-1);
        FREE_MEMORY(pszTempPath);
 
        FPRINTF("[Line : %d][%s] Folder Path is : %s\\n", __LINE__, API_NAMESPACE, FinalPath);
@@ -493,9 +493,9 @@ bool GetFolderPath(int WhichFolder, char *FinalPath)
 void AppendPaths(char *FirstPath, char *SecondPath, char *FinalPath)
 {
        memset(FinalPath, 0, PATHLEN);
-       strcpy(FinalPath, FirstPath);
-       strcat(FinalPath, "/");
-       strcat(FinalPath, SecondPath);
+       strncpy(FinalPath, FirstPath, strlen(FirstPath)+1);
+       strncat(FinalPath, "/", 1);
+       strncat(FinalPath, SecondPath, strlen(SecondPath)+1);
 
        FPRINTF("[Line : %d][%s] Appended Path is : %s\\n", __LINE__, API_NAMESPACE, FinalPath);
 }
@@ -511,7 +511,10 @@ void CTs_platform_permission_mediacontent_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
        
        
index 52353e5..2dc5741 100755 (executable)
@@ -40,7 +40,10 @@ void CTs_platform_permission_MediaController_startup(void)
     struct stat stBuff;
     if ( stat(ERR_LOG, &stBuff) == 0 )
     {
-        remove(ERR_LOG);
+       if (remove(ERR_LOG))
+       {
+               FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+       }
     }
 
 #if DEBUG
index 81cd9b7..7c686f4 100755 (executable)
@@ -40,7 +40,7 @@ static bool storage_device_cb(int storage_id, storage_type_e type, storage_state
 */
 char* MediaStreamerGetError(int nRet)
 {
-       char *szErrorVal = NULL;
+       char *szErrorVal = "Unknown Error";
        switch ( nRet )
        {
        case MEDIA_STREAMER_ERROR_NONE:                                         szErrorVal = "MEDIA_STREAMER_ERROR_NONE";                                       break;
@@ -53,7 +53,6 @@ char* MediaStreamerGetError(int nRet)
        case MEDIA_STREAMER_ERROR_CONNECTION_FAILED:            szErrorVal = "MEDIA_STREAMER_ERROR_CONNECTION_FAILED";          break;
        case MEDIA_STREAMER_ERROR_RESOURCE_CONFLICT:            szErrorVal = "MEDIA_STREAMER_ERROR_RESOURCE_CONFLICT";          break;
        case MEDIA_STREAMER_ERROR_SEEK_FAILED:                          szErrorVal = "MEDIA_STREAMER_ERROR_SEEK_FAILED";                        break;
-       default:                                                                                        szErrorVal = "Unknown Error";                                                           break;
        }
        return szErrorVal;
 }
@@ -69,7 +68,10 @@ void CTs_platform_permission_media_streamer_startup(void)
        int nRetVal =-1;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
        TCT_CheckInstalledApp(5, TPK1, TPK2, TPK3, TPK4, TPK5);
 
index b959f04..70434ae 100755 (executable)
@@ -18,7 +18,10 @@ void CTs_platform_permission_messages_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index a98ef50..1dc0099 100755 (executable)
@@ -121,7 +121,10 @@ void CTs_platform_permission_nfc_startup(void)
     struct stat stBuff;
     if ( stat(ERR_LOG, &stBuff) == 0 )
     {
-        remove(ERR_LOG);
+       if (remove(ERR_LOG))
+       {
+               FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+       }
     }
        TCT_CheckInstalledApp(5, TPK1, TPK2, TPK3, TPK4, TPK5);
        int nRet = nfc_manager_initialize();
index ad32efc..ff1ec00 100755 (executable)
@@ -17,7 +17,7 @@ notification_h g_NotificationHandle;
 */
 char* NotificationGetError(int nRet)
 {
-       char *szErrorVal = NULL;
+       char *szErrorVal = "Unknown Error";
        switch ( nRet )
        {
        case NOTIFICATION_ERROR_NONE:                                   szErrorVal = "NOTIFICATION_ERROR_NONE";                                         break;
@@ -30,7 +30,6 @@ char* NotificationGetError(int nRet)
        case NOTIFICATION_ERROR_IO_ERROR:                               szErrorVal = "NOTIFICATION_ERROR_IO_ERROR";                                     break;
        case NOTIFICATION_ERROR_SERVICE_NOT_READY:              szErrorVal = "NOTIFICATION_ERROR_SERVICE_NOT_READY";            break;
        case NOTIFICATION_ERROR_PERMISSION_DENIED:              szErrorVal = "NOTIFICATION_ERROR_PERMISSION_DENIED";            break;
-       default:                                                                                szErrorVal = "Unknown Error";                                                           break;
        }
 
        return szErrorVal;
@@ -46,7 +45,10 @@ void CTs_platform_permission_notification_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index ec70928..648908f 100755 (executable)
@@ -31,7 +31,10 @@ void CTs_platform_permission_OAuth2_startup(void)
     struct stat stBuff;
     if ( stat(ERR_LOG, &stBuff) == 0 )
     {
-        remove(ERR_LOG);
+       if (remove(ERR_LOG))
+       {
+               FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+       }
     }
 
 #if DEBUG
index ed0d2dd..6b56c98 100755 (executable)
@@ -42,7 +42,10 @@ void CTs_platform_permission_packagemanager_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index 5c628cf..e916e52 100755 (executable)
@@ -15,7 +15,7 @@ bool g_bIsConnected = false;
  */
 char *PhoneNumberUtilsGetError(int nRet)
 {
-       char *szErrorVal = NULL;
+       char *szErrorVal = "Unknown Error";
        switch ( nRet )
        {
                case PHONE_NUMBER_ERROR_NONE:                                           szErrorVal = "PHONE_NUMBER_ERROR_NONE";                                                 break;
@@ -25,7 +25,6 @@ char *PhoneNumberUtilsGetError(int nRet)
                case PHONE_NUMBER_ERROR_FILE_NO_SPACE_ON_DEVICE:        szErrorVal = "PHONE_NUMBER_ERROR_FILE_NO_SPACE_ON_DEVICE";              break;
                case PHONE_NUMBER_ERROR_NOT_SUPPORTED:                          szErrorVal = "PHONE_NUMBER_ERROR_NOT_SUPPORTED";                                break;
                case PHONE_NUMBER_ERROR_NO_DATA:                                        szErrorVal = "PHONE_NUMBER_ERROR_NO_DATA";                                              break;
-               default:                                                                                        szErrorVal = "Unknown Error";                                                                   break;
        }
        return szErrorVal;
 }
@@ -40,7 +39,10 @@ void CTs_platform_permission_phonenumber_utils_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
        TCT_CheckInstalledApp(5, TPK1, TPK2, TPK3, TPK4, TPK5);
 
index d1f1213..574f2e3 100755 (executable)
@@ -37,7 +37,10 @@ void CTs_platform_permission_recorder_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index 671b073..0044581 100755 (executable)
@@ -10,7 +10,10 @@ void CTs_platform_permission_runtimeinfo_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index 23cc401..6e7e332 100755 (executable)
@@ -34,7 +34,10 @@ void CTs_platform_permission_sensor_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
@@ -64,7 +67,7 @@ void CTs_platform_permission_sensor_cleanup(void)
 */
 char* SensorGetType(sensor_type_e nSensorType)
 {
-       char *szErrorVal = NULL;
+       char *szErrorVal = "Unknown Error";
        switch ( nSensorType )
        {
        case SENSOR_ACCELEROMETER:                                      szErrorVal = "SENSOR_ACCELEROMETER";                                    break;
@@ -90,7 +93,6 @@ char* SensorGetType(sensor_type_e nSensorType)
        case SENSOR_GEOMAGNETIC_ROTATION_VECTOR:        szErrorVal = "SENSOR_GEOMAGNETIC_ROTATION_VECTOR";              break;   /**< Geomagnetic-based rotation vector sensor (Since Tizen 2.4) */
        case SENSOR_LAST:                                                       szErrorVal = "SENSOR_LAST";                                                             break;
        case SENSOR_CUSTOM:                                             szErrorVal = "SENSOR_CUSTOM";                                                   break;
-       default :                                                                       szErrorVal = "Unknown Error";                                                   break;
        }
        return szErrorVal;
 }
index dabf297..4c81109 100755 (executable)
@@ -347,6 +347,7 @@ void sync_context_destroy(sync_context_h sync_context)
                sync_context->cb_is_finished = FALSE;
                g_mutex_clear(&(sync_context->mutex));
                g_cond_clear(&sync_context->cond);
+               FREE_MEMORY(sync_context);
        }
 }
 /**
@@ -400,16 +401,15 @@ bool UploadFile(void)
        
        sync_context_h sync_context = sync_context_create();
        nRet = service_storage_set_task_state_changed_cb(hTask, TaskStateCallback, (void *)sync_context);
-       PRINT_RESULT_CLEANUP(SERVICE_ADAPTOR_ERROR_NONE, nRet, "service_storage_set_task_state_changed_cb", ServiceAdaptorGetError(nRet),sync_context_destroy(sync_context); FREE_MEMORY(sync_context);service_storage_destroy_task(hTask));
+       PRINT_RESULT_CLEANUP(SERVICE_ADAPTOR_ERROR_NONE, nRet, "service_storage_set_task_state_changed_cb", ServiceAdaptorGetError(nRet),sync_context_destroy(sync_context); service_storage_destroy_task(hTask));
 
        g_bCallbackHit = false;
        nRet = service_storage_start_task(hTask);
-       PRINT_RESULT_CLEANUP(SERVICE_ADAPTOR_ERROR_NONE, nRet, "service_storage_start_task", ServiceAdaptorGetError(nRet), sync_context_destroy(sync_context);FREE_MEMORY(sync_context);service_storage_destroy_task(hTask));
+       PRINT_RESULT_CLEANUP(SERVICE_ADAPTOR_ERROR_NONE, nRet, "service_storage_start_task", ServiceAdaptorGetError(nRet), sync_context_destroy(sync_context); service_storage_destroy_task(hTask));
 
        //      WaitForAsync();
        sync_context_wait_for_callback(sync_context);
        sync_context_destroy(sync_context);
-       FREE_MEMORY(sync_context);
        PRINT_RESULT_CLEANUP(true, g_bCallbackHit, "service_storage_start_task", "Callback not invoked", service_storage_destroy_task(hTask));
 
        nRet = service_storage_unset_task_state_changed_cb(hTask);
@@ -433,7 +433,10 @@ void CTs_platform_permission_ServiceAdaptorClient_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index 664df27..64c2c7e 100755 (executable)
@@ -69,7 +69,10 @@ void CTs_platform_permission_shortcut_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index 76e4fde..370c257 100755 (executable)
@@ -20,7 +20,10 @@ void CTs_platform_permission_smartcard_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index 2247fd5..3c54aa5 100755 (executable)
@@ -11,7 +11,10 @@ void CTs_platform_permission_soundmanager_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index f97af25..b199a8b 100755 (executable)
@@ -9,7 +9,7 @@
 */
 char* PushServiceGetError(int nRet)
 {
-       char *szErrorVal = NULL;
+       char *szErrorVal = "UNKNOWN_ERROR";
 
        switch ( nRet )
        {
@@ -20,7 +20,6 @@ char* PushServiceGetError(int nRet)
        case PUSH_SERVICE_ERROR_NO_DATA:                        szErrorVal = "PUSH_SERVICE_ERROR_NO_DATA";                              break;
        case PUSH_SERVICE_ERROR_OPERATION_FAILED:       szErrorVal = "PUSH_SERVICE_ERROR_OPERATION_FAILED";             break;
        case PUSH_SERVICE_ERROR_PERMISSION_DENIED:      szErrorVal = "PUSH_SERVICE_ERROR_PERMISSION_DENIED";    break;
-       default:                                                                        szErrorVal = "UNKNOWN_ERROR";                                                   break;
        }
        return szErrorVal;
 }
@@ -36,7 +35,10 @@ void CTs_platform_permission_sppc_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index 73adf2e..7b76195 100755 (executable)
@@ -11,7 +11,7 @@
 */
 char* SttGetError(stt_error_e nError)
 {
-       char *szErrorVal = NULL;
+       char *szErrorVal = "Undefined Error";
        switch ( nError )
        {
        case STT_ERROR_NONE:                                    szErrorVal = "STT_ERROR_NONE";                                  break;
@@ -27,7 +27,6 @@ char* SttGetError(stt_error_e nError)
        case STT_ERROR_ENGINE_NOT_FOUND:                szErrorVal = "STT_ERROR_ENGINE_NOT_FOUND";              break;
        case STT_ERROR_NOT_SUPPORTED:                   szErrorVal = "STT_ERROR_NOT_SUPPORTED";                 break;
        case STT_ERROR_NOT_SUPPORTED_FEATURE:   szErrorVal = "STT_ERROR_NOT_SUPPORTED_FEATURE"; break;
-       default:                                                                szErrorVal = "Undefined Error";                                 break;
        }
 
        return szErrorVal;
@@ -43,7 +42,10 @@ void CTs_platform_permission_stt_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index 2be38d8..c907699 100755 (executable)
@@ -30,7 +30,7 @@ bool g_bSetupReady;
 */
 char* SyncManagerGetError(int nRet)
 {
-       char *szErrorVal = NULL;
+       char *szErrorVal = "SYNC_ERROR_UNKNOWN";
        switch ( nRet )
        {
                case SYNC_ERROR_NONE:                                           szErrorVal = "SYNC_ERROR_NONE";                                                 break;
@@ -44,7 +44,6 @@ char* SyncManagerGetError(int nRet)
                case SYNC_ERROR_SYSTEM:                                         szErrorVal = "SYNC_ERROR_SYSTEM";                                               break;
                case SYNC_ERROR_QUOTA_EXCEEDED:                         szErrorVal = "SYNC_ERROR_QUOTA_EXCEEDED";                               break;
                case SYNC_ERROR_SYNC_ADAPTER_NOT_FOUND:         szErrorVal = "SYNC_ERROR_SYNC_ADAPTER_NOT_FOUND";               break;
-               default:                                                                        szErrorVal = "SYNC_ERROR_UNKNOWN";                                              break;
        }
 
        return szErrorVal;
@@ -60,7 +59,10 @@ void CTs_platform_permission_syncmanager_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
@@ -210,6 +212,7 @@ bool SyncAdapterStartCallback(account_h account, const char *sync_job_name, cons
 #if DEBUG
        FPRINTF("[Line : %d][%s] SyncAdapterStartCallback callback called\\n", __LINE__, API_NAMESPACE);
 #endif
+       return true;
        
 }
 
index 6dda335..fb5d578 100755 (executable)
@@ -45,7 +45,10 @@ void CTs_platform_permission_telephony_startup(void)
     struct stat stBuff;
     if ( stat(ERR_LOG, &stBuff) == 0 )
     {
-        remove(ERR_LOG);
+       if (remove(ERR_LOG))
+       {
+               FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+       }
     }
 
 #if DEBUG
index acdd40d..7d56739 100755 (executable)
@@ -83,7 +83,7 @@ char* ThumbnailGetDataPath(char *pszFileName)
        pszImgPath = (char*) calloc(1, strlen(pszAppData) + strlen(pszFileName)+1);
        if (pszImgPath == NULL)
                return pszImgPath;
-       sprintf(pszImgPath, "%s%s",pszAppData, pszFileName );
+       snprintf(pszImgPath, "%s%s",pszAppData, pszFileName, strlen(pszAppData) + strlen(pszFileName));
        FPRINTF("[Line : %d][%s] app_get_data_path() is %s\\n", __LINE__, API_NAMESPACE, pszImgPath);
        return pszImgPath;
 }
@@ -96,7 +96,7 @@ char* ThumbnailGetDataPath(char *pszFileName)
  */
 char* ThumbnailUtilGetError(int nRet)
 {
-       char *szErrorVal = NULL;
+       char *szErrorVal = "Unknown Error";
        switch ( nRet )
        {
                case THUMBNAIL_UTIL_ERROR_NONE:                         
@@ -117,9 +117,6 @@ char* ThumbnailUtilGetError(int nRet)
                case THUMBNAIL_UTIL_ERROR_PERMISSION_DENIED:                    
                        szErrorVal = "THUMBNAIL_UTIL_ERROR_PERMISSION_DENIED";                          
                        break;
-               default:                                                                                
-                       szErrorVal = "Unknown Error";                                                           
-                       break;
        }
 
        return szErrorVal;
@@ -158,7 +155,10 @@ void CTs_platform_permission_thumbnailutil_startup(void)
     struct stat stBuff;
     if ( stat(ERR_LOG, &stBuff) == 0 )
     {
-        remove(ERR_LOG);
+       if (remove(ERR_LOG))
+       {
+               FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+       }
     }
 
 #if DEBUG
index 2d3b64a..6e29d54 100755 (executable)
@@ -11,7 +11,10 @@ void CTs_platform_permission_urldownload_startup(void)
     struct stat stBuff;
     if ( stat(ERR_LOG, &stBuff) == 0 )
     {
-        remove(ERR_LOG);
+       if (remove(ERR_LOG))
+       {
+               FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+       }
     }
 
 #if DEBUG
index a7296ba..6e57dff 100755 (executable)
@@ -19,7 +19,7 @@
 */
 char* VoiceControlGetError(int nRet)
 {
-       char *szErrorVal = NULL;
+       char *szErrorVal = "VC_ERROR_UNKNOWN";
        switch ( nRet )
        {
                case VC_ERROR_NONE:                                             szErrorVal = "VC_ERROR_NONE";                                   break;
@@ -37,7 +37,6 @@ char* VoiceControlGetError(int nRet)
                case VC_ERROR_OPERATION_REJECTED:               szErrorVal = "VC_ERROR_OPERATION_REJECTED";             break;
                case VC_ERROR_ITERATION_END:                    szErrorVal = "VC_ERROR_ITERATION_END";                  break;
                case VC_ERROR_EMPTY:                                    szErrorVal = "VC_ERROR_EMPTY";                                  break;
-               default:                                                                szErrorVal = "VC_ERROR_UNKNOWN";                                break;
        }
        return szErrorVal;
 }
@@ -53,7 +52,10 @@ void CTs_platform_permission_VoiceControl_startup(void)
     struct stat stBuff;
     if ( stat(ERR_LOG, &stBuff) == 0 )
     {
-        remove(ERR_LOG);
+       if (remove(ERR_LOG))
+       {
+               FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+       }
     }
 
 #if DEBUG
index 68c981a..11f3a67 100755 (executable)
@@ -19,7 +19,10 @@ void CTs_platform_permission_vpn_service_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
@@ -50,7 +53,7 @@ void CTs_platform_permission_vpn_service_cleanup(void)
 */
 char *VPNSVCGetError(int nResult)
 {
-       char *pszErrorMsg = NULL;
+       char *pszErrorMsg = "UNDEFINED ERROR \n";
 
        switch ( nResult )
        {
@@ -81,9 +84,6 @@ char *VPNSVCGetError(int nResult)
        case VPNSVC_ERROR_NOT_SUPPORTED :
                pszErrorMsg = "VPNSVC_ERROR_NOT_SUPPORTED  \n";
                break;
-       default:
-               pszErrorMsg = "UNDEFINED ERROR \n";
-               break;
        }
        return pszErrorMsg;
 }
index 7f9b245..c0cfa2c 100755 (executable)
@@ -121,7 +121,10 @@ void CTs_platform_permission_widgetservice_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index e9ff00b..26594f9 100755 (executable)
@@ -33,7 +33,7 @@ Evas_Object *g_win = NULL;
  */
 char* WidgetViewerGetError(int nRet)
 {
-       char *szErrorVal = NULL;
+       char *szErrorVal = "UNKNOWN ERROR";
 
        switch(nRet)
        {
@@ -52,7 +52,6 @@ char* WidgetViewerGetError(int nRet)
                case WIDGET_ERROR_ALREADY_STARTED:                      szErrorVal = "WIDGET_ERROR_ALREADY_STARTED";                    break;
                case WIDGET_ERROR_NOT_EXIST:                            szErrorVal = "WIDGET_ERROR_NOT_EXIST";                                  break;
                case WIDGET_ERROR_DISABLED:                                     szErrorVal = "WIDGET_ERROR_DISABLED";                                   break;
-               default:                                                                        szErrorVal = "Unknown Error";                                                   break;
        }
        return szErrorVal;
 }
@@ -68,7 +67,10 @@ void CTs_platform_permission_WidgetViewer_startup(void)
     struct stat stBuff;
     if ( stat(ERR_LOG, &stBuff) == 0 )
     {
-        remove(ERR_LOG);
+       if (remove(ERR_LOG))
+       {
+               FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+       }
     }
 
 #if DEBUG
index 8d0f189..329daa6 100755 (executable)
@@ -11,7 +11,10 @@ void CTs_platform_permission_wifidirect_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-       remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index 92e4c9b..1accde7 100755 (executable)
@@ -9,7 +9,7 @@
 */
 char* WifiManagerGetError(int nRet)
 {
-       char *pszErrorVal = NULL;
+       char *pszErrorVal = "Unknown Error";
 
        switch ( nRet )
        {
@@ -26,9 +26,8 @@ char* WifiManagerGetError(int nRet)
                case WIFI_MANAGER_ERROR_DHCP_FAILED:                                    pszErrorVal = "WIFI_MANAGER_ERROR_DHCP_FAILED";                                         break;  
                case WIFI_MANAGER_ERROR_INVALID_KEY:                                    pszErrorVal = "WIFI_MANAGER_ERROR_INVALID_KEY";                                         break;
                case WIFI_MANAGER_ERROR_NO_REPLY:                                               pszErrorVal = "WIFI_MANAGER_ERROR_NO_REPLY";                                            break;
-               case WIFI_MANAGER_ERROR_SECURITY_RESTRICTED:                    pszErrorVal = "WIFI_MANAGER_ERROR_SECURITY_RESTRICTED";                         break;  
-               default:                                                                                                pszErrorVal = "Unknown Error";                                                                          break;
-               }
+               case WIFI_MANAGER_ERROR_SECURITY_RESTRICTED:                    pszErrorVal = "WIFI_MANAGER_ERROR_SECURITY_RESTRICTED";                         break;
+       }
        return pszErrorVal;
 }
 /**
@@ -42,7 +41,10 @@ void CTs_platform_permission_wifi_manager_startup(void)
     struct stat stBuff;
     if ( stat(ERR_LOG, &stBuff) == 0 )
     {
-        remove(ERR_LOG);
+       if (remove(ERR_LOG))
+       {
+               FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+       }
     }
 
 #if DEBUG
index 80690bc..9fa3bed 100755 (executable)
@@ -8,7 +8,7 @@
 */
 char* Wifi_PrintErrorInfo(int nResult)
 {
-       char* pszErrInfo = NULL;
+       char* pszErrInfo = "UNKNOWN ERROR";
        switch ( nResult )
        {
        case WIFI_ERROR_NONE:                                                   pszErrInfo = "WIFI_ERROR_NONE";                                                         break;
@@ -24,7 +24,6 @@ char* Wifi_PrintErrorInfo(int nResult)
        case WIFI_ERROR_NO_REPLY:                                               pszErrInfo = "WIFI_ERROR_NO_REPLY";                                                     break;
        case WIFI_ERROR_OUT_OF_MEMORY:                                  pszErrInfo = "WIFI_ERROR_OUT_OF_MEMORY";                                        break;
        case WIFI_ERROR_NO_CONNECTION:                                  pszErrInfo = "WIFI_ERROR_NO_CONNECTION";                                        break;
-       default:                                                                                pszErrInfo = "UNKNOWN ERROR";
        }
 
        return pszErrInfo;
@@ -40,7 +39,10 @@ void CTs_platform_permission_wifi_startup(void)
     struct stat stBuff;
     if ( stat(ERR_LOG, &stBuff) == 0 )
     {
-        remove(ERR_LOG);
+       if (remove(ERR_LOG))
+       {
+               FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+       }
     }
 
 #if DEBUG
index 9270f93..a49a00c 100755 (executable)
@@ -30,7 +30,7 @@
 */
 char* PlayerGetError(int nResult)
 {
-       char* pszErrInfo = NULL;
+       char* pszErrInfo = "Unknown Error";
        switch ( nResult )
        {
        case PLAYER_ERROR_OUT_OF_MEMORY:                                                pszErrInfo = "PLAYER_ERROR_OUT_OF_MEMORY";                                              break;
@@ -44,8 +44,6 @@ char* PlayerGetError(int nResult)
        case PLAYER_ERROR_INVALID_URI:                                                  pszErrInfo = "PLAYER_ERROR_INVALID_URI";                                                break;
        case PLAYER_ERROR_PERMISSION_DENIED:                                    pszErrInfo = "PLAYER_ERROR_PERMISSION_DENIED";                                  break;
        case PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE:              pszErrInfo = "PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE";    break;
-       default:                                                                                                pszErrInfo = "Unknown Error";                                                                   break;
-       
        }
        return pszErrInfo;
 }
@@ -296,14 +294,13 @@ gboolean PlayerGmainLoopCallBack(gpointer data)
 
 void RuntimeErrorInfo(char *pszApiName, int nResult)
 {
-       char* pszErrInfo = NULL;
+       char* pszErrInfo = "UNKNOWN";
        switch ( nResult )
        {
        case RUNTIME_INFO_ERROR_INVALID_PARAMETER:              pszErrInfo = "RUNTIME_INFO_ERROR_INVALID_PARAMETER";            break;
        case RUNTIME_INFO_ERROR_OUT_OF_MEMORY:                  pszErrInfo = "RUNTIME_INFO_ERROR_OUT_OF_MEMORY";                        break;
        case RUNTIME_INFO_ERROR_IO_ERROR:                               pszErrInfo = "RUNTIME_INFO_ERROR_IO_ERROR";                             break;
        case RUNTIME_INFO_ERROR_PERMISSION_DENIED:              pszErrInfo = "RUNTIME_INFO_ERROR_PERMISSION_DENIED";            break; 
-       default:                                                                                pszErrInfo = "UNKNOWN";
        }
 
        FPRINTF("[Line : %d][%s] %s is failed, error returned = %s\\n", __LINE__, API_NAMESPACE, pszApiName, pszErrInfo);
@@ -328,7 +325,7 @@ char* MediaPlayerGetDataPath(char *pszFileName)
        if (pszImgPath == NULL)
                return pszImgPath;
        
-       sprintf(pszImgPath, "%s%s",pszAppData, pszFileName );
+       snprintf(pszImgPath, strlen(pszAppData) + strlen(pszFileName)+2, "%s%s",pszAppData, pszFileName);
        FPRINTF("[Line : %d][%s] app_get_resource_path() is %s\\n", __LINE__, API_NAMESPACE,pszImgPath);
        return pszImgPath;
 }
index b87bae4..df18e75 100755 (executable)
@@ -33,7 +33,10 @@ void CTs_capi_media_player_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index 21d6091..9b17635 100755 (executable)
@@ -33,7 +33,10 @@ void CTs_runtime_info_startup(void)
        struct stat stBuff;   
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index 534740c..96e32b2 100755 (executable)
@@ -33,7 +33,10 @@ void CTs_sensor_startup(void)
        struct stat stBuff;   
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index 4e874cf..8df2880 100755 (executable)
@@ -33,7 +33,10 @@ void CTs_sound_manager_startup(void)
        struct stat stBuff;   
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index 7754ff7..ef3097b 100755 (executable)
@@ -33,7 +33,10 @@ void CTs_system_info_startup(void)
        struct stat stBuff;   
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index 7894b78..765e320 100755 (executable)
@@ -33,7 +33,10 @@ void CTs_telephony_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index e039305..53f9c94 100755 (executable)
@@ -33,7 +33,10 @@ void CTs_capi_media_video_util_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG
index 1624c3a..4d1c4e8 100755 (executable)
@@ -96,12 +96,13 @@ dbgFunc(VkFlags msgFlags, VkDebugReportObjectTypeEXT objType,
     validation_error = 1;
 
     if (msgFlags & VK_DEBUG_REPORT_ERROR_BIT_EXT) {
-        sprintf(message, "ERROR: [%s] Code %d : %s", pLayerPrefix, msgCode,
-                pMsg);
+        snprintf(message, "ERROR: [%s] Code %d : %s", pLayerPrefix, msgCode,
+                pMsg, strlen(pLayerPrefix)+strlen(msgCode)+strlen(pMsg));
     } else if (msgFlags & VK_DEBUG_REPORT_WARNING_BIT_EXT) {
-        sprintf(message, "WARNING: [%s] Code %d : %s", pLayerPrefix, msgCode,
-                pMsg);
+        snprintf(message, "WARNING: [%s] Code %d : %s", pLayerPrefix, msgCode,
+                pMsg, strlen(pLayerPrefix)+strlen(msgCode)+strlen(pMsg));
     } else {
+               free(message);
         return false;
     }
 
@@ -1288,24 +1289,48 @@ demo_prepare_shader_module(struct demo *demo, const void *code, size_t size) {
  */
 char *demo_read_spv(const char *filename, size_t *psize) {
     long int size;
-    void *shader_code;
+    void *shader_code = NULL;
     size_t retVal;
 
     FILE *fp = fopen(filename, "rb");
     if (!fp)
         return NULL;
 
-    fseek(fp, 0L, SEEK_END);
-    size = ftell(fp);
+       if(fseek(fp, 0L, SEEK_END))
+       {
+               FPRINTF("[Line : %d][%s] Cannot set the position of the stream to SEEK_END \n", __LINE__, API_NAMESPACE);
+               fclose(fp);
+               return NULL;
+       }
+       size = ftell(fp);
+
+       if(-1 == size)
+       {
+               FPRINTF("[Line : %d][%s] CUrrent Value of the position indicator is set to -1 \n", __LINE__, API_NAMESPACE);
+               fclose(fp);
+               return NULL;
+       }
 
-    fseek(fp, 0L, SEEK_SET);
+       if(fseek(fp, 0L, SEEK_SET))
+       {
+               FPRINTF("[Line : %d][%s] Cannot set the position of the stream to SEEK_SET \n", __LINE__, API_NAMESPACE);
+               fclose(fp);
+               return NULL;
+       }
 
     shader_code = malloc(size);
+       if(!shader_code)
+       {
+               fclose(fp);
+               return NULL;
+       }
+
     retVal = fread(shader_code, size, 1, fp);
     if ( ferror(retVal) )
        {
                fclose(fp);
-        return NULL;
+               free(shader_code);
+               return NULL;
        }
 
     *psize = size;
@@ -1950,7 +1975,7 @@ static void demo_init_vk(struct demo *demo) {
         ERR_EXIT("[Line : %d][%s]Cannot find a specified extension library"
                  ".\nMake sure your layers path is set appropriately\n",
                  "vkCreateInstance Failure");
-    } else if (err) {
+    } else {
         ERR_EXIT("[Line : %d][%s]vkCreateInstance failed.\n\nDo you have a compatible Vulkan "
                  "installable client driver (ICD) installed?\nPlease look at "
                  "the Getting Started guide for additional information.\n",
index 84f56da..8a8a60e 100755 (executable)
@@ -53,7 +53,10 @@ void CTs_vulkan_startup(void)
        struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
        g_bCheckStarup = true;
 
@@ -166,15 +169,10 @@ int CTc_vulkan_create_instance_p(void)
      } else if (nRet == VK_ERROR_EXTENSION_NOT_PRESENT) {
                 FPRINTF("[Line : %d][%s] Cannot find a specified extension library. Make sure your layers path is set appropriately. vkCreateInstance Failure\\n", __LINE__, API_NAMESPACE);
                 return 1;
-     } else if (nRet) {
-                FPRINTF("[Line : %d][%s] vkCreateInstance failed.\n\nDo you have a compatible Vulkan installable client driver (ICD) installed?\nPlease look at the Getting Started guide for additional information. vkCreateInstance Failure\\n", __LINE__, API_NAMESPACE);
+     } else {
+                FPRINTF("[Line : %d][%s] vkCreateInstance failed.\n\nDo you have a compatible Vulkan installable client driver (ICD) installed?\nPlease look at the Getting Started guide for additional information. vkCreateInstance Failure %s\\n", __LINE__, API_NAMESPACE, VulkanGetError(nRet));
                 return 1;
      }
-     if ( nRet != 0 )
-        {
-                FPRINTF("[Line : %d][%s] vkCreateInstance failed. %s \\n",__LINE__, API_NAMESPACE, VulkanGetError(nRet));
-                return 1;
-        }
        return 0;
 }
 
index 86519aa..08c540d 100644 (file)
@@ -104,6 +104,7 @@ SDL_main(int argc, char *argv[])
         SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "SDL could not initialize! SDL_Error: %s", SDL_GetError());
 
     PRINT_TC_RESULT("%d", result=-1);
+       FREE_MEMORY_TC(func_name);
     return result;
     }
 
index 41a419f..0d077e6 100755 (executable)
@@ -33,7 +33,10 @@ void CTs_wifi_direct_startup(void)
        struct stat stBuff;   
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
-               remove(ERR_LOG);
+               if (remove(ERR_LOG))
+               {
+                       FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+               }
        }
 
 #if DEBUG