mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-07-28 01:41:48 +03:00
tests: Prefer assert_non_null over assert_true
This also replaces some occurrences of assert_true with assert_null. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Andreas Schneider
parent
89f58decb6
commit
603b6d7222
@ -191,14 +191,14 @@ static void torture_ssh_buffer_get_format(void **state) {
|
||||
assert_true(d == 0xbadc0de);
|
||||
assert_true(q == 0x13243546acbdcedf);
|
||||
|
||||
assert_true(s != NULL);
|
||||
assert_non_null(s);
|
||||
assert_int_equal(ssh_string_len(s), 6);
|
||||
assert_memory_equal(ssh_string_data(s), "libssh", 6);
|
||||
|
||||
assert_true(s1 != NULL);
|
||||
assert_non_null(s1);
|
||||
assert_string_equal(s1, "rocks");
|
||||
|
||||
assert_true(s2 != NULL);
|
||||
assert_non_null(s2);
|
||||
assert_memory_equal(s2, "So much", 7);
|
||||
|
||||
len = ssh_buffer_get_len(buffer);
|
||||
@ -228,9 +228,9 @@ static void torture_ssh_buffer_get_format_error(void **state) {
|
||||
rc = ssh_buffer_unpack(buffer, "bwdqSsPb",&b,&w,&d,&q,&s,&s1,(size_t)7,&s2,&b);
|
||||
assert_int_equal(rc, SSH_ERROR);
|
||||
|
||||
assert_true(s==NULL);
|
||||
assert_true(s1 == NULL);
|
||||
assert_true(s2 == NULL);
|
||||
assert_null(s);
|
||||
assert_null(s1);
|
||||
assert_null(s2);
|
||||
}
|
||||
|
||||
static void torture_buffer_pack_badformat(void **state){
|
||||
|
Reference in New Issue
Block a user