]> mj.ucw.cz Git - libucw.git/blobdiff - lib/fb-grow.c
added some fastbuf tests
[libucw.git] / lib / fb-grow.c
index a5ed4d685a0c7c5adf1a43d0ba0c40942545ea73..80b296f97616a520b945bab2a7898c10c41ad29a 100644 (file)
@@ -109,12 +109,11 @@ fbgrow_rewind(struct fastbuf *b)
 int main(void)
 {
   struct fastbuf *f;
-  int t;
+  uns t;
 
   f = fbgrow_create(3);
   for (uns i=0; i<5; i++)
     {
-      fbgrow_write(f);
       bwrite(f, "12345", 5);
       bwrite(f, "12345", 5);
       printf("<%d>", (int)btell(f));
@@ -122,13 +121,13 @@ int main(void)
       printf("<%d>", (int)btell(f));
       fbgrow_rewind(f);
       printf("<%d>", (int)btell(f));
-      while ((t = bgetc(f)) >= 0)
+      while ((t = bgetc(f)) != ~0U)
        putchar(t);
       printf("<%d>", (int)btell(f));
       fbgrow_rewind(f);
       bseek(f, -1, SEEK_END);
       printf("<%d>", (int)btell(f));
-      while ((t = bgetc(f)) >= 0)
+      while ((t = bgetc(f)) != ~0U)
        putchar(t);
       printf("<%d>\n", (int)btell(f));
     }