apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r584659 - /apr/apr/branches/1.2.x/test/testsockets.c
Date Mon, 15 Oct 2007 02:39:06 GMT
Author: wrowe
Date: Sun Oct 14 19:39:05 2007
New Revision: 584659

URL: http://svn.apache.org/viewvc?rev=584659&view=rev
Log:
Better isolate IPv6 tests from the rest, and split recvfrom
tests to make clear which test failed.

Backport: 584658

Modified:
    apr/apr/branches/1.2.x/test/testsockets.c

Modified: apr/apr/branches/1.2.x/test/testsockets.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/test/testsockets.c?rev=584659&r1=584658&r2=584659&view=diff
==============================================================================
--- apr/apr/branches/1.2.x/test/testsockets.c (original)
+++ apr/apr/branches/1.2.x/test/testsockets.c Sun Oct 14 19:39:05 2007
@@ -71,9 +71,9 @@
 #error MUST have an EAFNOSUPPORT class of error code to enable IPv6!
 #endif
 
+#if APR_HAVE_IPV6
 static void tcp6_socket(abts_case *tc, void *data)
 {
-#if APR_HAVE_IPV6
     apr_status_t rv;
     apr_socket_t *sock = NULL;
 
@@ -85,14 +85,10 @@
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     ABTS_PTR_NOTNULL(tc, sock);
     apr_socket_close(sock);
-#else
-    ABTS_NOT_IMPL(tc, "IPv6");
-#endif
 }
 
 static void udp6_socket(abts_case *tc, void *data)
 {
-#if APR_HAVE_IPV6
     apr_status_t rv;
     apr_socket_t *sock = NULL;
 
@@ -104,10 +100,8 @@
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     ABTS_PTR_NOTNULL(tc, sock);
     apr_socket_close(sock);
-#else
-    ABTS_NOT_IMPL(tc, "IPv6");
-#endif
 }
+#endif
 
 static void sendto_receivefrom_helper(abts_case *tc, const char *addr, 
                                       const char *junkaddr, int family)
@@ -124,10 +118,12 @@
     apr_size_t len = 30;
 
     rv = apr_socket_create(&sock, family, SOCK_DGRAM, 0, p);
+#if APR_HAVE_IPV6
     if ((family == APR_INET6) && V6_NOT_ENABLED(rv)) {
         ABTS_NOT_IMPL(tc, "IPv6 not enabled");
         return;
     }
+#endif
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     if (rv != APR_SUCCESS)
         return;
@@ -184,10 +180,16 @@
 static void sendto_receivefrom(abts_case *tc, void *data)
 {
     sendto_receivefrom_helper(tc, "127.0.0.1",  "127.1.2.3", APR_INET);
+    ABTS_TRUE(tc, !tc->failed);
+}
+
 #if APR_HAVE_IPV6
+static void sendto_receivefrom6(abts_case *tc, void *data)
+{
     sendto_receivefrom_helper(tc, "::1", "FA0E::1234:127.1.2.3", APR_INET6);
-#endif
+    ABTS_TRUE(tc, !tc->failed);
 }
+#endif
 
 static void socket_userdata(abts_case *tc, void *data)
 {
@@ -221,10 +223,14 @@
     abts_run_test(suite, tcp_socket, NULL);
     abts_run_test(suite, udp_socket, NULL);
 
+    abts_run_test(suite, sendto_receivefrom, NULL);
+
+#if APR_HAVE_IPV6
     abts_run_test(suite, tcp6_socket, NULL);
     abts_run_test(suite, udp6_socket, NULL);
 
-    abts_run_test(suite, sendto_receivefrom, NULL);
+    abts_run_test(suite, sendto_receivefrom6, NULL);
+#endif
 
     abts_run_test(suite, socket_userdata, NULL);
     



Mime
View raw message