diff options
author | Kevin Greenan <kmgreen2@gmail.com> | 2013-12-07 16:00:12 -0800 |
---|---|---|
committer | Kevin Greenan <kmgreen2@gmail.com> | 2013-12-07 16:05:31 -0800 |
commit | e1c76b4dd48a3ab323e20e94ebe984d7ded7c183 (patch) | |
tree | 6b2eb8b439f172375b73bc3e3332bf3a5196129f /test/gf_unit.c | |
parent | 87bb2604175e7471e05394782d2edb6fd05b4fa5 (diff) | |
download | gf-complete-e1c76b4dd48a3ab323e20e94ebe984d7ded7c183.tar.gz |
Added exhaustive test support (Ethan's changes to gf_unit and gf_methods) and overrode autoconf's defaults for CFLAGS.
Diffstat (limited to 'test/gf_unit.c')
-rw-r--r-- | test/gf_unit.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/test/gf_unit.c b/test/gf_unit.c index 434763d..cf466fe 100644 --- a/test/gf_unit.c +++ b/test/gf_unit.c @@ -22,7 +22,7 @@ #include "gf_rand.h" #include "gf_general.h" -#define REGION_SIZE (16384) +#define REGION_SIZE (16384) #define RMASK (0x00000000ffffffffLL) #define LMASK (0xffffffff00000000LL) @@ -38,7 +38,7 @@ char *BM = "Bad Method: "; void usage(char *s) { fprintf(stderr, "usage: gf_unit w tests seed [method] - does unit testing in GF(2^w)\n"); - fprintf(stderr, "\n"); + fprintf(stderr, "\n"); fprintf(stderr, "Legal w are: 1 - 32, 64 and 128\n"); fprintf(stderr, " 128 is hex only (i.e. '128' will be an error - do '128h')\n"); fprintf(stderr, "\n"); @@ -95,9 +95,16 @@ int main(int argc, char **argv) MOA_Seed(t0); if (w > 32 && w != 64 && w != 128) usage("Bad w"); - - if (create_gf_from_argv(&gf, w, argc, argv, 4) == 0) usage(BM); - printf("Size (bytes): %d\n", gf_size(&gf)); + + if (create_gf_from_argv(&gf, w, argc, argv, 4) == 0) { + usage(BM); + } + + printf("Args: "); + for (i = 1; i < argc; i++) { + printf ("%s ", argv[i]); + } + printf("/ size (bytes): %d\n", gf_size(&gf)); for (i = 0; i < strlen(argv[2]); i++) { if (strchr("ASRV", argv[2][i]) == NULL) usage("Bad test\n"); |