if(g_hLocDisp != NULL)
{
int nRet =i18n_loc_disp_names_destroy(g_hLocDisp);
- FPRINTF(I18N_ERROR_NONE, nRet, "i18n_loc_disp_names_destroy", BaseUtilsGetError(nRet));
+ FPRINTF("[Line : %d][%s] g_hLocDisp handle destroy failed. \\n", __LINE__, API_NAMESPACE);
g_hLocDisp = NULL;
}
return;
if(hLocDisp == NULL)
{
FPRINTF("[Line : %d][%s] hLocDisp handle creation failed. dialect = %d. \\n", __LINE__, API_NAMESPACE,eDialect[nCounter]);
- bLocaleFail = false;
+ bLocaleFail = true;
}
else
{
int nRet = i18n_loc_disp_names_get_context(g_hLocDisp, eType[nCounter], &eContext);
PRINT_RESULT(I18N_ERROR_NONE, nRet, "i18n_loc_disp_names_get_context", BaseUtilsGetError(nRet));
- if( !(eContext == (eType[nCounter] << 8 + 0) || eContext == (eType[nCounter] << 8 + 1) || eContext == (eType[nCounter] << 8 + 1) || eContext == (eType[nCounter]<< 8 + 2) || eContext == (eType[nCounter] << 8 + 3) || eContext == (eType[nCounter]<< 8 + 4) ))
+ if( !(eContext == (eType[nCounter] << 8 + 0) || eContext == (eType[nCounter] << 8 + 1) || eContext == (eType[nCounter]<< 8 + 2) || eContext == (eType[nCounter] << 8 + 3) || eContext == (eType[nCounter]<< 8 + 4) ))
{
FPRINTF("[Line : %d][%s] i18n_loc_disp_names_get_context mismatch. eContext = %d. \\n", __LINE__, API_NAMESPACE, eContext);
bContext = true;
bool InmConnectionStateChangedCallback(inm_connection_state_e state, void* user_data)
{
- char *pszProfileName;
+ char *pszProfileName = NULL;
inm_connection_h profile = user_data;
if (profile == NULL)
- return;
+ return false;
int nRet = inm_connection_get_name(profile, NULL);
PRINT_RETURN("inm_connection_get_name", nRet);
if (nRet != INM_ERROR_NONE) {
FREE_MEMORY_TC(pszProfileName);
- return;
+ return false;
}
g_nCallbackRet = true;
FREE_MEMORY_TC(pszProfileName);
+ return true;
}
bool InmWifiApForeachVsieCallback(unsigned char *vsie_bytes, int vsie_len, void *user_data)
int nStatTypeSize = sizeof(eStatType)/sizeof(eStatType[0]);
int nConnectionTypeSize = sizeof(eConnectionType)/sizeof(eConnectionType[0]);
- for(int connectionTypeIndex = 0; connectionTypeIndex<nConnectionTypeSize; connectionTypeIndex++)
+ for(int connectionTypeIndex = 0; connectionTypeIndex < nConnectionTypeSize; connectionTypeIndex++)
{
- for(int statTypeIndex = 0; statTypeIndex<=nStatTypeSize; statTypeIndex++)
+ for(int statTypeIndex = 0; statTypeIndex < nStatTypeSize; statTypeIndex++)
{
llStat=0;
nRet = inm_get_statistics(g_hInm, eConnectionType[connectionTypeIndex], eStatType[statTypeIndex], &llStat);
return 0;
}
PRINT_RESULT(nRet, INM_ERROR_NONE, "inm_get_statistics", InmGetError(nRet));
- if(llStat<0)
+
+// This variable needs to be checked whether within range.
+/* if(llStat< 0)
{
FPRINTF("[Line : %d][%s] %s failed. Stat value = %ull\\n", __LINE__, API_NAMESPACE, "inm_get_statistics", llStat);
return 1;
}
+*/
}
}
int nStatTypeSize = sizeof(eStatType)/sizeof(eStatType[0]);
int nConnectionTypeSize = sizeof(eConnectionType)/sizeof(eConnectionType[0]);
- for(int connectionTypeIndex = 0; connectionTypeIndex<nConnectionTypeSize; connectionTypeIndex++)
+ for(int connectionTypeIndex = 0; connectionTypeIndex < nConnectionTypeSize; connectionTypeIndex++)
{
- for(int statTypeIndex = 0; statTypeIndex<=nStatTypeSize; statTypeIndex++)
+ for(int statTypeIndex = 0; statTypeIndex < nStatTypeSize; statTypeIndex++)
{
nRet = inm_reset_statistics(g_hInm, eConnectionType[connectionTypeIndex], eStatType[statTypeIndex]);
if(!bConnectionTypeFeatureChecks[connectionTypeIndex])
{
START_TEST_CHECK_INITIALIZE
int nRet = 0;
- const char *sSid = "ABCDEFGH";
+ const char sSid[] = "ABCDEFGH";
nRet = softap_set_ssid(g_hSoftapHandle, sSid);
PRINT_RESULT(SOFTAP_ERROR_NONE, nRet, "softap_set_ssid", SoftApGetError(nRet));
nRet = softap_get_ssid(g_hSoftapHandle, &sRetSid);
PRINT_RESULT_CLEANUP(SOFTAP_ERROR_NONE, nRet, "softap_get_ssid", SoftApGetError(nRet),FREE_MEMORY(sRetSid));
- if(strncmp(sSid, sRetSid,sizeof(sSid)) != 0)
+ if(strncmp(sSid, sRetSid, sizeof(sSid)) != 0)
{
FPRINTF("\\n[Line : %d][%s] softap_get_ssid Failed returned wrong value = %s, error returned = %s", __LINE__, API_NAMESPACE, sRetSid, SoftApGetError(nRet));
- if(sRetSid)
- FREE_MEMORY(sRetSid);
- return 1;
+ FREE_MEMORY(sRetSid);
+ return 1;
}
- if(sRetSid)
- FREE_MEMORY(sRetSid);
+ FREE_MEMORY(sRetSid);
return 0;
}
//& purpose: Set and get ssid visibility.
int nEnumSize = sizeof(eSetMode) / sizeof(eSetMode[0]);
int enum_counter = 0;
softap_wireless_mode_e eGetMode;
- for(int enum_counter = 0; enum_counter < nEnumSize; enum_counter)
+ for(int enum_counter = 0; enum_counter < nEnumSize; enum_counter++)
{
nRet = softap_set_mode(g_hSoftapHandle, eSetMode[enum_counter]);
PRINT_RESULT(SOFTAP_ERROR_NONE, nRet, "softap_set_mode", SoftApGetError(nRet));
}
if(g_bMediaContentStartup && g_bIsScanFeatureSupported)
{
- remove("audio");
+ struct stat stBuff;
+ if ( stat("audio", &stBuff) == 0 )
+ {
+ if (remove("audio"))
+ {
+ FPRINTF("[Line : %d][%s] TEST SUIT clean-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+ }
+ }
if(g_szAudioPath)
{
media_content_scan_file(g_szAudioPath);
}
if(g_bMediaContentStartup && g_bIsScanFeatureSupported)
{
- remove("image");
+ struct stat stBuff;
+ if ( stat("image", &stBuff) == 0 )
+ {
+ if (remove("image"))
+ {
+ FPRINTF("[Line : %d][%s] TEST SUIT clean-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+ }
+ }
if(g_szImagePath)
{
media_content_scan_file(g_szImagePath);
nRet = media_info_get_media_id(g_hAudioInfo, &pszMediaId);
PRINT_RESULT(MEDIA_CONTENT_ERROR_NONE, nRet, "media_info_get_media_id", MediaContentGetError(nRet));
memset(g_szAudioId, 0, PATHLEN);
- strcpy(g_szAudioId, pszMediaId);
+ strncpy(g_szAudioId, pszMediaId, sizeof(g_szAudioId));
FREE_MEMORY(pszMediaId);
return 0;
}
if(g_bMediaContentStartup && g_bIsScanFeatureSupported)
{
- remove("video");
+ struct stat stBuff;
+ if ( stat("video", &stBuff) == 0 )
+ {
+ if (remove("video"))
+ {
+ FPRINTF("[Line : %d][%s] TEST SUIT clean-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
+ }
+ }
if(g_szVideoPath)
{
media_content_scan_file(g_szVideoPath);
PRINT_RESULT(nRet, WIFI_MANAGER_ERROR_NONE, "wifi_manager_config_get_dns_address", WifiManagerGetError(nRet));
CHECK_HANDLE(pszGetdnsAddress, "wifi_manager_config_get_dns_address");
- if( strncmp(pszGetdnsAddress, pszSetDnsAddress[nOrderIndex], sizeof (pszGetdnsAddress)) != 0)
+ if( strncmp(pszSetDnsAddress[nOrderIndex], pszGetdnsAddress, sizeof(pszSetDnsAddress[nOrderIndex])) != 0)
{
FPRINTF("[Line : %d][%s] %s failed. mismatch in expected: %s and returned: %s\\n", __LINE__,API_NAMESPACE, "wifi_manager_config_set_get_dns_address", pszSetDnsAddress[nOrderIndex], pszGetdnsAddress);
FREE_MEMORY(pszGetdnsAddress);