OSSP CVS Repository

ossp - Difference in ossp-pkg/sio/sio_test.c versions 1.9 and 1.10
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/sio/sio_test.c 1.9 -> 1.10

--- sio_test.c   2003/01/30 13:44:20     1.9
+++ sio_test.c   2003/01/30 15:04:06     1.10
@@ -96,6 +96,7 @@
     }
 
     *actualp = total;
+
     return rc;
 }
 
@@ -721,7 +722,7 @@
      */
     nodd = neven = 0;
     codd = ceven = 0;
-    while (nodd < wcount || neven < wcount) {
+    for (;;) {
         char buf[17], *p;
         int nstreams = 2;
 
@@ -748,6 +749,8 @@
             if (codd >= lenodd) {
                 codd = 0;
                 ++nodd;
+                if (nodd > wcount)
+                    ts_test_fail(TS_CTX, "excess data on odd stream\n");
             }
         }
         if (actual > 0)
@@ -776,21 +779,24 @@
             if (ceven >= leneven) {
                 ceven = 0;
                 ++neven;
+                if (neven > wcount)
+                    ts_test_fail(TS_CTX, "excess data on even stream\n");
             }
         }
         if (actual > 0)
             break;
 
-        if (nstreams == 0) {
-            if (neven != wcount ||
-                ceven != 0      ||
-                nodd  != wcount ||
-                codd  != 0) {
-                ts_test_fail(TS_CTX, "data missing from streams\n");
-            }
+        if (nstreams == 0)
             break;
-        }
     }
+    if (nodd < wcount)
+        ts_test_fail(TS_CTX, "missing data on odd stream %d vs %d\n",nodd,wcount);
+    if (neven < wcount)
+        ts_test_fail(TS_CTX, "missing data on even stream %d vs %d\n",neven,wcount);
+    if (codd != 0)
+        ts_test_fail(TS_CTX, "extra chars on odd stream\n");
+    if (ceven != 0)
+        ts_test_fail(TS_CTX, "extra chars on even stream\n");
 
     /*
      * destroy EVEN stream

CVSTrac 2.0.1