diff options
author | Nicola Tuveri <nic.tuv@gmail.com> | 2019-09-09 03:00:37 +0200 |
---|---|---|
committer | Nicola Tuveri <nic.tuv@gmail.com> | 2019-09-09 13:44:47 +0200 |
commit | bfed4fc8367b55e630c70cc038887ddf9b090dd6 (patch) | |
tree | 55683a384b57e6b13122c2a38cda8ff95d53430f /test | |
parent | Fix spacing nit in test/ectest.c (diff) | |
download | openssl-bfed4fc8367b55e630c70cc038887ddf9b090dd6.tar.xz openssl-bfed4fc8367b55e630c70cc038887ddf9b090dd6.zip |
Uniform TEST_*() check usage in test/ectest.c
- Replace a `TEST_true()` with `!TEST_false()` to avoid reporting
confusing errors
- We tend to use `if (!TEST_foo() || !TEST_bar())` and it's a bit
confusing to switch to `if(!(TEST_foo() && TEST_bar()))`: replace it
with the more common style
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/9813)
Diffstat (limited to 'test')
-rw-r--r-- | test/ectest.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/test/ectest.c b/test/ectest.c index 2334432bcc..4f3bfb7569 100644 --- a/test/ectest.c +++ b/test/ectest.c @@ -1679,8 +1679,8 @@ static int check_named_curve_test(int id) group_cofactor)) || !TEST_int_eq(EC_GROUP_check_named_curve(gtest, 0, NULL), 0) /* The order is not an optional field, so this should fail */ - || TEST_true(EC_GROUP_set_generator(gtest, group_gen, NULL, - group_cofactor)) + || !TEST_false(EC_GROUP_set_generator(gtest, group_gen, NULL, + group_cofactor)) || !TEST_true(EC_GROUP_set_generator(gtest, group_gen, group_order, other_cofactor)) || !TEST_int_eq(EC_GROUP_check_named_curve(gtest, 0, NULL), 0) @@ -2214,17 +2214,17 @@ static int check_ec_key_field_public_range_test(int id) BIGNUM *x = NULL, *y = NULL; EC_KEY *key = NULL; - if (!(TEST_ptr(x = BN_new()) - && TEST_ptr(y = BN_new()) - && TEST_ptr(key = EC_KEY_new_by_curve_name(curves[id].nid)) - && TEST_ptr(group = EC_KEY_get0_group(key)) - && TEST_ptr(meth = EC_GROUP_method_of(group)) - && TEST_ptr(field = EC_GROUP_get0_field(group)) - && TEST_int_gt(EC_KEY_generate_key(key), 0) - && TEST_int_gt(EC_KEY_check_key(key), 0) - && TEST_ptr(pub = EC_KEY_get0_public_key(key)) - && TEST_int_gt(EC_POINT_get_affine_coordinates(group, pub, x, y, - NULL), 0))) + if (!TEST_ptr(x = BN_new()) + || !TEST_ptr(y = BN_new()) + || !TEST_ptr(key = EC_KEY_new_by_curve_name(curves[id].nid)) + || !TEST_ptr(group = EC_KEY_get0_group(key)) + || !TEST_ptr(meth = EC_GROUP_method_of(group)) + || !TEST_ptr(field = EC_GROUP_get0_field(group)) + || !TEST_int_gt(EC_KEY_generate_key(key), 0) + || !TEST_int_gt(EC_KEY_check_key(key), 0) + || !TEST_ptr(pub = EC_KEY_get0_public_key(key)) + || !TEST_int_gt(EC_POINT_get_affine_coordinates(group, pub, x, y, + NULL), 0)) goto err; /* |