Merge pull request #1870 from tmael/AddressingCodeCoverage

Addressing code coverage
This commit is contained in:
David Garske
2018-10-10 14:46:32 -07:00
committed by GitHub

View File

@ -12876,7 +12876,6 @@ static int test_wc_curve25519_init (void)
curve25519_key key;
printf(testingFmt, "wc_curve25519_init()");
ret = wc_curve25519_init(&key);
/* Test bad args for wc_curve25519_init */
@ -12890,7 +12889,6 @@ static int test_wc_curve25519_init (void)
}
printf(resultFmt, ret == 0 ? passed : failed);
/* Test good args for wc_curve_25519_free */
wc_curve25519_free(&key);
@ -12900,7 +12898,37 @@ 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 */
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.
*/
@ -21946,9 +21974,8 @@ void ApiTest(void)
AssertIntEQ(test_wc_ed25519_export(), 0);
AssertIntEQ(test_wc_ed25519_size(), 0);
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);
AssertIntEQ(test_wc_ecc_check_key(), 0);