forked from wolfSSL/wolfssl
Merge pull request #1870 from tmael/AddressingCodeCoverage
Addressing code coverage
This commit is contained in:
37
tests/api.c
37
tests/api.c
@ -12869,14 +12869,13 @@ static int test_wc_ed25519_exportKey (void)
|
|||||||
*/
|
*/
|
||||||
static int test_wc_curve25519_init (void)
|
static int test_wc_curve25519_init (void)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
#if defined(HAVE_CURVE25519)
|
#if defined(HAVE_CURVE25519)
|
||||||
|
|
||||||
curve25519_key key;
|
curve25519_key key;
|
||||||
|
|
||||||
printf(testingFmt, "wc_curve25519_init()");
|
printf(testingFmt, "wc_curve25519_init()");
|
||||||
|
|
||||||
ret = wc_curve25519_init(&key);
|
ret = wc_curve25519_init(&key);
|
||||||
|
|
||||||
/* Test bad args for wc_curve25519_init */
|
/* Test bad args for wc_curve25519_init */
|
||||||
@ -12890,7 +12889,6 @@ static int test_wc_curve25519_init (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
printf(resultFmt, ret == 0 ? passed : failed);
|
printf(resultFmt, ret == 0 ? passed : failed);
|
||||||
|
|
||||||
/* Test good args for wc_curve_25519_free */
|
/* Test good args for wc_curve_25519_free */
|
||||||
wc_curve25519_free(&key);
|
wc_curve25519_free(&key);
|
||||||
|
|
||||||
@ -12900,7 +12898,37 @@ 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 */
|
||||||
|
if (ret == 0) {
|
||||||
|
ret = wc_curve25519_size(&key);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Test bad args for wc_curve25519_size */
|
||||||
|
if (ret != 0) {
|
||||||
|
ret = wc_curve25519_size(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
printf(resultFmt, ret == 0 ? passed : failed);
|
||||||
|
wc_curve25519_free(&key);
|
||||||
|
#endif
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
} /* END test_wc_curve25519_size*/
|
||||||
/*
|
/*
|
||||||
* Testing wc_ecc_make_key.
|
* Testing wc_ecc_make_key.
|
||||||
*/
|
*/
|
||||||
@ -21946,9 +21974,8 @@ void ApiTest(void)
|
|||||||
AssertIntEQ(test_wc_ed25519_export(), 0);
|
AssertIntEQ(test_wc_ed25519_export(), 0);
|
||||||
AssertIntEQ(test_wc_ed25519_size(), 0);
|
AssertIntEQ(test_wc_ed25519_size(), 0);
|
||||||
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);
|
||||||
AssertIntEQ(test_wc_ecc_check_key(), 0);
|
AssertIntEQ(test_wc_ecc_check_key(), 0);
|
||||||
|
Reference in New Issue
Block a user