apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r596028 - in /apr/apr/trunk/test: testatomic.c testcond.c testfmt.c testfnmatch.c testipsub.c testmmap.c testpools.c teststr.c testtable.c testud.c
Date Sun, 18 Nov 2007 00:35:58 GMT
Author: trawick
Date: Sat Nov 17 16:35:57 2007
New Revision: 596028

URL: http://svn.apache.org/viewvc?rev=596028&view=rev
Log:
fix some obvious reversals of expected and actual values in invocations 
of ABTS_INT_EQUAL et al

Modified:
    apr/apr/trunk/test/testatomic.c
    apr/apr/trunk/test/testcond.c
    apr/apr/trunk/test/testfmt.c
    apr/apr/trunk/test/testfnmatch.c
    apr/apr/trunk/test/testipsub.c
    apr/apr/trunk/test/testmmap.c
    apr/apr/trunk/test/testpools.c
    apr/apr/trunk/test/teststr.c
    apr/apr/trunk/test/testtable.c
    apr/apr/trunk/test/testud.c

Modified: apr/apr/trunk/test/testatomic.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/testatomic.c?rev=596028&r1=596027&r2=596028&view=diff
==============================================================================
--- apr/apr/trunk/test/testatomic.c (original)
+++ apr/apr/trunk/test/testatomic.c Sat Nov 17 16:35:57 2007
@@ -289,9 +289,9 @@
                     s1 == exit_ret_val && s2 == exit_ret_val);
     }
 
-    ABTS_INT_EQUAL(tc, mutex_locks, NUM_THREADS * NUM_ITERATIONS);
-    ABTS_INT_EQUAL(tc, apr_atomic_read32(&atomic_ops),
-                   NUM_THREADS * NUM_ITERATIONS);
+    ABTS_INT_EQUAL(tc, NUM_THREADS * NUM_ITERATIONS, mutex_locks);
+    ABTS_INT_EQUAL(tc, NUM_THREADS * NUM_ITERATIONS,
+                   apr_atomic_read32(&atomic_ops));
 
     rv = apr_thread_mutex_destroy(thread_lock);
     ABTS_ASSERT(tc, "Failed creating threads", rv == APR_SUCCESS);
@@ -375,7 +375,7 @@
         busyloop_read32(tbox);
         val = apr_atomic_dec32(tbox->mem);
         apr_thread_mutex_lock(thread_lock);
-        ABTS_INT_NEQUAL(tbox->tc, val, 0);
+        ABTS_INT_NEQUAL(tbox->tc, 0, val);
         apr_thread_mutex_unlock(thread_lock);
     } while (--tbox->loop);
 }
@@ -483,7 +483,7 @@
         ABTS_ASSERT(tc, "Invalid return value from thread_join", retval == 0);
     }
 
-    ABTS_INT_EQUAL(tbox->tc, count, 98);
+    ABTS_INT_EQUAL(tbox->tc, 98, count);
 
     rv = apr_thread_mutex_destroy(thread_lock);
     ABTS_ASSERT(tc, "Failed creating threads", rv == APR_SUCCESS);

Modified: apr/apr/trunk/test/testcond.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/testcond.c?rev=596028&r1=596027&r2=596028&view=diff
==============================================================================
--- apr/apr/trunk/test/testcond.c (original)
+++ apr/apr/trunk/test/testcond.c Sat Nov 17 16:35:57 2007
@@ -25,7 +25,7 @@
 
 #define NTHREADS 10
 
-#define ABTS_SUCCESS(rv)    ABTS_INT_EQUAL(tc, rv, APR_SUCCESS)
+#define ABTS_SUCCESS(rv)    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv)
 
 #if APR_HAS_THREADS
 
@@ -249,7 +249,7 @@
         ABTS_SUCCESS(rv);
     }
 
-    ABTS_INT_EQUAL(tc, count, 0);
+    ABTS_INT_EQUAL(tc, 0, count);
 
     rv = apr_thread_cond_destroy(cond);
     ABTS_SUCCESS(rv);

Modified: apr/apr/trunk/test/testfmt.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/testfmt.c?rev=596028&r1=596027&r2=596028&view=diff
==============================================================================
--- apr/apr/trunk/test/testfmt.c (original)
+++ apr/apr/trunk/test/testfmt.c Sat Nov 17 16:35:57 2007
@@ -105,16 +105,16 @@
     apr_uint64_t big = APR_UINT64_C(10267677267010969076);
 
     apr_snprintf(buf, sizeof buf, "%" APR_INT64_T_FMT, i);
