mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 03:07:29 +02:00
Improving code coverage
This commit is contained in:
35
tests/api.c
35
tests/api.c
@ -12900,7 +12900,41 @@ static int test_wc_curve25519_init (void)
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
} /* END test_wc_curve25519_init and wc_curve_25519_free*/
|
} /* 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.
|
* Testing wc_ecc_make_key.
|
||||||
*/
|
*/
|
||||||
@ -21948,6 +21982,7 @@ void ApiTest(void)
|
|||||||
AssertIntEQ(test_wc_ed25519_exportKey(), 0);
|
AssertIntEQ(test_wc_ed25519_exportKey(), 0);
|
||||||
|
|
||||||
AssertIntEQ(test_wc_curve25519_init(), 0);
|
AssertIntEQ(test_wc_curve25519_init(), 0);
|
||||||
|
AssertIntEQ(test_wc_curve25519_size (), 0);
|
||||||
|
|
||||||
AssertIntEQ(test_wc_ecc_make_key(), 0);
|
AssertIntEQ(test_wc_ecc_make_key(), 0);
|
||||||
AssertIntEQ(test_wc_ecc_init(), 0);
|
AssertIntEQ(test_wc_ecc_init(), 0);
|
||||||
|
Reference in New Issue
Block a user