[uClibc-cvs] svn commit: trunk/uClibc/test

vapier at uclibc.org vapier at uclibc.org
Wed Jun 29 22:44:26 UTC 2005


Author: vapier
Date: 2005-06-29 16:44:26 -0600 (Wed, 29 Jun 2005)
New Revision: 10630

Log:
touchups syntax and fix warning when using 64bit arches

Modified:
   trunk/uClibc/test/testsuite.h


Changeset:
Modified: trunk/uClibc/test/testsuite.h
===================================================================
--- trunk/uClibc/test/testsuite.h	2005-06-29 22:42:27 UTC (rev 10629)
+++ trunk/uClibc/test/testsuite.h	2005-06-29 22:44:26 UTC (rev 10630)
@@ -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 @@
 
 #else
 
-
 size_t test_number = 0;
 static int failures = 0;
 
@@ -45,7 +43,7 @@
 {
 	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 @@
 		exit(EXIT_FAILURE);
 	} else {
 		printf("All functions tested sucessfully\n");
-		exit( EXIT_SUCCESS );
+		exit(EXIT_SUCCESS);
 	}
 }
 
@@ -75,43 +73,42 @@
 	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 */




More information about the uClibc-cvs mailing list