chiark / gitweb /
Mark test types as constant.
authormdw <mdw>
Tue, 16 Nov 1999 15:03:31 +0000 (15:03 +0000)
committermdw <mdw>
Tue, 16 Nov 1999 15:03:31 +0000 (15:03 +0000)
testrig.c
testrig.h

index 95aca952591bedd959cbe37494a4878b24e3e2c5..0531e738a0ac76eec976562aae001c88de413867 100644 (file)
--- a/testrig.c
+++ b/testrig.c
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
 /* -*-c-*-
  *
- * $Id: testrig.c,v 1.5 1999/05/21 22:14:30 mdw Exp $
+ * $Id: testrig.c,v 1.6 1999/11/16 15:03:23 mdw Exp $
  *
  * Generic test driver
  *
  *
  * Generic test driver
  *
@@ -30,6 +30,9 @@
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: testrig.c,v $
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: testrig.c,v $
+ * Revision 1.6  1999/11/16 15:03:23  mdw
+ * Mark test types as constant.
+ *
  * Revision 1.5  1999/05/21 22:14:30  mdw
  * Take advantage of the new dynamic string macros.
  *
  * Revision 1.5  1999/05/21 22:14:30  mdw
  * Take advantage of the new dynamic string macros.
  *
@@ -216,7 +219,7 @@ static void dump_hex(dstr *d, FILE *fp)
     fprintf(fp, "%02x", *(unsigned char *)p);
 }
 
     fprintf(fp, "%02x", *(unsigned char *)p);
 }
 
-test_type type_hex = { cvt_hex, dump_hex };
+const test_type type_hex = { cvt_hex, dump_hex };
 
 /* --- @type_string@ --- */
 
 
 /* --- @type_string@ --- */
 
@@ -230,7 +233,7 @@ static void dump_string(dstr *d, FILE *fp)
   DWRITE(d, fp);
 }
 
   DWRITE(d, fp);
 }
 
-test_type type_string = { cvt_string, dump_string };
+const test_type type_string = { cvt_string, dump_string };
 
 /* --- @type_int@ --- */
 
 
 /* --- @type_int@ --- */
 
@@ -245,7 +248,7 @@ static void dump_int(dstr *d, FILE *fp)
   fprintf(fp, "%i", *(int *)(d->buf));
 }
 
   fprintf(fp, "%i", *(int *)(d->buf));
 }
 
-test_type type_int = { cvt_int, dump_int };
+const test_type type_int = { cvt_int, dump_int };
 
 /* --- @test_run@ --- *
  *
 
 /* --- @test_run@ --- *
  *
index f026f4bbe6a99c3622fe752f779bb7759a3231dc..cf6afa872b4a755be842669bdb570954c72f8989 100644 (file)
--- a/testrig.h
+++ b/testrig.h
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
 /* -*-c-*-
  *
- * $Id: testrig.h,v 1.4 1999/07/06 19:15:28 mdw Exp $
+ * $Id: testrig.h,v 1.5 1999/11/16 15:03:31 mdw Exp $
  *
  * Generic test driver
  *
  *
  * Generic test driver
  *
@@ -30,6 +30,9 @@
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: testrig.h,v $
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: testrig.h,v $
+ * Revision 1.5  1999/11/16 15:03:31  mdw
+ * Mark test types as constant.
+ *
  * Revision 1.4  1999/07/06 19:15:28  mdw
  * Comment out argument in structure definition.
  *
  * Revision 1.4  1999/07/06 19:15:28  mdw
  * Comment out argument in structure definition.
  *
@@ -75,14 +78,14 @@ typedef struct test_type {
 typedef struct test_chunk {
   const char *name;                    /* Name of this chunk */
   int (*test)(dstr /*dv*/[]);          /* Test verification function */
 typedef struct test_chunk {
   const char *name;                    /* Name of this chunk */
   int (*test)(dstr /*dv*/[]);          /* Test verification function */
-  test_type *f[TEST_FIELDMAX];         /* Field definitions */
+  const test_type *f[TEST_FIELDMAX];   /* Field definitions */
 } test_chunk;
 
 /*----- Predefined data types ---------------------------------------------*/
 
 } test_chunk;
 
 /*----- Predefined data types ---------------------------------------------*/
 
-extern test_type type_hex;
-extern test_type type_string;
-extern test_type type_int;
+extern const test_type type_hex;
+extern const test_type type_string;
+extern const test_type type_int;
 
 /*----- Functions provided ------------------------------------------------*/
 
 
 /*----- Functions provided ------------------------------------------------*/