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
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
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
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
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 )
return false;
}
- strcpy(pszPath, pszFilePath);
+ strncpy(pszPath, pszFilePath, strlen(pszFilePath)+1);
if ( IsPathValid(pszFilePath) == false )
{
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 )
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);
}
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;
}
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
*/
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);
}
return false;
}
-/** @} */ //end of ctc-libstorage
\ No newline at end of file
+/** @} */ //end of ctc-libstorage
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
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
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);
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
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)
#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 )
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
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
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
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
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) {
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
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
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);
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;
}
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
* @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);
}
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
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
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
}
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;
}
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
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
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
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
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;
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;
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;
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
*/
char *EFLUTILGetError(int nResult)
{
- char *pszErrorMsg = NULL;
+ char *pszErrorMsg = "UNDEFINED ERROR \n";
switch ( 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;
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
*/
char* EmailGetError(int nRet)
{
- char *szErrorVal = NULL;
+ char *szErrorVal = "Undefined Error";
switch ( 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;
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
*/
char* HttpGetError(int nRet)
{
- char *szErrorVal = NULL;
+ char *szErrorVal = "Unknown Error";
switch ( 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;
}
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;
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);
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
*/
char* IotConGetError(int nRet)
{
- char *szErrorVal = NULL;
+ char *szErrorVal = "Unknown Error";
switch ( nRet )
{
case IOTCON_ERROR_NONE: szErrorVal = "IOTCON_ERROR_NONE"; break;
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;
}
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);
+ }
}
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
*/
char* LocationManagerGetError(location_error_e nRet)
{
- char *szErrorVal = NULL;
+ char *szErrorVal = "Unknown Error";
switch ( nRet )
{
case LOCATIONS_ERROR_NONE: szErrorVal = "LOCATIONS_ERROR_NONE"; break;
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;
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
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
}
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);
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();
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);
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);
}
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);
+ }
}
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
*/
char* MediaStreamerGetError(int nRet)
{
- char *szErrorVal = NULL;
+ char *szErrorVal = "Unknown Error";
switch ( nRet )
{
case MEDIA_STREAMER_ERROR_NONE: szErrorVal = "MEDIA_STREAMER_ERROR_NONE"; break;
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;
}
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);
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
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();
*/
char* NotificationGetError(int nRet)
{
- char *szErrorVal = NULL;
+ char *szErrorVal = "Unknown Error";
switch ( nRet )
{
case NOTIFICATION_ERROR_NONE: szErrorVal = "NOTIFICATION_ERROR_NONE"; break;
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;
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
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
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
*/
char *PhoneNumberUtilsGetError(int nRet)
{
- char *szErrorVal = NULL;
+ char *szErrorVal = "Unknown Error";
switch ( nRet )
{
case PHONE_NUMBER_ERROR_NONE: szErrorVal = "PHONE_NUMBER_ERROR_NONE"; break;
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;
}
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);
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
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
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
*/
char* SensorGetType(sensor_type_e nSensorType)
{
- char *szErrorVal = NULL;
+ char *szErrorVal = "Unknown Error";
switch ( nSensorType )
{
case SENSOR_ACCELEROMETER: szErrorVal = "SENSOR_ACCELEROMETER"; break;
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;
}
sync_context->cb_is_finished = FALSE;
g_mutex_clear(&(sync_context->mutex));
g_cond_clear(&sync_context->cond);
+ FREE_MEMORY(sync_context);
}
}
/**
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);
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
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
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
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
*/
char* PushServiceGetError(int nRet)
{
- char *szErrorVal = NULL;
+ char *szErrorVal = "UNKNOWN_ERROR";
switch ( 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;
}
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
*/
char* SttGetError(stt_error_e nError)
{
- char *szErrorVal = NULL;
+ char *szErrorVal = "Undefined Error";
switch ( nError )
{
case STT_ERROR_NONE: szErrorVal = "STT_ERROR_NONE"; break;
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;
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
*/
char* SyncManagerGetError(int nRet)
{
- char *szErrorVal = NULL;
+ char *szErrorVal = "SYNC_ERROR_UNKNOWN";
switch ( nRet )
{
case SYNC_ERROR_NONE: szErrorVal = "SYNC_ERROR_NONE"; break;
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;
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
#if DEBUG
FPRINTF("[Line : %d][%s] SyncAdapterStartCallback callback called\\n", __LINE__, API_NAMESPACE);
#endif
+ return true;
}
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
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;
}
*/
char* ThumbnailUtilGetError(int nRet)
{
- char *szErrorVal = NULL;
+ char *szErrorVal = "Unknown Error";
switch ( nRet )
{
case THUMBNAIL_UTIL_ERROR_NONE:
case THUMBNAIL_UTIL_ERROR_PERMISSION_DENIED:
szErrorVal = "THUMBNAIL_UTIL_ERROR_PERMISSION_DENIED";
break;
- default:
- szErrorVal = "Unknown Error";
- break;
}
return szErrorVal;
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
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
*/
char* VoiceControlGetError(int nRet)
{
- char *szErrorVal = NULL;
+ char *szErrorVal = "VC_ERROR_UNKNOWN";
switch ( nRet )
{
case VC_ERROR_NONE: szErrorVal = "VC_ERROR_NONE"; break;
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;
}
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
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
*/
char *VPNSVCGetError(int nResult)
{
- char *pszErrorMsg = NULL;
+ char *pszErrorMsg = "UNDEFINED ERROR \n";
switch ( nResult )
{
case VPNSVC_ERROR_NOT_SUPPORTED :
pszErrorMsg = "VPNSVC_ERROR_NOT_SUPPORTED \n";
break;
- default:
- pszErrorMsg = "UNDEFINED ERROR \n";
- break;
}
return pszErrorMsg;
}
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
*/
char* WidgetViewerGetError(int nRet)
{
- char *szErrorVal = NULL;
+ char *szErrorVal = "UNKNOWN ERROR";
switch(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;
}
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
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
*/
char* WifiManagerGetError(int nRet)
{
- char *pszErrorVal = NULL;
+ char *pszErrorVal = "Unknown Error";
switch ( 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;
}
/**
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
*/
char* Wifi_PrintErrorInfo(int nResult)
{
- char* pszErrInfo = NULL;
+ char* pszErrInfo = "UNKNOWN ERROR";
switch ( nResult )
{
case WIFI_ERROR_NONE: pszErrInfo = "WIFI_ERROR_NONE"; break;
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;
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
*/
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;
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;
}
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);
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;
}
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
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
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
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
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
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
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
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;
}
*/
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;
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",
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;
} 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;
}
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;
}
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