* @description Called before each test, created bundle handle
* @parameter NA
* @return NA
-*/
+*/
void ITs_bundle_startup(void)
{
- struct stat stBuff;
+ struct stat stBuff;
if ( stat(ERR_LOG, &stBuff) == 0 )
{
remove(ERR_LOG);
* @description Called after each test, destroys bundle handle
* @parameter NA
* @return NA
-*/
+*/
void ITs_bundle_cleanup(void)
{
if ( g_bBundleCreation )
* @parameter key: Bundle Key, type: type of value of given key, bundle_keyval_t: The key-value pair handle, user_data: User data sent to callback
* @return NA
*/
-void KeyValuePairInBundleCallback(const char *key, const int type, const bundle_keyval_t *kv, void *user_data)
+void KeyValuePairInBundleCallback(const char *key, const int type, const bundle_keyval_t *kv, void *user_data)
{
g_BundlestKeyVal = (bundle_keyval_t *)kv;
PRINT_RESULT(BUNDLE_ERROR_NONE, nRetVal, "bundle_del", BundleGetError(nRetVal));
return 1;
}
- else
+ else
{
int nCount = 0;
for ( nCount =0; nCount < nStringArrayLength; nCount++ )
{
- if ( strcmp(pszStringArray[nCount], pStringArrayOutput[nCount]) != 0 )//not equal
+ if ( strcmp(pszStringArray[nCount], pStringArrayOutput[nCount]) != 0 )//not equal
{
FPRINTF("[Line : %d][%s]bundle_get_str_array failed, as returned values of getByte Array %d element not matched with original Value %s\\n", __LINE__, API_NAMESPACE, nCount, pStringArrayOutput[nCount]);
nRetVal = bundle_del(g_bundle, (char *)KEY1);
PRINT_RESULT(BUNDLE_ERROR_NONE, nRetVal, "bundle_del", BundleGetError(nRetVal));
- return 1;
+ return 1;
}
}
}
* @scenario Create a Bundle\n
* Adds a key-value pair into bundle\n
* Frees given bundle object with key-value pairs in it
-* @apicovered bundle_create, bundle_add_str, bundle_free
+* @apicovered bundle_create, bundle_add_str, bundle_free
* @passcase When bundle_create, or bundle_free are successful.
* @failcase If target API's bundle_create or bundle_free fails or any precondition or postcondition API fails
* @precondition Bundle must be created
* @type auto
* @description Adds a byte type key-value pair into a given bundle And Gets a value from a given byte key
* @scenario Adds a byte type key-value pair into a given bundle And Gets a value from a given byte key
-* @apicovered bundle_add_byte, bundle_get_byte
+* @apicovered bundle_add_byte, bundle_get_byte
* @passcase When bundle_add_byte, bundle_get_byteare successful.
* @failcase If target API's bundle_add_byte or bundle_get_byte fails or any precondition or postcondition API fails
* @precondition Bundle must be created
}
nRetVal = bundle_del(g_bundle, (char *)szKeyByte);
- PRINT_RESULT(BUNDLE_ERROR_NONE, nRetVal, "bundle_del", BundleGetError(nRetVal));
+ PRINT_RESULT(BUNDLE_ERROR_NONE, nRetVal, "bundle_del", BundleGetError(nRetVal));
return 0;
}
* @type auto
* @description Adds a String type key-value pair into a given bundle And Gets a value from a given String key
* @scenario Adds a String type key-value pair into a given bundle And Gets a value from a given String key
-* @apicovered bundle_add_str, bundle_get_str
+* @apicovered bundle_add_str, bundle_get_str
* @passcase When bundle_add_str, bundle_get_str are successful.
* @failcase If target API's bundle_add_str or bundle_get_str fails or any precondition or postcondition API fails
* @precondition Bundle must be created
START_TEST;
int nRetVal = bundle_add_str(g_bundle, (char *)KEY1, (char *)KEY1_VALUE);
- PRINT_RESULT(BUNDLE_ERROR_NONE, nRetVal, "bundle_add_str", BundleGetError(nRetVal));
+ PRINT_RESULT(BUNDLE_ERROR_NONE, nRetVal, "bundle_add_str", BundleGetError(nRetVal));
char *tempStrValue = NULL;
nRetVal = bundle_get_str(g_bundle, (char *)KEY1, &tempStrValue);
FPRINTF("[Line : %d][%s] bundle_get_str failed, error returned = %s for key = %s\\n", __LINE__, API_NAMESPACE, BundleGetError(nRetVal), (char *)KEY1);
nRetVal = bundle_del(g_bundle, (char *)KEY1);
- PRINT_RESULT(BUNDLE_ERROR_NONE, nRetVal, "bundle_del", BundleGetError(nRetVal));
+ PRINT_RESULT(BUNDLE_ERROR_NONE, nRetVal, "bundle_del", BundleGetError(nRetVal));
return 1;
}
- nRetVal = bundle_del(g_bundle, (char *)KEY1);
- PRINT_RESULT(BUNDLE_ERROR_NONE, nRetVal, "bundle_del", BundleGetError(nRetVal));
+ nRetVal = bundle_del(g_bundle, (char *)KEY1);
+ PRINT_RESULT(BUNDLE_ERROR_NONE, nRetVal, "bundle_del", BundleGetError(nRetVal));
return 0;
}
* @author SRID(m.khalid)
* @reviewer SRID(gupta.sanjay)
* @type auto
-* @description Get the Type of Key Values added in the Bundle and Deletes added key-value pair from the given bundle
+* @description Get the Type of Key Values added in the Bundle and Deletes added key-value pair from the given bundle
* @scenario Adds byte and string type key-value pair into a given bundle\n
* Gets the type of added key-values pairs of the given bundle\n
* Delete the added key values pair from the given bundle
-* @apicovered bundle_get_type, bundle_del
+* @apicovered bundle_get_type, bundle_del
* @passcase Whenbundle_get_type, bundle_del are successful.
* @failcase If target API's bundle_get_type or bundle_del fails or any precondition or postcondition API fails
* @precondition Bundle must be created
snprintf(szValue, sizeof(szValue)-1, "VALUE%d", 1);
int nRetVal = bundle_add_str(g_bundle, szKey, szValue);
- PRINT_RESULT(BUNDLE_ERROR_NONE, nRetVal, "bundle_add_str", BundleGetError(nRetVal));
+ PRINT_RESULT(BUNDLE_ERROR_NONE, nRetVal, "bundle_add_str", BundleGetError(nRetVal));
char szKeyByte[20] = {0};
char szValueByte[20] = {0};
snprintf(szValueByte, sizeof(szValueByte)-1, "VALUE%dB", 1);
nRetVal = bundle_add_byte(g_bundle, szKeyByte, szValueByte, 20);
- PRINT_RESULT(BUNDLE_ERROR_NONE, nRetVal, "bundle_add_byte", BundleGetError(nRetVal));
+ PRINT_RESULT(BUNDLE_ERROR_NONE, nRetVal, "bundle_add_byte", BundleGetError(nRetVal));
nRetVal = bundle_get_type(g_bundle, (char *)szKey);
PRINT_RESULT_CLEANUP(BUNDLE_TYPE_STR, nRetVal, "bundle_get_type", BundleGetError(nRetVal),
- bundle_del(g_bundle, (char *)szKey);nRetVal = bundle_del(g_bundle, (char *)szKeyByte));
+ bundle_del(g_bundle, (char *)szKey);nRetVal = bundle_del(g_bundle, (char *)szKeyByte));
nRetVal = bundle_get_type(g_bundle, (char *)szKeyByte);
PRINT_RESULT_CLEANUP(BUNDLE_TYPE_BYTE, nRetVal, "bundle_get_type", BundleGetError(nRetVal),
- bundle_del(g_bundle, (char *)szKey);nRetVal = bundle_del(g_bundle, (char *)szKeyByte));
+ bundle_del(g_bundle, (char *)szKey);nRetVal = bundle_del(g_bundle, (char *)szKeyByte));
nRetVal = bundle_del(g_bundle, (char *)szKey);
PRINT_RESULT_CLEANUP(BUNDLE_ERROR_NONE, nRetVal, "bundle_get_type", BundleGetError(nRetVal),
- bundle_del(g_bundle, (char *)szKey);nRetVal = bundle_del(g_bundle, (char *)szKeyByte));
+ bundle_del(g_bundle, (char *)szKey);nRetVal = bundle_del(g_bundle, (char *)szKeyByte));
nRetVal = bundle_del(g_bundle, (char *)szKeyByte);
PRINT_RESULT(BUNDLE_ERROR_NONE, nRetVal, "bundle_del", BundleGetError(nRetVal));
}
nRetVal = bundle_keyval_get_type(g_BundlestKeyVal);
- if (nRetVal < 0)
+ if (nRetVal < 0)
{
g_BundlestKeyVal = NULL;
FPRINTF("[Line : %d][%s] bundle_foreach failed, with key %s\\n", __LINE__, API_NAMESPACE, szKey);
nRetVal = bundle_keyval_type_is_array(g_BundlestKeyVal);
if ( nRetVal != BUNDLE_ERROR_NONE )
{
- g_BundlestKeyVal = NULL;
+ g_BundlestKeyVal = NULL;
FPRINTF("[Line : %d][%s] bundle_foreach failed, with key %s\\n", __LINE__, API_NAMESPACE, szKey);
nRetVal = bundle_del(g_bundle, szKey);
PRINT_RESULT(BUNDLE_ERROR_NONE, nRetVal, "bundle_del", BundleGetError(nRetVal));
size_t nBasicSize = 0;
nRetVal = bundle_keyval_get_basic_val(g_BundlestKeyVal, &pBasicVal, &nBasicSize);
- if (nRetVal != BUNDLE_ERROR_NONE || pBasicVal == NULL || (strcmp(szValue, (char *)pBasicVal) != 0) || (nBasicSize == 0))
+ if (nRetVal != BUNDLE_ERROR_NONE || pBasicVal == NULL || (strcmp(szValue, (char *)pBasicVal) != 0) || (nBasicSize == 0))
{
FPRINTF("[Line : %d][%s] bundle_keyval_get_basic_val failed, with key = %s as returned basic value = %s and expected returned value = %s\\n", __LINE__, API_NAMESPACE, szKey, (char *)pBasicVal, szValue);
g_BundlestKeyVal = NULL;
const int nStringArrayLength = 3;
nRetVal = bundle_add_str_array(g_bundle, (const char *)szKey, pszStringArray, nStringArrayLength); // add a String array
PRINT_RESULT(BUNDLE_ERROR_NONE, nRetVal, "bundle_add_str_array", BundleGetError(nRetVal));
- bundle_foreach(g_bundle, KeyValuePairInBundleCallback, NULL);
+ bundle_foreach(g_bundle, KeyValuePairInBundleCallback, NULL);
if ( g_BundlestKeyVal == NULL )
{
}
nRetVal = bundle_keyval_type_is_array(g_BundlestKeyVal);
- if (nRetVal != 1)
+ if (nRetVal != 1)
{
FPRINTF("[Line : %d][%s] The ErrorCode = %s\\n", __LINE__, API_NAMESPACE, BundleGetError(nRetVal));
FPRINTF("[Line : %d][%s] bundle_keyval_type_is_array failed, with key = %s\\n", __LINE__, API_NAMESPACE, szKey);
g_BundlestKeyVal = NULL;
nRetVal = bundle_del(g_bundle, szKey);
- PRINT_RESULT(BUNDLE_ERROR_NONE, nRetVal, "bundle_del", BundleGetError(nRetVal));
- return 1;
+ PRINT_RESULT(BUNDLE_ERROR_NONE, nRetVal, "bundle_del", BundleGetError(nRetVal));
+ return 1;
}
void **pKeyValueArray = NULL;
pKeyValueArray = NULL;
pKeyValueArrayElemSize = NULL;
nRetVal = bundle_del(g_bundle, szKey);
- PRINT_RESULT(BUNDLE_ERROR_NONE, nRetVal, "bundle_del", BundleGetError(nRetVal));
+ PRINT_RESULT(BUNDLE_ERROR_NONE, nRetVal, "bundle_del", BundleGetError(nRetVal));
return 1;
}
pKeyValueArrayElemSize = NULL;
g_BundlestKeyVal = NULL;
nRetVal = bundle_del(g_bundle, szKey);
- PRINT_RESULT(BUNDLE_ERROR_NONE, nRetVal, "bundle_del", BundleGetError(nRetVal));
+ PRINT_RESULT(BUNDLE_ERROR_NONE, nRetVal, "bundle_del", BundleGetError(nRetVal));
return 0;
}
char szValue[20] = {0};
int nCounter = 0;
- nRetVal = bundle_add_str(g_bundle,(char *)KEY1, (char *)KEY1_VALUE);
- PRINT_RESULT(BUNDLE_ERROR_NONE, nRetVal, "bundle_add_str", BundleGetError(nRetVal));
+ nRetVal = bundle_add_str(g_bundle,(char *)KEY1, (char *)KEY1_VALUE);
+ PRINT_RESULT(BUNDLE_ERROR_NONE, nRetVal, "bundle_add_str", BundleGetError(nRetVal));
nCounter++;
- nRetVal = bundle_add_str(g_bundle,(char *)KEY2, (char *)KEY2_VALUE);
+ nRetVal = bundle_add_str(g_bundle,(char *)KEY2, (char *)KEY2_VALUE);
PRINT_RESULT_CLEANUP(BUNDLE_ERROR_NONE, nRetVal, "bundle_add_str", BundleGetError(nRetVal),
- bundle_del(g_bundle,(char *)KEY1));
+ bundle_del(g_bundle,(char *)KEY1));
nCounter++;
snprintf(szKey, sizeof(szKey)-1, "KEY%d", 1);
snprintf(szValue, sizeof(szValue)-1, "VALUE%d", 1);
- nRetVal = bundle_add_str(g_bundle,szKey, szValue);
- PRINT_RESULT_CLEANUP(BUNDLE_ERROR_NONE, nRetVal, "bundle_add_str", BundleGetError(nRetVal) ,
+ nRetVal = bundle_add_str(g_bundle,szKey, szValue);
+ PRINT_RESULT_CLEANUP(BUNDLE_ERROR_NONE, nRetVal, "bundle_add_str", BundleGetError(nRetVal) ,
bundle_del(g_bundle,(char *)KEY1);bundle_del(g_bundle,(char *)KEY2));
nCounter++;
nRetVal = bundle_get_count(g_bundle);
- if (nRetVal != nCounter)
+ if (nRetVal != nCounter)
{
FPRINTF("[Line : %d][%s] bundle_get_count failed, as Actual Count = %d not equal to expected count = %d\\n", __LINE__, API_NAMESPACE, nRetVal, nCounter);
bundle_del(g_bundle,(char *)KEY1);
nRetVal = bundle_del(g_bundle,(char *)KEY1);
PRINT_RESULT_CLEANUP(BUNDLE_ERROR_NONE, nRetVal, "bundle_del", BundleGetError(nRetVal) ,
- bundle_del(g_bundle,(char *)KEY2);bundle_del(g_bundle, szKey));
+ bundle_del(g_bundle,(char *)KEY2);bundle_del(g_bundle, szKey));
nRetVal = bundle_del(g_bundle,(char *)KEY2);
PRINT_RESULT_CLEANUP(BUNDLE_ERROR_NONE, nRetVal, "bundle_del", BundleGetError(nRetVal),
- bundle_del(g_bundle, szKey));
+ bundle_del(g_bundle, szKey));
nRetVal = bundle_del(g_bundle, szKey);
- PRINT_RESULT(BUNDLE_ERROR_NONE, nRetVal, "bundle_del", BundleGetError(nRetVal));
+ PRINT_RESULT(BUNDLE_ERROR_NONE, nRetVal, "bundle_del", BundleGetError(nRetVal));
return 0;
}
CHECK_HANDLE(byte_array, "bundle_get_byte_array");
if(len <= 0 || arrELementSize == NULL || arrELementSize[0] != 4 || arrELementSize[1] != 4 || arrELementSize[2] != 4)
{
- FPRINTF("[Line : %d][%s] bundle_get_byte_array failed, element size is wrong\\n", __LINE__, API_NAMESPACE, BundleGetError(nRetVal));
+ FPRINTF("[Line : %d][%s] bundle_get_byte_array failed, element size is wrong, error returned [%s]\\n", __LINE__, API_NAMESPACE, BundleGetError(nRetVal));
return 1;
}