apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject cvs commit: apr/test testtable.c
Date Fri, 05 Jul 2002 09:05:49 GMT
brianp      2002/07/05 02:05:49

  Modified:    test     testtable.c
  Log:
  added test cases for apr_table_unset()
  
  Revision  Changes    Path
  1.2       +22 -0     apr/test/testtable.c
  
  Index: testtable.c
  ===================================================================
  RCS file: /home/cvs/apr/test/testtable.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- testtable.c	5 Jul 2002 08:49:55 -0000	1.1
  +++ testtable.c	5 Jul 2002 09:05:49 -0000	1.2
  @@ -112,6 +112,28 @@
       }
       fprintf(stderr, "OK\n");
   
  +    fprintf(stderr, "Test 4: apr_table_unset...");
  +    apr_table_clear(t1);
  +    apr_table_addn(t1, "a", "1");
  +    apr_table_addn(t1, "b", "2");
  +    apr_table_addn(t1, "c", "3");
  +    apr_table_addn(t1, "b", "2");
  +    apr_table_addn(t1, "d", "4");
  +    apr_table_addn(t1, "e", "5");
  +    apr_table_addn(t1, "b", "2");
  +    apr_table_addn(t1, "f", "6");
  +    apr_table_unset(t1, "b");
  +    if ((apr_table_elts(t1)->nelts != 5) ||
  +        !(val = apr_table_get(t1, "a")) || strcmp(val, "1") ||
  +        !(val = apr_table_get(t1, "c")) || strcmp(val, "3") ||
  +        !(val = apr_table_get(t1, "d")) || strcmp(val, "4") ||
  +        !(val = apr_table_get(t1, "e")) || strcmp(val, "5") ||
  +        !(val = apr_table_get(t1, "f")) || strcmp(val, "6") ||
  +        (apr_table_get(t1, "b") != NULL)) {
  +        fprintf(stderr, "ERROR\n");
  +        exit(-1);
  +    }
  +    fprintf(stderr, "OK\n");
   
       return 0;
   }
  
  
  

Mime
View raw message