OSSP CVS Repository

ossp - Check-in [3202]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 3202
Date: 2003-Feb-11 09:39:47 (local)
2003-Feb-11 08:39:47 (UTC)
User:rse
Branch:
Comment: upgrade to fixed ts.c
Tickets:
Inspections:
Files:
ossp-pkg/str/ChangeLog      1.42 -> 1.43     7 inserted, 1 deleted
ossp-pkg/str/THANKS      1.9 -> 1.10     1 inserted, 0 deleted
ossp-pkg/str/ts.c      1.1 -> 1.2     12 inserted, 8 deleted

ossp-pkg/str/ChangeLog 1.42 -> 1.43

--- ChangeLog    2003/01/06 19:13:47     1.42
+++ ChangeLog    2003/02/11 08:39:47     1.43
@@ -9,7 +9,13 @@
 
  ChangeLog
 
- Changes between 0.9.7 and 0.9.8 (01-Apr-2002 to xx-Jan-2003):
+ Changes between 0.9.7 and 0.9.8 (01-Apr-2002 to xx-Feb-2003):
+
+   *) Fixed test suite library (ts.c): the ts_suite_free()
+      function performed an illegal iteration for freeing elements (they
+      were freed but still references for traversing to next element).
+      This is now solved by a look-ahead traversion.
+      [Ralf S. Engelschall, Brian T. Egleston <brian@egleston.com>]
 
    *) Upgraded to GNU autoconf 2.57, GNU libtool 1.4.3 and
       GNU shtool 1.6.2 build environment.


ossp-pkg/str/THANKS 1.9 -> 1.10

--- THANKS       2003/01/06 19:13:47     1.9
+++ THANKS       2003/02/11 08:39:47     1.10
@@ -12,6 +12,7 @@
   Credit has to be given to the following people who contributed ideas,
   stuff, bugfixes, hints etc. (in alphabetical order):
 
+  o Brian T. Egleston        <brian@egleston.com>
   o Dean Gaudet              <dgaudet@arctic.org>
   o Ed Griffiths             <edgrif@sanger.ac.uk>
   o Joseph Heenan            <joseph@picsel.com>


ossp-pkg/str/ts.c 1.1 -> 1.2

--- ts.c 2002/04/01 09:03:49     1.1
+++ ts.c 2003/02/11 08:39:47     1.2
@@ -76,6 +76,10 @@
     for ((ep)  = RING_FIRST((hp)); \
          (ep) != RING_SENTINEL((hp), elem, link); \
          (ep)  = RING_NEXT((ep), link))
+#define RING_FOREACH_LA(ep, epT, hp, elem, link) \
+    for ((ep)  = RING_FIRST((hp)), (epT) = RING_NEXT((ep), link); \
+         (ep) != RING_SENTINEL((hp), elem, link); \
+         (ep)  = (epT), (epT) = RING_NEXT((epT), link))
 
 /* test suite test log */
 struct tstl_st;
@@ -126,7 +130,7 @@
     int n;
     int bytes;
 
-    if (format == NULL || ap == NULL)
+    if (format == NULL)
         return -1;
     bytes = 0;
     while (*format != '\0') {
@@ -200,7 +204,7 @@
     int n;
     va_list ap2;
 
-    if (format == NULL || ap == NULL)
+    if (format == NULL)
         return NULL;
     ap2 = ap;
     if ((n = ts_suite_mvxprintf(NULL, 0, format, ap)) == -1)
@@ -367,15 +371,15 @@
 /* destroy test suite */
 void ts_suite_free(ts_suite_t *ts)
 {
-    ts_test_t *tst;
-    tstc_t *tstc;
-    tstl_t *tstl;
+    ts_test_t *tst, *tstT;
+    tstc_t *tstc, *tstcT;
+    tstl_t *tstl, *tstlT;
 
     if (ts == NULL)
         return;
-    RING_FOREACH(tst, &ts->tests, ts_test_t, next) {
-        RING_FOREACH(tstc, &tst->checks, tstc_t, next) {
-            RING_FOREACH(tstl, &tstc->logs, tstl_t, next) {
+    RING_FOREACH_LA(tst, tstT, &ts->tests, ts_test_t, next) {
+        RING_FOREACH_LA(tstc, tstcT, &tst->checks, tstc_t, next) {
+            RING_FOREACH_LA(tstl, tstlT, &tstc->logs, tstl_t, next) {
                 free(tstl->text);
             }
             free(tstc->title);

CVSTrac 2.0.1