Improving code coverage

This commit is contained in:
Tesfa Mael
2018-10-09 15:43:54 -07:00
parent 7a3a314ece
commit 8f1ad656c2

View File

@ -12900,7 +12900,41 @@ static int test_wc_curve25519_init (void)
return ret;
} /* END test_wc_curve25519_init and wc_curve_25519_free*/
/*
* Testing test_wc_curve25519_size.
*/
static int test_wc_curve25519_size (void)
{
int ret = 0;
#if defined(HAVE_CURVE25519)
curve25519_key key;
printf(testingFmt, "wc_curve25519_size()");
ret = wc_curve25519_init(&key);
/* Test good args for wc_curve25519_size */
ret = wc_curve25519_size(&key);
/* Test bad args for wc_curve25519_size */
if (ret == 0) {
ret = wc_curve25519_size(NULL);
if (ret != 0) {
ret = SSL_FATAL_ERROR;
}
}
printf(resultFmt, ret == 0 ? passed : failed);
wc_curve25519_free(NULL);
#endif
return ret;
} /* END test_wc_curve25519_size*/
/*
* Testing wc_ecc_make_key.
*/
@ -21948,6 +21982,7 @@ void ApiTest(void)
AssertIntEQ(test_wc_ed25519_exportKey(), 0);
AssertIntEQ(test_wc_curve25519_init(), 0);
AssertIntEQ(test_wc_curve25519_size (), 0);
AssertIntEQ(test_wc_ecc_make_key(), 0);
AssertIntEQ(test_wc_ecc_init(), 0);