apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject cvs commit: apr/test abts.c
Date Thu, 08 Jul 2004 10:53:44 GMT
jorton      2004/07/08 03:53:44

  Modified:    test     abts.c
  Log:
  * test/abts.c (abts_run_test): Avoid the malloc/free.
  
  Revision  Changes    Path
  1.15      +5 -7      apr/test/abts.c
  
  Index: abts.c
  ===================================================================
  RCS file: /home/cvs/apr/test/abts.c,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -d -w -u -r1.14 -r1.15
  --- abts.c	29 Jun 2004 17:15:17 -0000	1.14
  +++ abts.c	8 Jul 2004 10:53:44 -0000	1.15
  @@ -153,7 +153,7 @@
   
   void abts_run_test(abts_suite *ts, test_func f, void *value)
   {
  -    abts_case *tc;
  +    abts_case tc;
       sub_suite *ss;
   
       if (!should_test_run(ts->tail->name)) {
  @@ -161,19 +161,17 @@
       }
       ss = ts->tail;
   
  -    tc = malloc(sizeof(tc));
  -    tc->failed = 0;
  -    tc->suite = ss;
  +    tc.failed = 0;
  +    tc.suite = ss;
       
       ss->num_test++;
       update_status();
   
  -    f(tc, value);
  +    f(&tc, value);
       
  -    if (tc->failed) {
  +    if (tc.failed) {
           ss->failed++;
       }
  -    free(tc);
   }
   
   static int report(abts_suite *suite)
  
  
  

Mime
View raw message