Fix style issues 04/259104/1
authorrohit singh <rohit.singh@samsung.com>
Tue, 1 Jun 2021 06:39:51 +0000 (12:09 +0530)
committerrohit singh <rohit.singh@samsung.com>
Tue, 1 Jun 2021 06:41:17 +0000 (12:11 +0530)
This patches fixes the styles issues as shown
in the check-patch script.

Change-Id: I56ffcc8854804fc2fc80c67317b195f62d3c6492
Signed-off-by: rohit.singh <rohit.singh@samsung.com>
tests/unittest/include/assert_local.h
tests/unittest/include/tct_common.h
tests/unittest/include/testcase.h
tests/unittest/utc-user-awareness-common.h

index c45ab91749ba0a1b72687dc9b62be0a36cc7f2a5..f274096705841f42dc89e8dd2f597f7f511b73f4 100755 (executable)
@@ -25,94 +25,94 @@ extern "C" {
 #endif
 
 #define assert(exp) \
-    do { \
-        if (!(exp)) { \
-            fprintf(stderr, \
-                "\n[TCT][%s][Line : %d] Assert Fail; Following expression is not true: %s\n", \
-                __FILE__, __LINE__, #exp); \
-            return 1; \
-        } \
-    } while (0)
+       do { \
+               if (!(exp)) { \
+                       fprintf(stderr, \
+                                       "\n[TCT][%s][Line : %d] Assert Fail; Following expression is not true: %s\n", \
+                                       __FILE__, __LINE__, #exp); \
+                       return 1; \
+               } \
+       } while (0)
 
 #define assert_eq(var, ref) \
-    do { \
-        if (var != ref) { \
-            fprintf(stderr, \
-                "\n[TCT][%s][Line : %d] Assert fail; Values (%s == 0x%x) and (%s == 0x%x) are not equal\n", \
-                __FILE__, __LINE__, #var, (int)var, #ref, (int)ref); \
-            return 1; \
-        } \
-    } while (0)
+       do { \
+               if (var != ref) { \
+                       fprintf(stderr, \
+                                       "\n[TCT][%s][Line : %d] Assert fail; Values (%s == 0x%x) and (%s == 0x%x) are not equal\n", \
+                                       __FILE__, __LINE__, #var, (int)var, #ref, (int)ref); \
+                       return 1; \
+               } \
+       } while (0)
 
 #define assert_eq_no_return(var, ref) \
-    do { \
-        if (var != ref) { \
-            fprintf(stderr, \
-                "\n[TCT][%s][Line : %d] Assert fail; Values (%s == 0x%x) and (%s == 0x%x) are not equal\n", \
-                __FILE__, __LINE__, #var, (int)var, #ref, (int)ref); \
-            return ; \
-        } \
-    } while (0)
+       do { \
+               if (var != ref) { \
+                       fprintf(stderr, \
+                                       "\n[TCT][%s][Line : %d] Assert fail; Values (%s == 0x%x) and (%s == 0x%x) are not equal\n", \
+                                       __FILE__, __LINE__, #var, (int)var, #ref, (int)ref); \
+                       return ; \
+               } \
+       } while (0)
 
 #define assert_neq_no_return(var, ref) \
-    do { \
-        if (var == ref) { \
-            fprintf(stderr, \
-                "\n[TCT][%s][Line : %d] Assert fail; Values (%s == 0x%x) and (%s == 0x%x) are equal\n", \
-                __FILE__, __LINE__,  #var, (int)var, #ref, (int)ref); \
-            return ; \
-        } \
-    } while (0)
+       do { \
+               if (var == ref) { \
+                       fprintf(stderr, \
+                                       "\n[TCT][%s][Line : %d] Assert fail; Values (%s == 0x%x) and (%s == 0x%x) are equal\n", \
+                                       __FILE__, __LINE__,  #var, (int)var, #ref, (int)ref); \
+                       return ; \
+               } \
+       } while (0)
 
 #define assert_neq(var, ref) \
-    do { \
-        if (var == ref) { \
-            fprintf(stderr, \
-                "\n[TCT][%s][Line : %d] Assert fail; Values (%s == 0x%x) and (%s == 0x%x) are equal\n", \
-                __FILE__, __LINE__,  #var, (int)var, #ref, (int)ref); \
-            return 1; \
-        } \
-    } while (0)
+       do { \
+               if (var == ref) { \
+                       fprintf(stderr, \
+                                       "\n[TCT][%s][Line : %d] Assert fail; Values (%s == 0x%x) and (%s == 0x%x) are equal\n", \
+                                       __FILE__, __LINE__,  #var, (int)var, #ref, (int)ref); \
+                       return 1; \
+               } \
+       } while (0)
 
 #define assert_gt(var, ref) \
-    do { \
-        if (var <= ref) { \
-            fprintf(stderr, \
-                "\n[TCT][%s][Line : %d] Assert fail; Values (%s == 0x%x) is not greater than (%s == 0x%x)\n", \
-            __FILE__, __LINE__,  #var, (int)var, #ref, (int)ref); \
-            return 1; \
-        } \
-    } while (0)
+       do { \
+               if (var <= ref) { \
+                       fprintf(stderr, \
+                                       "\n[TCT][%s][Line : %d] Assert fail; Values (%s == 0x%x) is not greater than (%s == 0x%x)\n", \
+                                       __FILE__, __LINE__,  #var, (int)var, #ref, (int)ref); \
+                       return 1; \
+               } \
+       } while (0)
 
 #define assert_geq(var, ref) \
-    do { \
-        if (var < ref) { \
-            fprintf(stderr, \
-                "\n[TCT][%s][Line : %d] Assert fail; Values (%s == 0x%x) is not greater than or equal to (%s == 0x%x)\n", \
-                __FILE__, __LINE__,  #var, (int)var, #ref, (int)ref); \
-            return 1; \
-        } \
-    } while (0)
+       do { \
+               if (var < ref) { \
+                       fprintf(stderr, \
+                                       "\n[TCT][%s][Line : %d] Assert fail; Values (%s == 0x%x) is not greater than or equal to (%s == 0x%x)\n", \
+                                       __FILE__, __LINE__,  #var, (int)var, #ref, (int)ref); \
+                       return 1; \
+               } \
+       } while (0)
 
 #define assert_lt(var, ref) \
-    do { \
-        if (var >= ref) { \
-            fprintf(stderr, \
-                "\n[TCT][%s][Line : %d] Assert fail; Values (%s == 0x%x) is not lower than (%s == 0x%x)\n", \
-                __FILE__, __LINE__,  #var, (int)var, #ref, (int)ref); \
-            return 1; \
-        } \
-    } while (0)
+       do { \
+               if (var >= ref) { \
+                       fprintf(stderr, \
+                                       "\n[TCT][%s][Line : %d] Assert fail; Values (%s == 0x%x) is not lower than (%s == 0x%x)\n", \
+                                       __FILE__, __LINE__,  #var, (int)var, #ref, (int)ref); \
+                       return 1; \
+               } \
+       } while (0)
 
 #define assert_leq(var, ref) \
-    do { \
-        if (var > ref) { \
-            fprintf(stderr, \
-                "\n[TCT][%s][Line : %d] Assert fail; Values (%s == 0x%x) is not lower than or equal to (%s == 0x%x)\n", \
-            __FILE__, __LINE__,  #var, (int)var, #ref, (int)ref); \
-            return 1; \
-        } \
-    } while (0)
+       do { \
+               if (var > ref) { \
+                       fprintf(stderr, \
+                                       "\n[TCT][%s][Line : %d] Assert fail; Values (%s == 0x%x) is not lower than or equal to (%s == 0x%x)\n", \
+                                       __FILE__, __LINE__,  #var, (int)var, #ref, (int)ref); \
+                       return 1; \
+               } \
+       } while (0)
 
 #ifdef __cplusplus
 }
index ffa572d58f47f59bc494f94bd328b976a2655191..7a6ac67f1c35c37b32366f2e7db24769dd1493b2 100755 (executable)
@@ -40,17 +40,16 @@ extern "C" {
 #endif
 
 #define FREE_MEMORY_TC(buffer) { \
-       if ( buffer != NULL ) \
-       { \
+       if (buffer != NULL) { \
                free(buffer); \
                buffer = NULL; \
        } \
 }
 
 #define PRINT_LOG(type, tag, ...) do { \
-    fprintf(stdout,  ##__VA_ARGS__ ); \
-    fprintf(stdout,  "\n" ); \
-} while(0)
+       fprintf(stdout,  ##__VA_ARGS__); \
+       fprintf(stdout,  "\n"); \
+} while (0)
 
 #ifdef __cplusplus
 }
index 9966aadaa520551b33ef41f8abcca0d38699a834..b98e8d9ef0354a0340a2fe21c9e23a74ba337b6e 100755 (executable)
@@ -30,10 +30,10 @@ typedef int (*tc_fun_ptr)(void);
 
 /* struct describing specific testcase */
 typedef struct testcase_s {
-    const char* name;
-    tc_fun_ptr function;
-    void_fun_ptr startup;
-    void_fun_ptr cleanup;
+       const char* name;
+       tc_fun_ptr function;
+       void_fun_ptr startup;
+       void_fun_ptr cleanup;
 } testcase;
 
 #ifdef __cplusplus
index 7f7e179fc15164b68928d8349201fc43120d40b2..5e2e62dc330eee06107a8e14bd796d04a8c7e071 100755 (executable)
@@ -40,8 +40,8 @@ bool g_bFeatureUA;
        g_nTimeoutId = g_timeout_add(GMAINTIMEOUT, ua_callback_timeout, g_pMainLoop);\
        if (COMMON_DEBUG) {\
                PRINT_LOG(DLOG_INFO, "NativeTCT", "[Line:%5d][%s] Run mainloop [%p]",\
-                       __LINE__, __FUNCTION__, g_pMainLoop);\
-       }\
+                               __LINE__, __FUNCTION__, g_pMainLoop);\
+       } \
        g_main_loop_run(g_pMainLoop);\
        g_source_remove(g_nTimeoutId);\
        g_pMainLoop = NULL;\
@@ -51,22 +51,22 @@ bool g_bFeatureUA;
        if (COMMON_DEBUG) {\
                PRINT_LOG(DLOG_INFO, "NativeTCT", "[Line:%5d][%s] Quit mainloop [%p]",\
                        __LINE__, __FUNCTION__, g_pMainLoop);\
-       }\
+       } \
        g_main_loop_quit(g_pMainLoop);\
 }
 
 #define FREE_MEMORY(var) {\
-       if(var != NULL) {\
+       if (var != NULL) {\
                g_free(var);\
                var = NULL;\
-       }\
+       } \
 }
 
 #define PRINT_RETURN(api, ret) {\
        if (COMMON_DEBUG) {\
                PRINT_LOG(DLOG_INFO, "NativeTCT", "[Line:%5d][%s] %s returned = %s",\
                        __LINE__, __FUNCTION__, api, ua_error_to_string(ret));\
-       }\
+       } \
 }
 
 #define CHECK_INIT_RETURN(var) {\
@@ -74,9 +74,9 @@ bool g_bFeatureUA;
                if (COMMON_DEBUG) {\
                        PRINT_LOG(DLOG_INFO, "NativeTCT", "[Line:%5d][%s] UA is not initialized",\
                                __LINE__, __FUNCTION__);\
-               }\
+               } \
                return 1;\
-       }\
+       } \
 }
 
 #define CHECK_RETURN(api, ret, val) {\
@@ -84,21 +84,21 @@ bool g_bFeatureUA;
                if (COMMON_DEBUG) {\
                        PRINT_LOG(DLOG_INFO, "NativeTCT", "[Line:%5d][%s] %s failed, error returned = %s",\
                                __LINE__, __FUNCTION__, api, ua_error_to_string(ret));\
-               }\
+               } \
                return 1;\
        } else {\
                if (COMMON_DEBUG) {\
                        PRINT_LOG(DLOG_INFO, "NativeTCT", "[Line:%5d][%s] %s",\
                                __LINE__, __FUNCTION__, api);\
-               }\
-       }\
+               } \
+       } \
 }
 
 #define DEBUG_LOG(str) {\
        if (COMMON_DEBUG) {\
                PRINT_LOG(DLOG_INFO, "NativeTCT", "[Line:%5d][%s] ***** DEBUG [%s] *****",\
                        __LINE__, __FUNCTION__, str);\
-       }\
+       } \
 }
 
 gboolean ua_callback_timeout(gpointer data);