diff options
author | minfrin <minfrin@13f79535-47bb-0310-9956-ffa450edef68> | 2016-03-07 23:36:40 +0000 |
---|---|---|
committer | minfrin <minfrin@13f79535-47bb-0310-9956-ffa450edef68> | 2016-03-07 23:36:40 +0000 |
commit | 449073e147b53331df9f188fed655d07fbe360de (patch) | |
tree | 55bb6a5734459a1885563c625664c2a9aece3cc6 /test | |
parent | 686d2eb511fb760ce7d225dbb43bb5f56264b466 (diff) | |
download | libapr-449073e147b53331df9f188fed655d07fbe360de.tar.gz |
apr_table_overlap: Add APR_OVERLAP_TABLES_ADD to merge and set when
overlapping tables.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1734005 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test')
-rw-r--r-- | test/testtable.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/testtable.c b/test/testtable.c index d24053edb..0a9960f12 100644 --- a/test/testtable.c +++ b/test/testtable.c @@ -199,6 +199,29 @@ static void table_overlap2(abts_case *tc, void *data) } +static void table_overlap3(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(t1, "t1", "overlay"); + apr_table_addn(t2, "t2", "two"); + apr_table_addn(t2, "t2", "overlay"); + + apr_table_overlap(t1, t2, APR_OVERLAP_TABLES_ADD); + + ABTS_INT_EQUAL(tc, 4, apr_table_elts(t1)->nelts); + + ABTS_STR_EQUAL(tc, "one", apr_table_get(t1, "t1")); + ABTS_STR_EQUAL(tc, "two", apr_table_get(t1, "t2")); + +} + abts_suite *testtable(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -215,6 +238,7 @@ abts_suite *testtable(abts_suite *suite) abts_run_test(suite, table_unset, NULL); abts_run_test(suite, table_overlap, NULL); abts_run_test(suite, table_overlap2, NULL); + abts_run_test(suite, table_overlap3, NULL); return suite; } |