From 1e6ba9bfa1613379b37f1d9c1ff7ab9358e54963 Mon Sep 17 00:00:00 2001 From: ABHISHEK JAIN Date: Wed, 21 Feb 2018 12:33:01 +0530 Subject: [PATCH] [CTC][SVACE-Fix][Non-ACR][Fixed SVACE defects for CTC modules] Signed-off-by: ABHISHEK JAIN Change-Id: I1950c47c37d2f4d5d4e5d042ce47c168199767f2 --- src/ctc/audio-io/CTs-audio-io.c | 5 ++- src/ctc/camera/CTs-camera.c | 6 ++- src/ctc/connection/CTs-connection.c | 5 ++- src/ctc/device/CTs-device.c | 5 ++- .../CTs-filesystem-permission-common.c | 13 ++++-- .../CTs-filesystem-permission.c | 5 ++- src/ctc/image-util/CTs-image-util-common.c | 2 +- src/ctc/image-util/CTs-image-util.c | 5 ++- src/ctc/libstorage/CTs-libstorage-common.c | 6 +-- src/ctc/libstorage/CTs-libstorage.c | 5 ++- .../location-manager/CTs-location-manager.c | 5 ++- src/ctc/mediacodec/CTs-mediacodec.c | 6 ++- src/ctc/opengl/CTs-opengl.c | 5 ++- .../CTs-platform-permission-accountsvc.c | 34 +++++++++----- .../CTs-platform-permission-app-manager.c | 5 ++- .../CTs-platform-permission-application.c | 5 ++- .../CTs-platform-permission-attach-panel.c | 5 ++- .../CTs-platform-permission-audio-io.c | 5 ++- .../CTs-platform-permission-badge.c | 7 ++- .../CTs-platform-permission-bluetooth.c | 7 ++- ...CTs-platform-permission-calendar-service.c | 28 +++++++----- .../CTs-platform-permission-camera.c | 5 ++- .../CTs-platform-permission-common.c | 24 ++-------- .../CTs-platform-permission-connection.c | 5 ++- ...CTs-platform-permission-contacts-service.c | 5 ++- .../CTs-platform-permission-context.c | 5 ++- .../CTs-platform-permission-datacontrol.c | 11 +++-- .../CTs-platform-permission-device.c | 5 ++- .../CTs-platform-permission-efl-util.c | 9 ++-- .../CTs-platform-permission-email.c | 8 ++-- .../CTs-platform-permission-http.c | 8 ++-- .../CTs-platform-permission-ime.c | 5 ++- ...-platform-permission-inputmethod-manager.c | 5 ++- .../CTs-platform-permission-iotcon.c | 8 ++-- .../CTs-platform-permission-libfeedback.c | 5 ++- ...CTs-platform-permission-location-manager.c | 8 ++-- .../CTs-platform-permission-maps-service.c | 7 ++- .../CTs-platform-permission-media-content.c | 15 ++++--- ...CTs-platform-permission-media-controller.c | 5 ++- .../CTs-platform-permission-media-streamer.c | 8 ++-- .../CTs-platform-permission-messages.c | 5 ++- .../CTs-platform-permission-nfc.c | 5 ++- .../CTs-platform-permission-notification.c | 8 ++-- .../CTs-platform-permission-oauth2-manager.c | 5 ++- .../CTs-platform-permission-package-manager.c | 5 ++- ...Ts-platform-permission-phonenumber-utils.c | 8 ++-- .../CTs-platform-permission-recorder.c | 5 ++- .../CTs-platform-permission-runtime-info.c | 5 ++- .../CTs-platform-permission-sensor.c | 8 ++-- ...atform-permission-service-adaptor-client.c | 11 +++-- .../CTs-platform-permission-shortcut.c | 5 ++- .../CTs-platform-permission-smartcard.c | 5 ++- .../CTs-platform-permission-sound-manager.c | 5 ++- .../CTs-platform-permission-sppc.c | 8 ++-- .../CTs-platform-permission-stt.c | 8 ++-- .../CTs-platform-permission-sync-manager.c | 9 ++-- .../CTs-platform-permission-telephony.c | 5 ++- .../CTs-platform-permission-thumbnail-util.c | 12 ++--- .../CTs-platform-permission-url-download.c | 5 ++- .../CTs-platform-permission-voice-control.c | 8 ++-- .../CTs-platform-permission-vpn-service.c | 10 ++--- .../CTs-platform-permission-widget-service.c | 5 ++- .../CTs-platform-permission-widget-viewer.c | 8 ++-- .../CTs-platform-permission-wifi-direct.c | 5 ++- .../CTs-platform-permission-wifi-manager.c | 12 ++--- .../CTs-platform-permission-wifi.c | 8 ++-- src/ctc/player/CTs-player-common.c | 9 ++-- src/ctc/player/CTs-player.c | 5 ++- src/ctc/runtime-info/CTs-runtime-info.c | 5 ++- src/ctc/sensor/CTs-sensor.c | 5 ++- src/ctc/sound-manager/CTs-sound-manager.c | 5 ++- src/ctc/system-info/CTs-system-info.c | 5 ++- src/ctc/telephony/CTs-telephony.c | 5 ++- src/ctc/video-util/CTs-video-util.c | 5 ++- src/ctc/vulkan/CTs-vulkan-draw.c | 45 ++++++++++++++----- src/ctc/vulkan/CTs-vulkan-instance.c | 14 +++--- src/ctc/vulkan/tct-vulkan-native.c | 1 + src/ctc/wifi-direct/CTs-wifi-direct.c | 5 ++- 78 files changed, 412 insertions(+), 200 deletions(-) diff --git a/src/ctc/audio-io/CTs-audio-io.c b/src/ctc/audio-io/CTs-audio-io.c index 972df73d1..f15472d7b 100755 --- a/src/ctc/audio-io/CTs-audio-io.c +++ b/src/ctc/audio-io/CTs-audio-io.c @@ -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 diff --git a/src/ctc/camera/CTs-camera.c b/src/ctc/camera/CTs-camera.c index 3424bb27b..498d03dbf 100755 --- a/src/ctc/camera/CTs-camera.c +++ b/src/ctc/camera/CTs-camera.c @@ -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 diff --git a/src/ctc/connection/CTs-connection.c b/src/ctc/connection/CTs-connection.c index 2098e83f1..d337b7ab0 100755 --- a/src/ctc/connection/CTs-connection.c +++ b/src/ctc/connection/CTs-connection.c @@ -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 diff --git a/src/ctc/device/CTs-device.c b/src/ctc/device/CTs-device.c index 2310164ef..34bde2f83 100755 --- a/src/ctc/device/CTs-device.c +++ b/src/ctc/device/CTs-device.c @@ -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 diff --git a/src/ctc/filesystem-permission/CTs-filesystem-permission-common.c b/src/ctc/filesystem-permission/CTs-filesystem-permission-common.c index c8acc427e..662976b39 100755 --- a/src/ctc/filesystem-permission/CTs-filesystem-permission-common.c +++ b/src/ctc/filesystem-permission/CTs-filesystem-permission-common.c @@ -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 ) diff --git a/src/ctc/filesystem-permission/CTs-filesystem-permission.c b/src/ctc/filesystem-permission/CTs-filesystem-permission.c index dd7cb1335..021b03281 100755 --- a/src/ctc/filesystem-permission/CTs-filesystem-permission.c +++ b/src/ctc/filesystem-permission/CTs-filesystem-permission.c @@ -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); diff --git a/src/ctc/image-util/CTs-image-util-common.c b/src/ctc/image-util/CTs-image-util-common.c index 65c1235ab..66db028df 100755 --- a/src/ctc/image-util/CTs-image-util-common.c +++ b/src/ctc/image-util/CTs-image-util-common.c @@ -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; } diff --git a/src/ctc/image-util/CTs-image-util.c b/src/ctc/image-util/CTs-image-util.c index b34aec6ca..7ebc49f57 100755 --- a/src/ctc/image-util/CTs-image-util.c +++ b/src/ctc/image-util/CTs-image-util.c @@ -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 diff --git a/src/ctc/libstorage/CTs-libstorage-common.c b/src/ctc/libstorage/CTs-libstorage-common.c index 8cdf9410f..2e3613fe4 100755 --- a/src/ctc/libstorage/CTs-libstorage-common.c +++ b/src/ctc/libstorage/CTs-libstorage-common.c @@ -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 diff --git a/src/ctc/libstorage/CTs-libstorage.c b/src/ctc/libstorage/CTs-libstorage.c index 84172cd2e..ee31938ac 100755 --- a/src/ctc/libstorage/CTs-libstorage.c +++ b/src/ctc/libstorage/CTs-libstorage.c @@ -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 diff --git a/src/ctc/location-manager/CTs-location-manager.c b/src/ctc/location-manager/CTs-location-manager.c index f5b2796ed..7d2484c9f 100755 --- a/src/ctc/location-manager/CTs-location-manager.c +++ b/src/ctc/location-manager/CTs-location-manager.c @@ -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 diff --git a/src/ctc/mediacodec/CTs-mediacodec.c b/src/ctc/mediacodec/CTs-mediacodec.c index 00ccdaeb2..25160b2f6 100755 --- a/src/ctc/mediacodec/CTs-mediacodec.c +++ b/src/ctc/mediacodec/CTs-mediacodec.c @@ -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); diff --git a/src/ctc/opengl/CTs-opengl.c b/src/ctc/opengl/CTs-opengl.c index e87bc2e4f..65a99374b 100755 --- a/src/ctc/opengl/CTs-opengl.c +++ b/src/ctc/opengl/CTs-opengl.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-accountsvc.c b/src/ctc/platform-permission/CTs-platform-permission-accountsvc.c index 08373a9f3..b42ca4c77 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-accountsvc.c +++ b/src/ctc/platform-permission/CTs-platform-permission-accountsvc.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-app-manager.c b/src/ctc/platform-permission/CTs-platform-permission-app-manager.c index 36fa3e435..c6d746220 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-app-manager.c +++ b/src/ctc/platform-permission/CTs-platform-permission-app-manager.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-application.c b/src/ctc/platform-permission/CTs-platform-permission-application.c index cd9520910..6d27e8e4c 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-application.c +++ b/src/ctc/platform-permission/CTs-platform-permission-application.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-attach-panel.c b/src/ctc/platform-permission/CTs-platform-permission-attach-panel.c index de7d65918..22e4ceee4 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-attach-panel.c +++ b/src/ctc/platform-permission/CTs-platform-permission-attach-panel.c @@ -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) { diff --git a/src/ctc/platform-permission/CTs-platform-permission-audio-io.c b/src/ctc/platform-permission/CTs-platform-permission-audio-io.c index 11914a3e1..6dcb9aee3 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-audio-io.c +++ b/src/ctc/platform-permission/CTs-platform-permission-audio-io.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-badge.c b/src/ctc/platform-permission/CTs-platform-permission-badge.c index daa424276..b554bdc3c 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-badge.c +++ b/src/ctc/platform-permission/CTs-platform-permission-badge.c @@ -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); diff --git a/src/ctc/platform-permission/CTs-platform-permission-bluetooth.c b/src/ctc/platform-permission/CTs-platform-permission-bluetooth.c index 0128d5bf4..d855b47db 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-bluetooth.c +++ b/src/ctc/platform-permission/CTs-platform-permission-bluetooth.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-calendar-service.c b/src/ctc/platform-permission/CTs-platform-permission-calendar-service.c index fbc7f4961..d070d2eed 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-calendar-service.c +++ b/src/ctc/platform-permission/CTs-platform-permission-calendar-service.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-camera.c b/src/ctc/platform-permission/CTs-platform-permission-camera.c index 1dfda3d99..f276d5157 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-camera.c +++ b/src/ctc/platform-permission/CTs-platform-permission-camera.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-common.c b/src/ctc/platform-permission/CTs-platform-permission-common.c index e9a7c73bf..487f56f95 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-common.c +++ b/src/ctc/platform-permission/CTs-platform-permission-common.c @@ -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; } diff --git a/src/ctc/platform-permission/CTs-platform-permission-connection.c b/src/ctc/platform-permission/CTs-platform-permission-connection.c index 138fe4060..c1481acda 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-connection.c +++ b/src/ctc/platform-permission/CTs-platform-permission-connection.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-contacts-service.c b/src/ctc/platform-permission/CTs-platform-permission-contacts-service.c index cd0e05445..451ceedb8 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-contacts-service.c +++ b/src/ctc/platform-permission/CTs-platform-permission-contacts-service.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-context.c b/src/ctc/platform-permission/CTs-platform-permission-context.c index e694d6c9b..cabc9b73d 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-context.c +++ b/src/ctc/platform-permission/CTs-platform-permission-context.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-datacontrol.c b/src/ctc/platform-permission/CTs-platform-permission-datacontrol.c index 98338e4f0..d4f25dc88 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-datacontrol.c +++ b/src/ctc/platform-permission/CTs-platform-permission-datacontrol.c @@ -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; diff --git a/src/ctc/platform-permission/CTs-platform-permission-device.c b/src/ctc/platform-permission/CTs-platform-permission-device.c index 86ecdc2ed..6bec0a3c0 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-device.c +++ b/src/ctc/platform-permission/CTs-platform-permission-device.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-efl-util.c b/src/ctc/platform-permission/CTs-platform-permission-efl-util.c index 66524c679..a39323c6c 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-efl-util.c +++ b/src/ctc/platform-permission/CTs-platform-permission-efl-util.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-email.c b/src/ctc/platform-permission/CTs-platform-permission-email.c index 563f4b33a..c52656ed6 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-email.c +++ b/src/ctc/platform-permission/CTs-platform-permission-email.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-http.c b/src/ctc/platform-permission/CTs-platform-permission-http.c index f28b8f1af..895a56d04 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-http.c +++ b/src/ctc/platform-permission/CTs-platform-permission-http.c @@ -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; diff --git a/src/ctc/platform-permission/CTs-platform-permission-ime.c b/src/ctc/platform-permission/CTs-platform-permission-ime.c index cda69dba1..cf4aa71d8 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-ime.c +++ b/src/ctc/platform-permission/CTs-platform-permission-ime.c @@ -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); diff --git a/src/ctc/platform-permission/CTs-platform-permission-inputmethod-manager.c b/src/ctc/platform-permission/CTs-platform-permission-inputmethod-manager.c index 7abd248d0..e54a29259 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-inputmethod-manager.c +++ b/src/ctc/platform-permission/CTs-platform-permission-inputmethod-manager.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-iotcon.c b/src/ctc/platform-permission/CTs-platform-permission-iotcon.c index 254379a62..171aba786 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-iotcon.c +++ b/src/ctc/platform-permission/CTs-platform-permission-iotcon.c @@ -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); + } } diff --git a/src/ctc/platform-permission/CTs-platform-permission-libfeedback.c b/src/ctc/platform-permission/CTs-platform-permission-libfeedback.c index 6cd0b034c..7c80eb1cb 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-libfeedback.c +++ b/src/ctc/platform-permission/CTs-platform-permission-libfeedback.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-location-manager.c b/src/ctc/platform-permission/CTs-platform-permission-location-manager.c index c2b4260e9..5d2ffce71 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-location-manager.c +++ b/src/ctc/platform-permission/CTs-platform-permission-location-manager.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-maps-service.c b/src/ctc/platform-permission/CTs-platform-permission-maps-service.c index f7682031d..112792e10 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-maps-service.c +++ b/src/ctc/platform-permission/CTs-platform-permission-maps-service.c @@ -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); diff --git a/src/ctc/platform-permission/CTs-platform-permission-media-content.c b/src/ctc/platform-permission/CTs-platform-permission-media-content.c index 921d17372..eecec0f48 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-media-content.c +++ b/src/ctc/platform-permission/CTs-platform-permission-media-content.c @@ -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); + } } diff --git a/src/ctc/platform-permission/CTs-platform-permission-media-controller.c b/src/ctc/platform-permission/CTs-platform-permission-media-controller.c index 52353e5cc..2dc57418d 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-media-controller.c +++ b/src/ctc/platform-permission/CTs-platform-permission-media-controller.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-media-streamer.c b/src/ctc/platform-permission/CTs-platform-permission-media-streamer.c index 81cd9b7ef..7c686f49b 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-media-streamer.c +++ b/src/ctc/platform-permission/CTs-platform-permission-media-streamer.c @@ -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); diff --git a/src/ctc/platform-permission/CTs-platform-permission-messages.c b/src/ctc/platform-permission/CTs-platform-permission-messages.c index b959f04d5..70434aec6 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-messages.c +++ b/src/ctc/platform-permission/CTs-platform-permission-messages.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-nfc.c b/src/ctc/platform-permission/CTs-platform-permission-nfc.c index a98ef509f..1dc0099b2 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-nfc.c +++ b/src/ctc/platform-permission/CTs-platform-permission-nfc.c @@ -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(); diff --git a/src/ctc/platform-permission/CTs-platform-permission-notification.c b/src/ctc/platform-permission/CTs-platform-permission-notification.c index ad32efc85..ff1ec00a9 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-notification.c +++ b/src/ctc/platform-permission/CTs-platform-permission-notification.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-oauth2-manager.c b/src/ctc/platform-permission/CTs-platform-permission-oauth2-manager.c index ec7092817..648908fd8 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-oauth2-manager.c +++ b/src/ctc/platform-permission/CTs-platform-permission-oauth2-manager.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-package-manager.c b/src/ctc/platform-permission/CTs-platform-permission-package-manager.c index ed0d2dd4d..6b56c981b 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-package-manager.c +++ b/src/ctc/platform-permission/CTs-platform-permission-package-manager.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-phonenumber-utils.c b/src/ctc/platform-permission/CTs-platform-permission-phonenumber-utils.c index 5c628cfb4..e916e528f 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-phonenumber-utils.c +++ b/src/ctc/platform-permission/CTs-platform-permission-phonenumber-utils.c @@ -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); diff --git a/src/ctc/platform-permission/CTs-platform-permission-recorder.c b/src/ctc/platform-permission/CTs-platform-permission-recorder.c index d1f1213b6..574f2e36d 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-recorder.c +++ b/src/ctc/platform-permission/CTs-platform-permission-recorder.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-runtime-info.c b/src/ctc/platform-permission/CTs-platform-permission-runtime-info.c index 671b07371..00445815f 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-runtime-info.c +++ b/src/ctc/platform-permission/CTs-platform-permission-runtime-info.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-sensor.c b/src/ctc/platform-permission/CTs-platform-permission-sensor.c index 23cc401a9..6e7e332e3 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-sensor.c +++ b/src/ctc/platform-permission/CTs-platform-permission-sensor.c @@ -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; } diff --git a/src/ctc/platform-permission/CTs-platform-permission-service-adaptor-client.c b/src/ctc/platform-permission/CTs-platform-permission-service-adaptor-client.c index dabf297ed..4c81109c4 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-service-adaptor-client.c +++ b/src/ctc/platform-permission/CTs-platform-permission-service-adaptor-client.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-shortcut.c b/src/ctc/platform-permission/CTs-platform-permission-shortcut.c index 664df27c2..64c2c7e69 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-shortcut.c +++ b/src/ctc/platform-permission/CTs-platform-permission-shortcut.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-smartcard.c b/src/ctc/platform-permission/CTs-platform-permission-smartcard.c index 76e4fdebf..370c257dc 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-smartcard.c +++ b/src/ctc/platform-permission/CTs-platform-permission-smartcard.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-sound-manager.c b/src/ctc/platform-permission/CTs-platform-permission-sound-manager.c index 2247fd5a9..3c54aa591 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-sound-manager.c +++ b/src/ctc/platform-permission/CTs-platform-permission-sound-manager.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-sppc.c b/src/ctc/platform-permission/CTs-platform-permission-sppc.c index f97af2529..b199a8b2a 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-sppc.c +++ b/src/ctc/platform-permission/CTs-platform-permission-sppc.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-stt.c b/src/ctc/platform-permission/CTs-platform-permission-stt.c index 73adf2e4f..7b76195e7 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-stt.c +++ b/src/ctc/platform-permission/CTs-platform-permission-stt.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-sync-manager.c b/src/ctc/platform-permission/CTs-platform-permission-sync-manager.c index 2be38d870..c9076992d 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-sync-manager.c +++ b/src/ctc/platform-permission/CTs-platform-permission-sync-manager.c @@ -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; } diff --git a/src/ctc/platform-permission/CTs-platform-permission-telephony.c b/src/ctc/platform-permission/CTs-platform-permission-telephony.c index 6dda335dc..fb5d5788a 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-telephony.c +++ b/src/ctc/platform-permission/CTs-platform-permission-telephony.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-thumbnail-util.c b/src/ctc/platform-permission/CTs-platform-permission-thumbnail-util.c index acdd40da8..7d5673974 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-thumbnail-util.c +++ b/src/ctc/platform-permission/CTs-platform-permission-thumbnail-util.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-url-download.c b/src/ctc/platform-permission/CTs-platform-permission-url-download.c index 2d3b64a9c..6e29d5451 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-url-download.c +++ b/src/ctc/platform-permission/CTs-platform-permission-url-download.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-voice-control.c b/src/ctc/platform-permission/CTs-platform-permission-voice-control.c index a7296ba7f..6e57dff15 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-voice-control.c +++ b/src/ctc/platform-permission/CTs-platform-permission-voice-control.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-vpn-service.c b/src/ctc/platform-permission/CTs-platform-permission-vpn-service.c index 68c981a13..11f3a67be 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-vpn-service.c +++ b/src/ctc/platform-permission/CTs-platform-permission-vpn-service.c @@ -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; } diff --git a/src/ctc/platform-permission/CTs-platform-permission-widget-service.c b/src/ctc/platform-permission/CTs-platform-permission-widget-service.c index 7f9b245a1..c0cfa2c11 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-widget-service.c +++ b/src/ctc/platform-permission/CTs-platform-permission-widget-service.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-widget-viewer.c b/src/ctc/platform-permission/CTs-platform-permission-widget-viewer.c index e9ff00b42..26594f9f5 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-widget-viewer.c +++ b/src/ctc/platform-permission/CTs-platform-permission-widget-viewer.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-wifi-direct.c b/src/ctc/platform-permission/CTs-platform-permission-wifi-direct.c index 8d0f1896f..329daa67d 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-wifi-direct.c +++ b/src/ctc/platform-permission/CTs-platform-permission-wifi-direct.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-wifi-manager.c b/src/ctc/platform-permission/CTs-platform-permission-wifi-manager.c index 92e4c9b8d..1accde7f9 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-wifi-manager.c +++ b/src/ctc/platform-permission/CTs-platform-permission-wifi-manager.c @@ -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 diff --git a/src/ctc/platform-permission/CTs-platform-permission-wifi.c b/src/ctc/platform-permission/CTs-platform-permission-wifi.c index 80690bc99..9fa3bedd7 100755 --- a/src/ctc/platform-permission/CTs-platform-permission-wifi.c +++ b/src/ctc/platform-permission/CTs-platform-permission-wifi.c @@ -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 diff --git a/src/ctc/player/CTs-player-common.c b/src/ctc/player/CTs-player-common.c index 9270f9387..a49a00c4f 100755 --- a/src/ctc/player/CTs-player-common.c +++ b/src/ctc/player/CTs-player-common.c @@ -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; } diff --git a/src/ctc/player/CTs-player.c b/src/ctc/player/CTs-player.c index b87bae4bd..df18e757e 100755 --- a/src/ctc/player/CTs-player.c +++ b/src/ctc/player/CTs-player.c @@ -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 diff --git a/src/ctc/runtime-info/CTs-runtime-info.c b/src/ctc/runtime-info/CTs-runtime-info.c index 21d60919f..9b17635c7 100755 --- a/src/ctc/runtime-info/CTs-runtime-info.c +++ b/src/ctc/runtime-info/CTs-runtime-info.c @@ -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 diff --git a/src/ctc/sensor/CTs-sensor.c b/src/ctc/sensor/CTs-sensor.c index 534740c72..96e32b261 100755 --- a/src/ctc/sensor/CTs-sensor.c +++ b/src/ctc/sensor/CTs-sensor.c @@ -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 diff --git a/src/ctc/sound-manager/CTs-sound-manager.c b/src/ctc/sound-manager/CTs-sound-manager.c index 4e874cfe7..8df2880aa 100755 --- a/src/ctc/sound-manager/CTs-sound-manager.c +++ b/src/ctc/sound-manager/CTs-sound-manager.c @@ -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 diff --git a/src/ctc/system-info/CTs-system-info.c b/src/ctc/system-info/CTs-system-info.c index 7754ff78f..ef3097bdb 100755 --- a/src/ctc/system-info/CTs-system-info.c +++ b/src/ctc/system-info/CTs-system-info.c @@ -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 diff --git a/src/ctc/telephony/CTs-telephony.c b/src/ctc/telephony/CTs-telephony.c index 7894b78bc..765e320c8 100755 --- a/src/ctc/telephony/CTs-telephony.c +++ b/src/ctc/telephony/CTs-telephony.c @@ -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 diff --git a/src/ctc/video-util/CTs-video-util.c b/src/ctc/video-util/CTs-video-util.c index e039305cf..53f9c9432 100755 --- a/src/ctc/video-util/CTs-video-util.c +++ b/src/ctc/video-util/CTs-video-util.c @@ -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 diff --git a/src/ctc/vulkan/CTs-vulkan-draw.c b/src/ctc/vulkan/CTs-vulkan-draw.c index 1624c3a5a..4d1c4e801 100755 --- a/src/ctc/vulkan/CTs-vulkan-draw.c +++ b/src/ctc/vulkan/CTs-vulkan-draw.c @@ -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", diff --git a/src/ctc/vulkan/CTs-vulkan-instance.c b/src/ctc/vulkan/CTs-vulkan-instance.c index 84f56da54..8a8a60efc 100755 --- a/src/ctc/vulkan/CTs-vulkan-instance.c +++ b/src/ctc/vulkan/CTs-vulkan-instance.c @@ -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; } diff --git a/src/ctc/vulkan/tct-vulkan-native.c b/src/ctc/vulkan/tct-vulkan-native.c index 86519aa48..08c540db2 100644 --- a/src/ctc/vulkan/tct-vulkan-native.c +++ b/src/ctc/vulkan/tct-vulkan-native.c @@ -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; } diff --git a/src/ctc/wifi-direct/CTs-wifi-direct.c b/src/ctc/wifi-direct/CTs-wifi-direct.c index 41a419fbc..0d077e647 100755 --- a/src/ctc/wifi-direct/CTs-wifi-direct.c +++ b/src/ctc/wifi-direct/CTs-wifi-direct.c @@ -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 -- 2.34.1