]> Git Repo - uclibc-ng.git/commitdiff
touchups syntax and fix warning when using 64bit arches
authorMike Frysinger <[email protected]>
Wed, 29 Jun 2005 22:44:26 +0000 (22:44 -0000)
committerMike Frysinger <[email protected]>
Wed, 29 Jun 2005 22:44:26 +0000 (22:44 -0000)
test/testsuite.h

index 806a5c229711af534c6f3e65f990eda0ea29d0da..3465d328e114b1c841a710d8ca368ec7e3504d38 100644 (file)
@@ -29,7 +29,6 @@
 
 extern size_t test_number;
 
-
 extern void init_testsuite(const char* testname);
 extern void done_testing(void) __attribute__((noreturn));
 extern void success_msg(int result, const char* command);
@@ -37,7 +36,6 @@ extern void error_msg(int result, int line, const char* file, const char* comman
 
 #else
 
-
 size_t test_number = 0;
 static int failures = 0;
 
@@ -45,7 +43,7 @@ void error_msg(int result, int line, const char* file, const char* command)
 {
        failures++;
 
-       printf("\nFAILED TEST %d: \n\t%s\n", test_number, command);
+       printf("\nFAILED TEST %lu: \n\t%s\n", (unsigned long)test_number, command);
        printf("AT LINE: %d, FILE: %s\n\n", line, file);
 }   
 
@@ -63,7 +61,7 @@ void done_testing(void)
                exit(EXIT_FAILURE);
        } else {
                printf("All functions tested sucessfully\n");
-               exit( EXIT_SUCCESS );
+               exit(EXIT_SUCCESS);
        }
 }
 
@@ -75,43 +73,42 @@ void init_testsuite(const char* testname)
        atexit(done_testing);
 }
 
-#endif
+#endif /* __NO_TESTCODE__ */
 
 
-
-#define TEST_STRING_OUTPUT( command, expected_result ) \
+#define TEST_STRING_OUTPUT(command, expected_result) \
        do { \
-               int result=strcmp( command, expected_result); \
+               int result = strcmp(command, expected_result); \
                test_number++; \
-               if ( result == expected_result ) { \
-                       success_msg( result, "command"); \
+               if (result == expected_result) { \
+                       success_msg(result, "command"); \
                } else { \
                        error_msg(result, __LINE__, __FILE__, command); \
                }; \
        } while (0)
-               
-#define TEST_NUMERIC( command, expected_result ) \
+
+#define TEST_NUMERIC(command, expected_result) \
        do { \
-               int result=(command); \
+               int result = (command); \
                test_number++; \
-               if ( result == expected_result ) { \
-                       success_msg( result, # command); \
+               if (result == expected_result) { \
+                       success_msg(result, # command); \
                } else { \
                        error_msg(result, __LINE__, __FILE__, # command); \
                }; \
        } while (0)
-               
+
 #define TEST(command) \
        do { \
-               int result=(command); \
+               int result = (command); \
                test_number++; \
-               if ( result == 1) { \
-                       success_msg( result, # command); \
+               if (result == 1) { \
+                       success_msg(result, # command); \
                } else { \
-                       error_msg(result, __LINE__, __FILE__,  # command ); \
+                       error_msg(result, __LINE__, __FILE__,  # command); \
                }; \
        } while (0)
 
-#define STR_CMD(cmd)   cmd
+#define STR_CMD(cmd) cmd
                
 #endif /* TESTSUITE_H */
This page took 0.032204 seconds and 4 git commands to generate.