Skip to content

Commit

Permalink
vec: fix test reported by debian ci
Browse files Browse the repository at this point in the history
  • Loading branch information
bapt committed Nov 21, 2024
1 parent 97bb391 commit 169a72e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/lib/vec.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,24 +91,24 @@ ATF_TC_BODY(charv_t, tc)

ATF_TC_BODY(c_charv_contains, tc)
{
charv_t list;
c_charv_t list;

pkgvec_init(&list);
ATF_REQUIRE_EQ_MSG(list.d, NULL, "pkgvec_init failed");
ATF_REQUIRE_EQ_MSG(list.cap, 0, "pkgvec_init failed");
ATF_REQUIRE_EQ_MSG(list.len, 0, "pkgvec_init failed");

pkgvec_push(&list, xstrdup("test1"));
pkgvec_push(&list, "test1");
ATF_REQUIRE_MSG(list.d != NULL, "pkgvec_push failed");
ATF_REQUIRE_EQ_MSG(list.cap, 1, "pkgvec_push failed");
ATF_REQUIRE_EQ_MSG(list.len, 1, "pkgvec_push failed");

pkgvec_push(&list, xstrdup("test2"));
pkgvec_push(&list, "test2");
ATF_REQUIRE_MSG(list.d != NULL, "pkgvec_push2 failed");
ATF_REQUIRE_EQ_MSG(list.cap, 2, "pkgvec_push2 failed");
ATF_REQUIRE_EQ_MSG(list.len, 2, "pkgvec_push2 failed");

pkgvec_push(&list, xstrdup("test3"));
pkgvec_push(&list, "test3");
ATF_REQUIRE_MSG(list.d != NULL, "pkgvec_push3 failed");
ATF_REQUIRE_EQ_MSG(list.cap, 4, "pkgvec_push3 failed");
ATF_REQUIRE_EQ_MSG(list.len, 3, "pkgvec_push3 failed");
Expand All @@ -117,6 +117,7 @@ ATF_TC_BODY(c_charv_contains, tc)
ATF_REQUIRE_EQ_MSG(c_charv_contains(&list, "Test3", false), true, "c_charv_contains not case insensitive");
ATF_REQUIRE_EQ_MSG(c_charv_contains(&list, "aest3", false), false, "c_charv_contains should not find anything");
}

ATF_TP_ADD_TCS(tp)
{
ATF_TP_ADD_TC(tp, c_charv_t);
Expand Down

0 comments on commit 169a72e

Please sign in to comment.