apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r168119 - /apr/apr/trunk/test/testtable.c
Date Wed, 04 May 2005 12:33:00 GMT
Author: jorton
Date: Wed May  4 05:32:59 2005
New Revision: 168119

URL: http://svn.apache.org/viewcvs?rev=168119&view=rev
Log:
* test/testtable.c (table_overlap2): Add test case for
apr_table_overlap bug based on patch from Joe Schaefer.

Modified:
    apr/apr/trunk/test/testtable.c

Modified: apr/apr/trunk/test/testtable.c
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/test/testtable.c?rev=168119&r1=168118&r2=168119&view=diff
==============================================================================
--- apr/apr/trunk/test/testtable.c (original)
+++ apr/apr/trunk/test/testtable.c Wed May  4 05:32:59 2005
@@ -149,6 +149,27 @@
     ABTS_STR_EQUAL(tc, val, "7");
 }
 
+static void table_overlap2(abts_case *tc, void *data)
+{
+    apr_pool_t *subp;
+    apr_table_t *t1, *t2;
+
+    apr_pool_create(&subp, p);
+
+    t1 = apr_table_make(subp, 1);
+    t2 = apr_table_make(p, 1);
+    apr_table_addn(t1, "t1", "one");
+    apr_table_addn(t2, "t2", "two");
+    
+    apr_table_overlap(t1, t2, APR_OVERLAP_TABLES_SET);
+    
+    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_suite *testtable(abts_suite *suite)
 {
     suite = ADD_SUITE(suite)
@@ -162,6 +183,7 @@
     abts_run_test(suite, table_clear, NULL);
     abts_run_test(suite, table_unset, NULL);
     abts_run_test(suite, table_overlap, NULL);
+    abts_run_test(suite, table_overlap2, NULL);
 
     return suite;
 }



Mime
View raw message