apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dr...@apache.org
Subject cvs commit: apr/test testmem.c
Date Sat, 07 Jul 2001 07:51:48 GMT
dreid       01/07/07 00:51:48

  Modified:    test     testmem.c
  Log:
  This basically adds
  - tag debugging support
  - simple test of heirachy building in sms following some
    problems we had.
  
  Revision  Changes    Path
  1.9       +20 -2     apr/test/testmem.c
  
  Index: testmem.c
  ===================================================================
  RCS file: /home/cvs/apr/test/testmem.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- testmem.c	2001/07/01 06:23:10	1.8
  +++ testmem.c	2001/07/07 07:51:48	1.9
  @@ -437,7 +437,8 @@
       apr_sms_t *ams, *bms, *dms, *tms;
       apr_pool_t *pool;
       int i;
  -    
  +    apr_sms_t *lsms[10];
  + 
       apr_initialize();
           
       printf("APR Memory Test\n");
  @@ -455,6 +456,14 @@
       STD_TEST_NEQ("    Creating a trivial system",
                    apr_sms_trivial_create(&tms, ams))
   
  +/* if we're using tag's then add them :) */
  +#if APR_DEBUG_TAG_SMS
  +    apr_sms_tag("top-level", ams);
  +    apr_sms_tag("tracking", bms);
  +    apr_sms_tag("blocks", dms);
  +    apr_sms_tag("trivial", tms);
  +#endif
  +
       its_a_pool(pool, &t[0], "Pool code",     1);
       its_an_sms(ams,  &t[1], "Standard sms",  1);
       t[1].reset_fn = NULL;
  @@ -511,7 +520,7 @@
               exit(-1);
       }
       print_timed_results();
  -    
  +   
       printf("Destroying the memory...\n");
   
       STD_TEST_NEQ("Trying to destroy the trivial memory system",
  @@ -520,6 +529,15 @@
                    apr_sms_destroy(bms))
       STD_TEST_NEQ("Trying to destroy the block memory system",
                    apr_sms_destroy(dms))                        
  +
  +    printf("Testing layering...\n");
  +    apr_sms_tracking_create(&lsms[0], ams); 
  +    for (i=1;i<5;i++) {
  +        apr_sms_tracking_create(&lsms[i], lsms[i-1]);
  +    }
  +    for (i=5;i<10;i++) {
  +        apr_sms_tracking_create(&lsms[i], lsms[4]);
  +    }
       STD_TEST_NEQ("Trying to destroy the standard memory system",
                    apr_sms_destroy(ams))
   
  
  
  

Mime
View raw message