apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r583104 - in /apr/apr/trunk/test: abts.c abts.h
Date Tue, 09 Oct 2007 10:48:13 GMT
Author: jorton
Date: Tue Oct  9 03:48:07 2007
New Revision: 583104

URL: http://svn.apache.org/viewvc?rev=583104&view=rev
Log:
Fix invalid function casts (which are compiled as abort() by recent
versions of gcc):

* test/abts.h, test/abts.c (abts_size_equal): New function; use it
in ABTS_SIZE_EQUAL.

Modified:
    apr/apr/trunk/test/abts.c
    apr/apr/trunk/test/abts.h

Modified: apr/apr/trunk/test/abts.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/abts.c?rev=583104&r1=583103&r2=583104&view=diff
==============================================================================
--- apr/apr/trunk/test/abts.c (original)
+++ apr/apr/trunk/test/abts.c Tue Oct  9 03:48:07 2007
@@ -252,6 +252,20 @@
     }
 }
 
+void abts_size_equal(abts_case *tc, size_t expected, size_t actual, int lineno)
+{
+    update_status();
+    if (tc->failed) return;
+
+    if (expected == actual) return;
+
+    tc->failed = TRUE;
+    if (verbose) {
+        fprintf(stderr, "Line %d: expected <%lx>, but saw <%lx>\n", lineno, (unsigned
long)expected, (unsigned long)actual);
+        fflush(stderr);
+    }
+}
+
 void abts_str_equal(abts_case *tc, const char *expected, const char *actual, int lineno)
 {
     update_status();

Modified: apr/apr/trunk/test/abts.h
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/abts.h?rev=583104&r1=583103&r2=583104&view=diff
==============================================================================
--- apr/apr/trunk/test/abts.h (original)
+++ apr/apr/trunk/test/abts.h Tue Oct  9 03:48:07 2007
@@ -78,8 +78,7 @@
 void abts_fail(abts_case *tc, const char *message, int lineno);
 void abts_not_impl(abts_case *tc, const char *message, int lineno);
 void abts_assert(abts_case *tc, const char *message, int condition, int lineno);
-
-typedef void (fn_abts_size_equal)(abts_case *tc, size_t expected, size_t actual, int lineno);
+void abts_size_equal(abts_case *tc, size_t expected, size_t actual, int lineno);
 
 /* Convenience macros. Ryan hates these! */
 #define ABTS_INT_EQUAL(a, b, c)     abts_int_equal(a, b, c, __LINE__)
@@ -93,7 +92,7 @@
 #define ABTS_NOT_IMPL(a, b)         abts_not_impl(a, b, __LINE__);
 #define ABTS_ASSERT(a, b, c)        abts_assert(a, b, c, __LINE__);
 
-#define ABTS_SIZE_EQUAL(a, b, c)    ((fn_abts_size_equal*)abts_ptr_equal)(a, b, c, __LINE__)
+#define ABTS_SIZE_EQUAL(a, b, c)    abts_size_equal(a, b, c, __LINE__)
 
 
 abts_suite *run_tests(abts_suite *suite);



Mime
View raw message