[PATCH 1/7] test: type-safe two ck_assert invocations
Peter Hutterer
peter.hutterer at who-t.net
Thu May 7 22:57:44 PDT 2015
unsigned vs signed in both cases, but the ck_assert macros hide that
(everything is cast to intmax_t). The upcoming litest_assert wrappers expose
these warnings, so fix them ahead of time.
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
test/litest.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/test/litest.c b/test/litest.c
index c24a306..7764b8b 100644
--- a/test/litest.c
+++ b/test/litest.c
@@ -567,9 +567,10 @@ litest_init_udev_rules(struct litest_test_device *dev)
UDEV_RULE_PREFIX,
dev->shortname);
ck_assert_int_eq(rc,
+ (int)(
strlen(UDEV_RULES_D) +
strlen(UDEV_RULE_PREFIX) +
- strlen(dev->shortname) + 7);
+ strlen(dev->shortname) + 7));
f = fopen(path, "w");
ck_assert_notnull(f);
ck_assert_int_ge(fputs(dev->udev_rule, f), 0);
@@ -1126,7 +1127,7 @@ litest_scale(const struct litest_device *d, unsigned int axis, double val)
int min, max;
ck_assert_int_ge(val, 0);
ck_assert_int_le(val, 100);
- ck_assert_int_le(axis, ABS_Y);
+ ck_assert_int_le(axis, (unsigned int)ABS_Y);
min = d->interface->min[axis];
max = d->interface->max[axis];
--
2.3.5
More information about the wayland-devel
mailing list