This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch master
in repository gfs2-utils.
The following commit(s) were added to refs/heads/master by this push:
new 361daca tests: Don't use fail_unless in unit tests
361daca is described below
commit 361daca44f22905fa99a1fcb8f58dbe4afd8d76e
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Wed Jul 29 12:08:51 2020 +0100
tests: Don't use fail_unless in unit tests
fail_unless() is deprecated in check so switch to ck_assert()
Bump the required check version to 0.10.0
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
configure.ac | 2 +-
tests/check_meta.c | 2 +-
tests/check_rgrp.c | 14 +++++++-------
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/configure.ac b/configure.ac
index de9d526..855bc64 100644
--- a/configure.ac
+++ b/configure.ac
@@ -98,7 +98,7 @@ AC_ARG_ENABLE([gprof],
# We use the Check framework for unit tests
-PKG_CHECK_MODULES([check], [check >= 0.9.8],
+PKG_CHECK_MODULES([check], [check >= 0.10.0],
[have_check=yes],
[have_check=no])
AM_CONDITIONAL([HAVE_CHECK], [test "x$have_check" = "xyes"])
diff --git a/tests/check_meta.c b/tests/check_meta.c
index 689a5cc..8c7fab1 100644
--- a/tests/check_meta.c
+++ b/tests/check_meta.c
@@ -6,7 +6,7 @@ void print_it(const char *label, const char *fmt, const char *fmt2, ...) {}
START_TEST(test_lgfs2_meta)
{
- fail_unless(lgfs2_selfcheck() == 0);
+ ck_assert(lgfs2_selfcheck() == 0);
}
END_TEST
diff --git a/tests/check_rgrp.c b/tests/check_rgrp.c
index 30461a9..3d8a5ed 100644
--- a/tests/check_rgrp.c
+++ b/tests/check_rgrp.c
@@ -16,7 +16,7 @@ static lgfs2_rgrps_t mockup_rgrp(void)
uint32_t rgsize = (1024 << 20) / 4096;
sdp = calloc(1, sizeof(*sdp));
- fail_unless(sdp != NULL);
+ ck_assert(sdp != NULL);
sdp->device.length = rgsize + 20;
sdp->device_fd = -1;
@@ -24,7 +24,7 @@ static lgfs2_rgrps_t mockup_rgrp(void)
compute_constants(sdp);
rgs = lgfs2_rgrps_init(sdp, 0, 0);
- fail_unless(rgs != NULL);
+ ck_assert(rgs != NULL);
lgfs2_rgrps_plan(rgs, sdp->device.length - 16, rgsize);
@@ -32,11 +32,11 @@ static lgfs2_rgrps_t mockup_rgrp(void)
ck_assert(addr != 0);
rg = lgfs2_rgrps_append(rgs, &ri, 0);
- fail_unless(rg != NULL);
+ ck_assert(rg != NULL);
for (i = 0; i < rg->ri.ri_length; i++) {
rg->bits[i].bi_data = calloc(1, sdp->bsize);
- fail_unless(rg->bits[i].bi_data != NULL);
+ ck_assert(rg->bits[i].bi_data != NULL);
}
return rgs;
}
@@ -44,7 +44,7 @@ static lgfs2_rgrps_t mockup_rgrp(void)
START_TEST(test_mockup_rgrp)
{
lgfs2_rgrps_t rgs = mockup_rgrp();
- fail_unless(rgs != NULL);
+ ck_assert(rgs != NULL);
}
END_TEST
@@ -66,7 +66,7 @@ START_TEST(test_rbm_find_good)
ck_assert_int_eq(err, 0);
addr = lgfs2_rbm_to_block(&rbm);
- fail_unless(addr == rbm.rgd->ri.ri_data0);
+ ck_assert(addr == rbm.rgd->ri.ri_data0);
}
}
END_TEST
@@ -110,7 +110,7 @@ START_TEST(test_rbm_find_lastblock)
ck_assert_int_eq(err, 0);
addr = lgfs2_rbm_to_block(&rbm);
- fail_unless(addr == (rg->ri.ri_data0 + rg->ri.ri_data - 1));
+ ck_assert(addr == (rg->ri.ri_data0 + rg->ri.ri_data - 1));
}
END_TEST
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.