chiark / gitweb /
More portability enhancements.
[mLib] / testrig.c
index 01ffa8413dde9046bb3aa35e0e8b847bee0a782b..95aca952591bedd959cbe37494a4878b24e3e2c5 100644 (file)
--- a/testrig.c
+++ b/testrig.c
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: testrig.c,v 1.4 1999/05/19 19:02:17 mdw Exp $
+ * $Id: testrig.c,v 1.5 1999/05/21 22:14:30 mdw Exp $
  *
  * Generic test driver
  *
@@ -30,6 +30,9 @@
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: testrig.c,v $
+ * Revision 1.5  1999/05/21 22:14:30  mdw
+ * Take advantage of the new dynamic string macros.
+ *
  * Revision 1.4  1999/05/19 19:02:17  mdw
  * Aesthetic changes: fix spelling of `initialize'; use uppercase token
  * constants; abandon old double-underscore convention for internal
@@ -111,7 +114,7 @@ static int gettok(FILE *fp)
 
   /* --- Clear the token accumulator --- */
 
-  dstr_reset(&tok);
+  DRESET(&tok);
 
   /* --- Prime the lookahead character --- */
 
@@ -224,7 +227,7 @@ static void cvt_string(const char *s, dstr *d)
 
 static void dump_string(dstr *d, FILE *fp)
 {
-  dstr_write(d, fp);
+  DWRITE(d, fp);
 }
 
 test_type type_string = { cvt_string, dump_string };
@@ -273,7 +276,7 @@ void test_run(int argc, char *argv[],
   ego(argv[0]);
 
   for (i = 0; i < TEST_FIELDMAX; i++)
-    dstr_create(&dv[i]);
+    DCREATE(&dv[i]);
 
   /* --- Parse command line arguments --- */
 
@@ -365,7 +368,7 @@ void test_run(int argc, char *argv[],
       /* --- Otherwise I expect a list of words --- */
 
       for (i = 0; cch->f[i]; i++) {
-       dstr_reset(&dv[i]);
+       DRESET(&dv[i]);
        if (t != TOK_WORD)
          die(1, "expected <word>; found `%s'", decode(t));
        cch->f[i]->cvt(tok.buf, &dv[i]);