diff options
author | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2018-11-08 21:55:29 +0100 |
---|---|---|
committer | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2018-11-08 21:55:29 +0100 |
commit | d0a77182831573ce46b35a661c11cfaa7bae90bf (patch) | |
tree | 3644d013aefcdafc182dac6ffa5b6586d22638d4 /tests/mpn | |
parent | 9b222411813267dabd74f4358a1f16a34305b76d (diff) | |
download | gmp-d0a77182831573ce46b35a661c11cfaa7bae90bf.tar.gz |
Use TESTS_REPS.
Diffstat (limited to 'tests/mpn')
-rw-r--r-- | tests/mpn/t-bdiv.c | 12 | ||||
-rw-r--r-- | tests/mpn/t-broot.c | 11 | ||||
-rw-r--r-- | tests/mpn/t-brootinv.c | 11 | ||||
-rw-r--r-- | tests/mpn/t-div.c | 11 | ||||
-rw-r--r-- | tests/mpn/t-invert.c | 11 | ||||
-rw-r--r-- | tests/mpn/t-minvert.c | 11 | ||||
-rw-r--r-- | tests/mpn/t-mullo.c | 11 | ||||
-rw-r--r-- | tests/mpn/t-mulmod_bnm1.c | 11 | ||||
-rw-r--r-- | tests/mpn/t-sizeinbase.c | 11 | ||||
-rw-r--r-- | tests/mpn/t-sqrlo.c | 11 | ||||
-rw-r--r-- | tests/mpn/t-sqrmod_bnm1.c | 11 | ||||
-rw-r--r-- | tests/mpn/toom-shared.h | 11 | ||||
-rw-r--r-- | tests/mpn/toom-sqr-shared.h | 11 |
13 files changed, 13 insertions, 131 deletions
diff --git a/tests/mpn/t-bdiv.c b/tests/mpn/t-bdiv.c index c2975bef1..60f58da11 100644 --- a/tests/mpn/t-bdiv.c +++ b/tests/mpn/t-bdiv.c @@ -143,17 +143,7 @@ main (int argc, char **argv) mp_limb_t rran0, rran1, qran0, qran1; TMP_DECL; - if (argc > 1) - { - char *end; - count = strtol (argv[1], &end, 0); - if (*end || count <= 0) - { - fprintf (stderr, "Invalid test count: %s.\n", argv[1]); - return 1; - } - } - + TESTS_REPS (count, argv, argc); maxdbits = MAX_DN; maxnbits = MAX_NN; diff --git a/tests/mpn/t-broot.c b/tests/mpn/t-broot.c index d406e8f53..bd8e80f54 100644 --- a/tests/mpn/t-broot.c +++ b/tests/mpn/t-broot.c @@ -38,16 +38,7 @@ main (int argc, char **argv) TMP_MARK; - if (argc > 1) - { - char *end; - count = strtol (argv[1], &end, 0); - if (*end || count <= 0) - { - fprintf (stderr, "Invalid test count: %s.\n", argv[1]); - return 1; - } - } + TESTS_REPS (count, argv, argc); tests_start (); rands = RANDS; diff --git a/tests/mpn/t-brootinv.c b/tests/mpn/t-brootinv.c index 6ffd82bc2..f5a99500b 100644 --- a/tests/mpn/t-brootinv.c +++ b/tests/mpn/t-brootinv.c @@ -38,16 +38,7 @@ main (int argc, char **argv) TMP_MARK; - if (argc > 1) - { - char *end; - count = strtol (argv[1], &end, 0); - if (*end || count <= 0) - { - fprintf (stderr, "Invalid test count: %s.\n", argv[1]); - return 1; - } - } + TESTS_REPS (count, argv, argc); tests_start (); rands = RANDS; diff --git a/tests/mpn/t-div.c b/tests/mpn/t-div.c index 4e46af3d7..110385f75 100644 --- a/tests/mpn/t-div.c +++ b/tests/mpn/t-div.c @@ -139,16 +139,7 @@ main (int argc, char **argv) mp_limb_t rran0, rran1, qran0, qran1; TMP_DECL; - if (argc > 1) - { - char *end; - count = strtol (argv[1], &end, 0); - if (*end || count <= 0) - { - fprintf (stderr, "Invalid test count: %s.\n", argv[1]); - return 1; - } - } + TESTS_REPS (count, argv, argc); maxdbits = MAX_DN; maxnbits = MAX_NN; diff --git a/tests/mpn/t-invert.c b/tests/mpn/t-invert.c index ff0e8bc67..149346729 100644 --- a/tests/mpn/t-invert.c +++ b/tests/mpn/t-invert.c @@ -71,16 +71,7 @@ main (int argc, char **argv) TMP_DECL; TMP_MARK; - if (argc > 1) - { - char *end; - count = strtol (argv[1], &end, 0); - if (*end || count <= 0) - { - fprintf (stderr, "Invalid test count: %s.\n", argv[1]); - return 1; - } - } + TESTS_REPS (count, argv, argc); tests_start (); rands = RANDS; diff --git a/tests/mpn/t-minvert.c b/tests/mpn/t-minvert.c index 3140aec8c..ca5690f35 100644 --- a/tests/mpn/t-minvert.c +++ b/tests/mpn/t-minvert.c @@ -77,16 +77,7 @@ main (int argc, char **argv) mpz_init (r); mpz_init (g); - if (argc > 1) - { - char *end; - count = strtol (argv[1], &end, 0); - if (*end || count <= 0) - { - fprintf (stderr, "Invalid test count: %s.\n", argv[1]); - return 1; - } - } + TESTS_REPS (count, argv, argc); mp = TMP_ALLOC_LIMBS (MAX_SIZE); ap = TMP_ALLOC_LIMBS (MAX_SIZE); diff --git a/tests/mpn/t-mullo.c b/tests/mpn/t-mullo.c index d57d7b93a..75a0f014e 100644 --- a/tests/mpn/t-mullo.c +++ b/tests/mpn/t-mullo.c @@ -46,16 +46,7 @@ main (int argc, char **argv) TMP_DECL; TMP_MARK; - if (argc > 1) - { - char *end; - count = strtol (argv[1], &end, 0); - if (*end || count <= 0) - { - fprintf (stderr, "Invalid test count: %s.\n", argv[1]); - return 1; - } - } + TESTS_REPS (count, argv, argc); tests_start (); rands = RANDS; diff --git a/tests/mpn/t-mulmod_bnm1.c b/tests/mpn/t-mulmod_bnm1.c index 9901d49e9..d91a30d0c 100644 --- a/tests/mpn/t-mulmod_bnm1.c +++ b/tests/mpn/t-mulmod_bnm1.c @@ -84,16 +84,7 @@ main (int argc, char **argv) TMP_DECL; TMP_MARK; - if (argc > 1) - { - char *end; - count = strtol (argv[1], &end, 0); - if (*end || count <= 0) - { - fprintf (stderr, "Invalid test count: %s.\n", argv[1]); - return 1; - } - } + TESTS_REPS (count, argv, argc); tests_start (); rands = RANDS; diff --git a/tests/mpn/t-sizeinbase.c b/tests/mpn/t-sizeinbase.c index a7076be3c..f34714a98 100644 --- a/tests/mpn/t-sizeinbase.c +++ b/tests/mpn/t-sizeinbase.c @@ -46,16 +46,7 @@ main (int argc, char **argv) gmp_randstate_ptr rands; TMP_DECL; - if (argc > 1) - { - char *end; - count = strtol (argv[1], &end, 0); - if (*end || count <= 0) - { - fprintf (stderr, "Invalid test count: %s.\n", argv[1]); - return 1; - } - } + TESTS_REPS (count, argv, argc); tests_start (); TMP_MARK; diff --git a/tests/mpn/t-sqrlo.c b/tests/mpn/t-sqrlo.c index ea5eaa9c7..720ff8824 100644 --- a/tests/mpn/t-sqrlo.c +++ b/tests/mpn/t-sqrlo.c @@ -46,16 +46,7 @@ main (int argc, char **argv) TMP_DECL; TMP_MARK; - if (argc > 1) - { - char *end; - count = strtol (argv[1], &end, 0); - if (*end || count <= 0) - { - fprintf (stderr, "Invalid test count: %s.\n", argv[1]); - return 1; - } - } + TESTS_REPS (count, argv, argc); tests_start (); rands = RANDS; diff --git a/tests/mpn/t-sqrmod_bnm1.c b/tests/mpn/t-sqrmod_bnm1.c index 347b680be..9f96e83fe 100644 --- a/tests/mpn/t-sqrmod_bnm1.c +++ b/tests/mpn/t-sqrmod_bnm1.c @@ -80,16 +80,7 @@ main (int argc, char **argv) TMP_DECL; TMP_MARK; - if (argc > 1) - { - char *end; - count = strtol (argv[1], &end, 0); - if (*end || count <= 0) - { - fprintf (stderr, "Invalid test count: %s.\n", argv[1]); - return 1; - } - } + TESTS_REPS (count, argv, argc); tests_start (); rands = RANDS; diff --git a/tests/mpn/toom-shared.h b/tests/mpn/toom-shared.h index 2fe4c9331..8188b00c4 100644 --- a/tests/mpn/toom-shared.h +++ b/tests/mpn/toom-shared.h @@ -60,16 +60,7 @@ main (int argc, char **argv) TMP_DECL; TMP_MARK; - if (argc > 1) - { - char *end; - count = strtol (argv[1], &end, 0); - if (*end || count <= 0) - { - fprintf (stderr, "Invalid test count: %s.\n", argv[1]); - return 1; - } - } + TESTS_REPS (count, argv, argc); tests_start (); rands = RANDS; diff --git a/tests/mpn/toom-sqr-shared.h b/tests/mpn/toom-sqr-shared.h index b09c99450..e57ac8d9a 100644 --- a/tests/mpn/toom-sqr-shared.h +++ b/tests/mpn/toom-sqr-shared.h @@ -41,16 +41,7 @@ main (int argc, char **argv) TMP_DECL; TMP_MARK; - if (argc > 1) - { - char *end; - count = strtol (argv[1], &end, 0); - if (*end || count <= 0) - { - fprintf (stderr, "Invalid test count: %s.\n", argv[1]); - return 1; - } - } + TESTS_REPS (count, argv, argc); tests_start (); |