Changeset View
Changeset View
Standalone View
Standalone View
src/secp256k1/src/tests.c
Show First 20 Lines • Show All 5,629 Lines • ▼ Show 20 Lines | int main(int argc, char **argv) { | ||||
setbuf(stdout, NULL); | setbuf(stdout, NULL); | ||||
/* Also disable buffering for stderr because it's not guaranteed that it's | /* Also disable buffering for stderr because it's not guaranteed that it's | ||||
* unbuffered on all systems. */ | * unbuffered on all systems. */ | ||||
setbuf(stderr, NULL); | setbuf(stderr, NULL); | ||||
/* find iteration count */ | /* find iteration count */ | ||||
if (argc > 1) { | if (argc > 1) { | ||||
count = strtol(argv[1], NULL, 0); | count = strtol(argv[1], NULL, 0); | ||||
} else { | |||||
const char* env = getenv("SECP256K1_TEST_ITERS"); | |||||
if (env) { | |||||
count = strtol(env, NULL, 0); | |||||
} | |||||
} | |||||
if (count <= 0) { | |||||
fputs("An iteration count of 0 or less is not allowed.\n", stderr); | |||||
return EXIT_FAILURE; | |||||
} | } | ||||
printf("test count = %i\n", count); | printf("test count = %i\n", count); | ||||
/* find random seed */ | /* find random seed */ | ||||
secp256k1_testrand_init(argc > 2 ? argv[2] : NULL); | secp256k1_testrand_init(argc > 2 ? argv[2] : NULL); | ||||
/* initialize */ | /* initialize */ | ||||
run_context_tests(0); | run_context_tests(0); | ||||
▲ Show 20 Lines • Show All 110 Lines • Show Last 20 Lines |