From f49eea4ee3f657a8d4c54e6d5d6e9324310c9cb1 Mon Sep 17 00:00:00 2001 From: tb Date: Thu, 1 Dec 2022 13:49:12 +0000 Subject: [PATCH] Refrain from printing SUCCESS in some of my tests Silence is good. On failure, the regress framework will make it clear. --- regress/lib/libcrypto/bn/general/bn_isqrt.c | 5 +---- regress/lib/libcrypto/bn/general/bn_mod_exp2_mont.c | 4 +--- regress/lib/libcrypto/bn/general/bn_mod_sqrt.c | 5 +---- regress/lib/libcrypto/bn/general/bn_primes.c | 4 +--- regress/lib/libcrypto/bn/general/bn_to_string.c | 3 +-- regress/lib/libcrypto/bn/general/bn_unit.c | 5 +---- regress/lib/libcrypto/bn/rand/bn_rand_interval.c | 7 +------ regress/lib/libcrypto/ec/ec_point_conversion.c | 10 ++++------ regress/lib/libcrypto/evp/evp_pkey_check.c | 4 +--- regress/lib/libcrypto/evp/evp_pkey_cleanup.c | 5 +---- regress/lib/libcrypto/wycheproof/wycheproof-primes.c | 4 +--- regress/lib/libssl/handshake/handshake_table.c | 5 +---- .../lib/libssl/handshake/valid_handshakes_terminate.c | 5 +---- 13 files changed, 16 insertions(+), 50 deletions(-) diff --git a/regress/lib/libcrypto/bn/general/bn_isqrt.c b/regress/lib/libcrypto/bn/general/bn_isqrt.c index 8ea9cead777..b0ec80b9392 100644 --- a/regress/lib/libcrypto/bn/general/bn_isqrt.c +++ b/regress/lib/libcrypto/bn/general/bn_isqrt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_isqrt.c,v 1.8 2022/11/26 16:08:56 tb Exp $ */ +/* $OpenBSD: bn_isqrt.c,v 1.9 2022/12/01 13:49:12 tb Exp $ */ /* * Copyright (c) 2022 Theo Buehler * @@ -323,8 +323,5 @@ main(int argc, char *argv[]) failed |= check_tables(0); failed |= validate_tables(); - if (!failed) - printf("SUCCESS\n"); - return failed; } diff --git a/regress/lib/libcrypto/bn/general/bn_mod_exp2_mont.c b/regress/lib/libcrypto/bn/general/bn_mod_exp2_mont.c index 60bb010b629..f0ebfcbac14 100644 --- a/regress/lib/libcrypto/bn/general/bn_mod_exp2_mont.c +++ b/regress/lib/libcrypto/bn/general/bn_mod_exp2_mont.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_mod_exp2_mont.c,v 1.1 2022/03/10 04:39:49 tb Exp $ */ +/* $OpenBSD: bn_mod_exp2_mont.c,v 1.2 2022/12/01 13:49:12 tb Exp $ */ /* * Copyright (c) 2022 Theo Buehler * @@ -39,7 +39,5 @@ main(void) BN_free(m); - printf("SUCCESS\n"); - return 0; } diff --git a/regress/lib/libcrypto/bn/general/bn_mod_sqrt.c b/regress/lib/libcrypto/bn/general/bn_mod_sqrt.c index 2017492e2be..71e27a36e18 100644 --- a/regress/lib/libcrypto/bn/general/bn_mod_sqrt.c +++ b/regress/lib/libcrypto/bn/general/bn_mod_sqrt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_mod_sqrt.c,v 1.1 2022/03/15 16:28:42 tb Exp $ */ +/* $OpenBSD: bn_mod_sqrt.c,v 1.2 2022/12/01 13:49:12 tb Exp $ */ /* * Copyright (c) 2022 Theo Buehler * @@ -125,8 +125,5 @@ main(void) for (i = 0; i < N_TESTS; i++) failed |= mod_sqrt_test(&mod_sqrt_test_data[i]); - if (!failed) - printf("SUCCESS\n"); - return failed; } diff --git a/regress/lib/libcrypto/bn/general/bn_primes.c b/regress/lib/libcrypto/bn/general/bn_primes.c index c61cdb34b83..cf13db6f8e1 100644 --- a/regress/lib/libcrypto/bn/general/bn_primes.c +++ b/regress/lib/libcrypto/bn/general/bn_primes.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_primes.c,v 1.2 2022/11/09 23:28:08 tb Exp $ */ +/* $OpenBSD: bn_primes.c,v 1.3 2022/12/01 13:49:12 tb Exp $ */ /* * Copyright (c) 2022 Theo Buehler * @@ -84,7 +84,5 @@ main(void) failed |= test_bn_is_prime_fasttest(0); failed |= test_bn_is_prime_fasttest(1); - printf("%s\n", failed ? "FAILED" : "SUCCESS"); - return failed; } diff --git a/regress/lib/libcrypto/bn/general/bn_to_string.c b/regress/lib/libcrypto/bn/general/bn_to_string.c index 60b3ea31370..901fa98610b 100644 --- a/regress/lib/libcrypto/bn/general/bn_to_string.c +++ b/regress/lib/libcrypto/bn/general/bn_to_string.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_to_string.c,v 1.1 2019/04/13 22:06:31 tb Exp $ */ +/* $OpenBSD: bn_to_string.c,v 1.2 2022/12/01 13:49:12 tb Exp $ */ /* * Copyright (c) 2019 Theo Buehler * @@ -111,6 +111,5 @@ main(int argc, char *argv[]) BN_free(bn); - printf("%s\n", failed ? "FAILED" : "SUCCESS"); return failed; } diff --git a/regress/lib/libcrypto/bn/general/bn_unit.c b/regress/lib/libcrypto/bn/general/bn_unit.c index e84ce481a54..f2b3652f88a 100644 --- a/regress/lib/libcrypto/bn/general/bn_unit.c +++ b/regress/lib/libcrypto/bn/general/bn_unit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_unit.c,v 1.5 2022/11/25 09:32:10 tb Exp $ */ +/* $OpenBSD: bn_unit.c,v 1.6 2022/12/01 13:49:12 tb Exp $ */ /* * Copyright (c) 2022 Theo Buehler @@ -75,8 +75,5 @@ main(void) failed |= test_bn_print_null_derefs(); - if (!failed) - printf("SUCCESS\n"); - return failed; } diff --git a/regress/lib/libcrypto/bn/rand/bn_rand_interval.c b/regress/lib/libcrypto/bn/rand/bn_rand_interval.c index 409d65740b1..8cd552734c3 100644 --- a/regress/lib/libcrypto/bn/rand/bn_rand_interval.c +++ b/regress/lib/libcrypto/bn/rand/bn_rand_interval.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_rand_interval.c,v 1.5 2022/06/19 17:10:02 tb Exp $ */ +/* $OpenBSD: bn_rand_interval.c,v 1.6 2022/12/01 13:49:12 tb Exp $ */ /* * Copyright (c) 2018 Theo Buehler * @@ -104,11 +104,6 @@ main(int argc, char *argv[]) } } - if (success == 1) - printf("SUCCESS\n"); - else - printf("FAIL"); - BN_free(a); BN_free(b); BN_free(x); diff --git a/regress/lib/libcrypto/ec/ec_point_conversion.c b/regress/lib/libcrypto/ec/ec_point_conversion.c index 8327ac43369..04177a0e87e 100644 --- a/regress/lib/libcrypto/ec/ec_point_conversion.c +++ b/regress/lib/libcrypto/ec/ec_point_conversion.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_point_conversion.c,v 1.6 2021/12/29 22:48:09 tb Exp $ */ +/* $OpenBSD: ec_point_conversion.c,v 1.7 2022/12/01 13:49:12 tb Exp $ */ /* * Copyright (c) 2021 Theo Buehler * Copyright (c) 2021 Joel Sing @@ -134,7 +134,7 @@ test_hybrid_corner_case(void) for (i = 0; i < N_FORMS; i++) failed |= roundtrip(group, point, forms[i], x, y); - fprintf(stderr, "%s: %s\n", __func__, failed ? "FAILED" : "SUCCESS"); + fprintf(stderr, "%s %s\n", __func__, failed ? ": FAILED" : ""); EC_GROUP_free(group); EC_POINT_free(point); @@ -229,7 +229,7 @@ test_random_points(void) for (curve_id = 0; curve_id < ncurves; curve_id++) failed |= test_random_points_on_curve(&all_curves[curve_id]); - fprintf(stderr, "%s: %s\n", __func__, failed ? "FAILED" : "SUCCESS"); + fprintf(stderr, "%s %s\n", __func__, failed ? ": FAILED" : ""); free(all_curves); return failed; @@ -869,7 +869,7 @@ test_point_conversions(void) for (i = 0; i < N_POINT_CONVERSIONS; i++) failed |= point_conversion_form_y_bit(&point_conversions[i]); - fprintf(stderr, "%s: %s\n", __func__, failed ? "FAILED" : "SUCCESS"); + fprintf(stderr, "%s %s\n", __func__, failed ? ": FAILED" : ""); return failed; } @@ -883,7 +883,5 @@ main(int argc, char **argv) failed |= test_hybrid_corner_case(); failed |= test_point_conversions(); - fprintf(stderr, "%s\n", failed ? "FAILED" : "SUCCESS"); - return failed; } diff --git a/regress/lib/libcrypto/evp/evp_pkey_check.c b/regress/lib/libcrypto/evp/evp_pkey_check.c index db26d3aa461..a1863477369 100644 --- a/regress/lib/libcrypto/evp/evp_pkey_check.c +++ b/regress/lib/libcrypto/evp/evp_pkey_check.c @@ -1,4 +1,4 @@ -/* $OpenBSD: evp_pkey_check.c,v 1.2 2022/01/11 19:27:35 tb Exp $ */ +/* $OpenBSD: evp_pkey_check.c,v 1.3 2022/12/01 13:49:12 tb Exp $ */ /* * Copyright (c) 2021-2022 Theo Buehler * @@ -398,7 +398,5 @@ main(void) failed |= evp_pkey_check_rsa(); failed |= evp_pkey_check_ec(); - printf("%s\n", failed ? "FAILED" : "SUCCESS"); - return failed; } diff --git a/regress/lib/libcrypto/evp/evp_pkey_cleanup.c b/regress/lib/libcrypto/evp/evp_pkey_cleanup.c index 20a385588ea..fd922efb091 100644 --- a/regress/lib/libcrypto/evp/evp_pkey_cleanup.c +++ b/regress/lib/libcrypto/evp/evp_pkey_cleanup.c @@ -1,4 +1,4 @@ -/* $OpenBSD: evp_pkey_cleanup.c,v 1.2 2022/11/26 16:08:56 tb Exp $ */ +/* $OpenBSD: evp_pkey_cleanup.c,v 1.3 2022/12/01 13:49:12 tb Exp $ */ /* * Copyright (c) 2022 Theo Buehler @@ -79,8 +79,5 @@ main(void) for (i = 0; i < N_PKEY_IDS; i++) failed |= test_evp_pkey_ctx_cleanup(pkey_ids[i]); - if (!failed) - printf("SUCCESS\n"); - return failed; } diff --git a/regress/lib/libcrypto/wycheproof/wycheproof-primes.c b/regress/lib/libcrypto/wycheproof/wycheproof-primes.c index 669531d1356..57bd7a53da0 100644 --- a/regress/lib/libcrypto/wycheproof/wycheproof-primes.c +++ b/regress/lib/libcrypto/wycheproof/wycheproof-primes.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wycheproof-primes.c,v 1.1 2022/07/07 20:01:20 tb Exp $ */ +/* $OpenBSD: wycheproof-primes.c,v 1.2 2022/12/01 13:49:12 tb Exp $ */ /* * Copyright (c) 2022 Theo Buehler * @@ -57,7 +57,5 @@ main(void) for (i = 0; i < N_TESTS; i++) failed |= primality_test(&testcases[i]); - printf("%s\n", failed ? "FAILED" : "SUCCESS"); - return failed; } diff --git a/regress/lib/libssl/handshake/handshake_table.c b/regress/lib/libssl/handshake/handshake_table.c index b316734524b..8ebed9a73e1 100644 --- a/regress/lib/libssl/handshake/handshake_table.c +++ b/regress/lib/libssl/handshake/handshake_table.c @@ -1,4 +1,4 @@ -/* $OpenBSD: handshake_table.c,v 1.17 2022/03/08 16:59:25 tb Exp $ */ +/* $OpenBSD: handshake_table.c,v 1.18 2022/12/01 13:49:12 tb Exp $ */ /* * Copyright (c) 2019 Theo Buehler * @@ -546,8 +546,5 @@ main(int argc, char *argv[]) if (!verify_table(hs_table, print)) return 1; - if (!print) - printf("SUCCESS\n"); - return 0; } diff --git a/regress/lib/libssl/handshake/valid_handshakes_terminate.c b/regress/lib/libssl/handshake/valid_handshakes_terminate.c index 5f0e4f2c188..286b860a7d7 100644 --- a/regress/lib/libssl/handshake/valid_handshakes_terminate.c +++ b/regress/lib/libssl/handshake/valid_handshakes_terminate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: valid_handshakes_terminate.c,v 1.3 2019/04/05 20:25:42 tb Exp $ */ +/* $OpenBSD: valid_handshakes_terminate.c,v 1.4 2022/12/01 13:49:12 tb Exp $ */ /* * Copyright (c) 2019 Theo Buehler * @@ -50,8 +50,5 @@ main(int argc, char *argv[]) } } - if (!fail) - printf("SUCCESS\n"); - return fail; } -- 2.20.1