misc: Add ssh_list_count()

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Andreas Schneider
2018-02-02 13:06:02 +01:00
parent a465ea2d49
commit 32c49ea134
3 changed files with 26 additions and 0 deletions

View File

@@ -17,6 +17,8 @@ static void torture_ssh_list_new(void **state) {
assert_true(xlist->root == NULL);
assert_true(xlist->end == NULL);
assert_int_equal(ssh_list_count(xlist), 0);
ssh_list_free(xlist);
}
@@ -46,6 +48,8 @@ static void torture_ssh_list_append(void **state) {
assert_string_equal((const char *) xlist->root->next->next->data, "item3");
assert_string_equal((const char *) xlist->end->data, "item3");
assert_int_equal(ssh_list_count(xlist), 3);
ssh_list_free(xlist);
}
@@ -75,6 +79,8 @@ static void torture_ssh_list_prepend(void **state) {
assert_string_equal((const char *) xlist->root->next->next->data, "item2");
assert_string_equal((const char *) xlist->end->data, "item2");
assert_int_equal(ssh_list_count(xlist), 3);
ssh_list_free(xlist);
}