apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: rev 76117 - apr/apr/trunk/test
Date Wed, 17 Nov 2004 12:13:04 GMT
Author: jorton
Date: Wed Nov 17 04:13:00 2004
New Revision: 76117

Modified:
   apr/apr/trunk/test/testfile.c
   apr/apr/trunk/test/testsockets.c
   apr/apr/trunk/test/testud.c
Log:
* test/testud.c (get_userdata, get_nonexistkey, post_pool_clear): 
Fix GCC strict-aliasing warnings.

* test/testfile.c (test_userdata_get, test_userdata_set,
test_userdata_getnokey): Likewise.

* test/testsockets.c (socket_userdata): Likewise.


Modified: apr/apr/trunk/test/testfile.c
==============================================================================
--- apr/apr/trunk/test/testfile.c	(original)
+++ apr/apr/trunk/test/testfile.c	Wed Nov 17 04:13:00 2004
@@ -287,6 +287,7 @@
 static void test_userdata_get(abts_case *tc, void *data)
 {
     apr_status_t rv;
+    void *udata;
     char *teststr;
     apr_file_t *filetest = NULL;
 
@@ -299,8 +300,9 @@
                            "test", apr_pool_cleanup_null);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
 
-    rv = apr_file_data_get((void **)&teststr, "test", filetest);
+    rv = apr_file_data_get(&udata, "test", filetest);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+    teststr = udata;
     ABTS_STR_EQUAL(tc, "This is a test", teststr);
 
     apr_file_close(filetest);
@@ -309,7 +311,7 @@
 static void test_userdata_getnokey(abts_case *tc, void *data)
 {
     apr_status_t rv;
-    char *teststr;
+    void *teststr;
     apr_file_t *filetest = NULL;
 
     rv = apr_file_open(&filetest, FILENAME, 
@@ -317,7 +319,7 @@
                        APR_UREAD | APR_UWRITE | APR_GREAD, p);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
 
-    rv = apr_file_data_get((void **)&teststr, "nokey", filetest);
+    rv = apr_file_data_get(&teststr, "nokey", filetest);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     ABTS_PTR_EQUAL(tc, NULL, teststr);
     apr_file_close(filetest);

Modified: apr/apr/trunk/test/testsockets.c
==============================================================================
--- apr/apr/trunk/test/testsockets.c	(original)
+++ apr/apr/trunk/test/testsockets.c	Wed Nov 17 04:13:00 2004
@@ -167,7 +167,7 @@
 {
     apr_socket_t *sock1, *sock2;
     apr_status_t rv;
-    char *user;
+    void *user;
     const char *key = "GENERICKEY";
 
     rv = apr_socket_create(&sock1, AF_INET, SOCK_STREAM, 0, p);
@@ -180,10 +180,10 @@
     rv = apr_socket_data_set(sock2, "SOCK2", key, NULL);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
 
-    rv = apr_socket_data_get((void **)&user, key, sock1);
+    rv = apr_socket_data_get(&user, key, sock1);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     ABTS_STR_EQUAL(tc, "SOCK1", user);
-    rv = apr_socket_data_get((void **)&user, key, sock2);
+    rv = apr_socket_data_get(&user, key, sock2);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     ABTS_STR_EQUAL(tc, "SOCK2", user);
 }

Modified: apr/apr/trunk/test/testud.c
==============================================================================
--- apr/apr/trunk/test/testud.c	(original)
+++ apr/apr/trunk/test/testud.c	Wed Nov 17 04:13:00 2004
@@ -43,9 +43,9 @@
 static void get_userdata(abts_case *tc, void *data)
 {
     apr_status_t rv;
-    char *retdata;
+    void *retdata;
 
-    rv = apr_pool_userdata_get((void **)&retdata, "TEST", pool);
+    rv = apr_pool_userdata_get(&retdata, "TEST", pool);
     ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
     ABTS_STR_EQUAL(tc, retdata, testdata);
 }
@@ -53,9 +53,9 @@
 static void get_nonexistkey(abts_case *tc, void *data)
 {
     apr_status_t rv;
-    char *retdata;
+    void *retdata;
 
-    rv = apr_pool_userdata_get((void **)&retdata, "DOESNTEXIST", pool);
+    rv = apr_pool_userdata_get(&retdata, "DOESNTEXIST", pool);
     ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
     ABTS_PTR_EQUAL(tc, retdata, NULL);
 }
@@ -63,9 +63,9 @@
 static void post_pool_clear(abts_case *tc, void *data)
 {
     apr_status_t rv;
-    char *retdata;
+    void *retdata;
 
-    rv = apr_pool_userdata_get((void **)&retdata, "DOESNTEXIST", pool);
+    rv = apr_pool_userdata_get(&retdata, "DOESNTEXIST", pool);
     ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
     ABTS_PTR_EQUAL(tc, retdata, NULL);
 }

Mime
View raw message