test/params_api_test.c: fix size_t assumptions
authorRichard Levitte <levitte@openssl.org>
Sat, 16 Mar 2019 09:43:48 +0000 (10:43 +0100)
committerRichard Levitte <levitte@openssl.org>
Sun, 17 Mar 2019 08:13:29 +0000 (09:13 +0100)
size_t isn't always as large as a int64_t, so the compiler complains
about possible data loss.  In this case, we are in control, so a
simple cast will do.

Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/8497)

test/params_api_test.c

index 77b8af4f4b6e77b8f133101abed3a9e692d19e15..97c8a9dce5d357706296ae0bb47c1ebfcb5e7177 100644 (file)
@@ -103,12 +103,12 @@ static int test_param_type_extra(const OSSL_PARAM *param, unsigned char *cmp,
         if (signd) {
             if (!TEST_true(OSSL_PARAM_set_int32(param, 12345))
                 || !TEST_true(OSSL_PARAM_get_int64(param, &i64))
-                || !TEST_size_t_eq(i64, 12345))
+                || !TEST_size_t_eq((size_t)i64, 12345))
                 return 0;
         } else {
             if (!TEST_true(OSSL_PARAM_set_uint32(param, 12345))
                 || !TEST_true(OSSL_PARAM_get_uint64(param, (uint64_t *)&i64))
-                || !TEST_size_t_eq(i64, 12345))
+                || !TEST_size_t_eq((size_t)i64, 12345))
                 return 0;
         }
     }