-    ABTS_STR_EQUAL(tc, buf, "-42");
+    ABTS_STR_EQUAL(tc, "-42", buf);
 
     apr_snprintf(buf, sizeof buf, "%" APR_UINT64_T_FMT, ui);
-    ABTS_STR_EQUAL(tc, buf, "42");
+    ABTS_STR_EQUAL(tc, "42", buf);
 
     apr_snprintf(buf, sizeof buf, "%" APR_UINT64_T_FMT, big);
     ABTS_STR_EQUAL(tc, "10267677267010969076", buf);
 
     apr_snprintf(buf, sizeof buf, "%" APR_INT64_T_FMT, ibig);
-    ABTS_STR_EQUAL(tc, buf, "-314159265358979323");
+    ABTS_STR_EQUAL(tc, "-314159265358979323", buf);
 }
 
 static void error_fmt(abts_case *tc, void *data)

Modified: apr/apr/trunk/test/testfnmatch.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/testfnmatch.c?rev=596028&r1=596027&r2=596028&view=diff
==============================================================================
--- apr/apr/trunk/test/testfnmatch.c (original)
+++ apr/apr/trunk/test/testfnmatch.c Sat Nov 17 16:35:57 2007
@@ -39,7 +39,7 @@
     list = (char **)result->elts;
     for (i = 0; i < result->nelts; i++) {
         char *dot = strrchr(list[i], '.');
-        ABTS_STR_EQUAL(tc, dot, ".txt");
+        ABTS_STR_EQUAL(tc, ".txt", dot);
     }
 }
 
@@ -59,7 +59,7 @@
     list = (char **)result->elts;
     for (i = 0; i < result->nelts; i++) {
         char *dot = strrchr(list[i], '.');
-        ABTS_STR_EQUAL(tc, dot, ".txt");
+        ABTS_STR_EQUAL(tc, ".txt", dot);
     }
     apr_filepath_set("..", p);
 }

Modified: apr/apr/trunk/test/testipsub.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/testipsub.c?rev=596028&r1=596027&r2=596028&view=diff
==============================================================================
--- apr/apr/trunk/test/testipsub.c (original)
+++ apr/apr/trunk/test/testipsub.c Sat Nov 17 16:35:57 2007
@@ -68,7 +68,7 @@
 
     for (i = 0; i < (sizeof testcases / sizeof testcases[0]); i++) {
         rv = apr_ipsubnet_create(&ipsub, testcases[i].ipstr, testcases[i].mask, p);
-        ABTS_INT_EQUAL(tc, rv, testcases[i].expected_rv);
+        ABTS_INT_EQUAL(tc, testcases[i].expected_rv, rv);
     }
 }
 

Modified: apr/apr/trunk/test/testmmap.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/testmmap.c?rev=596028&r1=596027&r2=596028&view=diff
==============================================================================
--- apr/apr/trunk/test/testmmap.c (original)
+++ apr/apr/trunk/test/testmmap.c Sat Nov 17 16:35:57 2007
@@ -66,7 +66,7 @@
     apr_status_t rv;
 
     rv = apr_file_close(thefile);
-    ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
+    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
 }
    
 static void test_file_open(abts_case *tc, void *data)
@@ -74,7 +74,7 @@
     apr_status_t rv;
 
     rv = apr_file_open(&thefile, file1, APR_READ, APR_UREAD | APR_GREAD, p);
-    ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
+    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     ABTS_PTR_NOTNULL(tc, thefile);
 }
    
@@ -83,7 +83,7 @@
     apr_status_t rv;
 
     rv = apr_file_info_get(&thisfinfo, APR_FINFO_NORM, thefile);
-    ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
+    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     ABTS_ASSERT(tc, "File size mismatch", thisfsize == thisfinfo.size);
 }
 
@@ -94,7 +94,7 @@
     rv = apr_mmap_create(&themmap, thefile, 0, (apr_size_t) thisfinfo.size, 
 		                 APR_MMAP_READ, p);
     ABTS_PTR_NOTNULL(tc, themmap);
-    ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
+    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
 }
 
 static void test_mmap_contents(abts_case *tc, void *data)
@@ -114,7 +114,7 @@
 
     ABTS_PTR_NOTNULL(tc, themmap);
     rv = apr_mmap_delete(themmap);
