[ITC][bundle][NonACR] Removed warnings and whitespaces 09/284309/2
authorPrashant Kumar Jangid <p.jangid@samsung.com>
Tue, 15 Nov 2022 08:12:27 +0000 (13:42 +0530)
committerPrashant Kumar Jangid <p.jangid@samsung.com>
Tue, 15 Nov 2022 08:50:20 +0000 (14:20 +0530)
Change-Id: Id0f77640f5add12356676539242e6f1fc0317e3c
Signed-off-by: Prashant Kumar Jangid <p.jangid@samsung.com>
src/itc/bundle/ITs-bundle.c

index 2f6bde456f1c4743a7ded9f18ce922bc68233c89..41e690f5af02245e0fa6489385d60e77289924c6 100755 (executable)
@@ -32,10 +32,10 @@ static GMainLoop *mainloop;
 * @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);
@@ -77,7 +77,7 @@ void ITs_bundle_startup(void)
 * @description         Called after each test, destroys bundle handle
 * @parameter           NA
 * @return                      NA
-*/ 
+*/
 void ITs_bundle_cleanup(void)
 {
        if ( g_bBundleCreation )
@@ -105,7 +105,7 @@ void ITs_bundle_cleanup(void)
 * @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;
 
@@ -221,17 +221,17 @@ int ITc_bundle_add_get_str_array_p(void)
                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;
                        }
                }
        }
@@ -253,7 +253,7 @@ int ITc_bundle_add_get_str_array_p(void)
 * @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
@@ -293,7 +293,7 @@ int ITc_bundle_create_add_str_free_p(void)
 * @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
@@ -324,7 +324,7 @@ int ITc_bundle_add_get_byte_p(void)
        }
 
        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;
 }
@@ -339,7 +339,7 @@ int ITc_bundle_add_get_byte_p(void)
 * @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
@@ -350,7 +350,7 @@ int ITc_bundle_add_get_str_p(void)
        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);
@@ -364,12 +364,12 @@ int ITc_bundle_add_get_str_p(void)
                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;
 }
@@ -382,11 +382,11 @@ int ITc_bundle_add_get_str_p(void)
 * @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
@@ -403,7 +403,7 @@ int ITc_bundle_get_type_del_p(void)
        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};
@@ -411,19 +411,19 @@ int ITc_bundle_get_type_del_p(void)
        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));
@@ -476,7 +476,7 @@ int ITc_bundle_key_val_target_apis_p(void)
        }
 
        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);
@@ -490,7 +490,7 @@ int ITc_bundle_key_val_target_apis_p(void)
        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));
@@ -501,7 +501,7 @@ int ITc_bundle_key_val_target_apis_p(void)
        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;
@@ -522,7 +522,7 @@ int ITc_bundle_key_val_target_apis_p(void)
        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 )
        {
@@ -533,14 +533,14 @@ int ITc_bundle_key_val_target_apis_p(void)
        }
 
        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;
@@ -556,7 +556,7 @@ int ITc_bundle_key_val_target_apis_p(void)
                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;
        }
 
@@ -564,7 +564,7 @@ int ITc_bundle_key_val_target_apis_p(void)
        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;
 }
 
@@ -596,25 +596,25 @@ int ITc_bundle_get_count_p(void)
        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);
@@ -625,14 +625,14 @@ int ITc_bundle_get_count_p(void)
 
        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;
 }
@@ -772,7 +772,7 @@ int ITc_bundle_set_get_byte_array_p(void)
        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;
        }