mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
tests: Test coverage for bignum_dup()
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Sahana Prasad <sahana@redhat.com>
This commit is contained in:
@@ -27,10 +27,12 @@ static void check_str (int n, ssh_string str)
|
||||
}
|
||||
}
|
||||
|
||||
static void check_bignum(int n, const char *nstr) {
|
||||
bignum num, num2;
|
||||
ssh_string str;
|
||||
char *dec;
|
||||
static void check_bignum(int n, const char *nstr)
|
||||
{
|
||||
bignum num = NULL, num2 = NULL;
|
||||
bignum num3 = NULL;
|
||||
ssh_string str = NULL;
|
||||
char *dec = NULL;
|
||||
|
||||
num = bignum_new();
|
||||
assert_non_null(num);
|
||||
@@ -66,8 +68,13 @@ static void check_bignum(int n, const char *nstr) {
|
||||
assert_string_equal (nstr, dec);
|
||||
ssh_crypto_free(dec);
|
||||
|
||||
bignum_dup(num, &num3);
|
||||
assert_non_null(num3);
|
||||
assert_int_equal(0, bignum_cmp(num, num3));
|
||||
|
||||
bignum_safe_free(num);
|
||||
bignum_safe_free(num2);
|
||||
bignum_safe_free(num3);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user