-    ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
+    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
 }
 
 static void test_mmap_offset(abts_case *tc, void *data)

Modified: apr/apr/trunk/test/testpools.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/testpools.c?rev=596028&r1=596027&r2=596028&view=diff
==============================================================================
--- apr/apr/trunk/test/testpools.c (original)
+++ apr/apr/trunk/test/testpools.c Sat Nov 17 16:35:57 2007
@@ -69,7 +69,7 @@
     apr_status_t rv;
 
     rv = apr_pool_create(&pmain, NULL);
-    ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
+    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     ABTS_PTR_NOTNULL(tc, pmain);
 }
 
@@ -78,7 +78,7 @@
     apr_status_t rv;
 
     rv = apr_pool_create(&pchild, pmain);
-    ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
+    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     ABTS_PTR_NOTNULL(tc, pchild);
 }
 

Modified: apr/apr/trunk/test/teststr.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/teststr.c?rev=596028&r1=596027&r2=596028&view=diff
==============================================================================
--- apr/apr/trunk/test/teststr.c (original)
+++ apr/apr/trunk/test/teststr.c Sat Nov 17 16:35:57 2007
@@ -357,8 +357,8 @@
 
     ret = apr_cpystrn(buf, "123456", 5);
 
-    ABTS_STR_EQUAL(tc, buf, "1234");
-    ABTS_PTR_EQUAL(tc, ret, buf + 4);
+    ABTS_STR_EQUAL(tc, "1234", buf);
+    ABTS_PTR_EQUAL(tc, buf + 4, ret);
     ABTS_TRUE(tc, *ret == '\0');
     ABTS_TRUE(tc, ret[1] == 'Z');
 }
@@ -377,7 +377,7 @@
     rv = apr_snprintf(buf, 2, "%s", "abcd");
     ABTS_INT_EQUAL(tc, 1, rv);
 
-    ABTS_STR_EQUAL(tc, buf, "a");
+    ABTS_STR_EQUAL(tc, "a", buf);
 
     /* Check the buffer really hasn't been overflowed. */
     ABTS_TRUE(tc, buf[2] == '4' && buf[3] == '2');

Modified: apr/apr/trunk/test/testtable.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/testtable.c?rev=596028&r1=596027&r2=596028&view=diff
==============================================================================
--- apr/apr/trunk/test/testtable.c (original)
+++ apr/apr/trunk/test/testtable.c Sat Nov 17 16:35:57 2007
@@ -54,7 +54,7 @@
 
     apr_table_set(t1, "foo", "bar");
     val = apr_table_get(t1, "foo");
-    ABTS_STR_EQUAL(tc, val, "bar");
+    ABTS_STR_EQUAL(tc, "bar", val);
 }
 
 static void table_set(abts_case *tc, void *data)
@@ -64,7 +64,7 @@
     apr_table_set(t1, "setkey", "bar");
     apr_table_set(t1, "setkey", "2ndtry");
     val = apr_table_get(t1, "setkey");
-    ABTS_STR_EQUAL(tc, val, "2ndtry");
+    ABTS_STR_EQUAL(tc, "2ndtry", val);
 }
 
 static void table_getnotthere(abts_case *tc, void *data)
@@ -82,7 +82,7 @@
     apr_table_add(t1, "addkey", "bar");
     apr_table_add(t1, "addkey", "foo");
     val = apr_table_get(t1, "addkey");
-    ABTS_STR_EQUAL(tc, val, "bar");
+    ABTS_STR_EQUAL(tc, "bar", val);
 
 }
 
@@ -95,11 +95,11 @@
     apr_table_set(t, "def", "abc");
     apr_table_set(t, "foo", "zzz");
     val = apr_table_get(t, "foo");
-    ABTS_STR_EQUAL(tc, val, "zzz");
+    ABTS_STR_EQUAL(tc, "zzz", val);
     val = apr_table_get(t, "abc");
-    ABTS_STR_EQUAL(tc, val, "def");
+    ABTS_STR_EQUAL(tc, "def", val);
     val = apr_table_get(t, "def");
-    ABTS_STR_EQUAL(tc, val, "abc");
+    ABTS_STR_EQUAL(tc, "abc", val);
     ABTS_INT_EQUAL(tc, 3, apr_table_elts(t)->nelts);
 }
 
@@ -119,9 +119,9 @@
     apr_table_unset(t, "b");
     ABTS_INT_EQUAL(tc, 1, apr_table_elts(t)->nelts);
     val = apr_table_get(t, "a");
-    ABTS_STR_EQUAL(tc, val, "1");
+    ABTS_STR_EQUAL(tc, "1", val);
     val = apr_table_get(t, "b");
-    ABTS_PTR_EQUAL(tc, (void *)val, (void *)NULL);
+    ABTS_PTR_EQUAL(tc, (void *)NULL, (void *)val);
 }
 
 static void table_overlap(abts_case *tc, void *data)
@@ -142,21 +142,21 @@
     apr_table_addn(t2, "f", "6");
     apr_table_overlap(t1, t2, APR_OVERLAP_TABLES_SET);
     
-    ABTS_INT_EQUAL(tc, apr_table_elts(t1)->nelts, 7);
+    ABTS_INT_EQUAL(tc, 7, apr_table_elts(t1)->nelts);
     val = apr_table_get(t1, "a");
-    ABTS_STR_EQUAL(tc, val, "1");
+    ABTS_STR_EQUAL(tc, "1", val);
     val = apr_table_get(t1, "b");
-    ABTS_STR_EQUAL(tc, val, "2.");
+    ABTS_STR_EQUAL(tc, "2.", val);
     val = apr_table_get(t1, "c");
-    ABTS_STR_EQUAL(tc, val, "3");
+    ABTS_STR_EQUAL(tc, "3", val);
     val = apr_table_get(t1, "d");
-    ABTS_STR_EQUAL(tc, val, "4");
+    ABTS_STR_EQUAL(tc, "4", val);
     val = apr_table_get(t1, "e");
-    ABTS_STR_EQUAL(tc, val, "5");
+    ABTS_STR_EQUAL(tc, "5", val);
     val = apr_table_get(t1, "f");
-    ABTS_STR_EQUAL(tc, val, "6");
+    ABTS_STR_EQUAL(tc, "6", val);
     val = apr_table_get(t1, "g");
-    ABTS_STR_EQUAL(tc, val, "7");
+    ABTS_STR_EQUAL(tc, "7", val);
 }
 
 static void table_overlap2(abts_case *tc, void *data)
@@ -175,8 +175,8 @@
     
     ABTS_INT_EQUAL(tc, 2, apr_table_elts(t1)->nelts);
     
-    ABTS_STR_EQUAL(tc, apr_table_get(t1, "t1"), "one");
-    ABTS_STR_EQUAL(tc, apr_table_get(t1, "t2"), "two");
+    ABTS_STR_EQUAL(tc, "one", apr_table_get(t1, "t1"));
+    ABTS_STR_EQUAL(tc, "two", apr_table_get(t1, "t2"));
 
 }
 

Modified: apr/apr/trunk/test/testud.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/testud.c?rev=596028&r1=596027&r2=596028&view=diff
==============================================================================
--- apr/apr/trunk/test/testud.c (original)
+++ apr/apr/trunk/test/testud.c Sat Nov 17 16:35:57 2007
@@ -38,7 +38,7 @@
     apr_status_t rv;
 
     rv = apr_pool_userdata_set(testdata, "TEST", string_cleanup, pool);
-    ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
+    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
 }
 
 static void get_userdata(abts_case *tc, void *data)
@@ -47,8 +47,8 @@
     void *retdata;
 
     rv = apr_pool_userdata_get(&retdata, "TEST", pool);
-    ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
-    ABTS_STR_EQUAL(tc, retdata, testdata);
+    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+    ABTS_STR_EQUAL(tc, testdata, retdata);
 }
 
 static void get_nonexistkey(abts_case *tc, void *data)
@@ -57,8 +57,8 @@
     void *retdata;
 
     rv = apr_pool_userdata_get(&retdata, "DOESNTEXIST", pool);
-    ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
-    ABTS_PTR_EQUAL(tc, retdata, NULL);
+    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+    ABTS_PTR_EQUAL(tc, NULL, retdata);
 }
 
 static void post_pool_clear(abts_case *tc, void *data)
@@ -67,8 +67,8 @@
     void *retdata;
 
     rv = apr_pool_userdata_get(&retdata, "DOESNTEXIST", pool);
-    ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
-    ABTS_PTR_EQUAL(tc, retdata, NULL);
+    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+    ABTS_PTR_EQUAL(tc, NULL, retdata);
 }
 
 abts_suite *testud(abts_suite *suite)



Mime
View raw message