test: move an assert up to before the strlen() use
../../../test/keysym.c:80:24: warning: Null pointer passed to 1st parameter expecting 'nonnull' [core.NonNullParamChecker] (unsigned) strlen(expected)); Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>master
parent
fa86433e7c
commit
d172652753
|
@ -76,12 +76,13 @@ test_utf8(xkb_keysym_t keysym, const char *expected)
|
||||||
if (ret <= 0)
|
if (ret <= 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
assert(expected != NULL);
|
||||||
|
|
||||||
fprintf(stderr, "Expected keysym %#x -> %s (%u bytes)\n", keysym, expected,
|
fprintf(stderr, "Expected keysym %#x -> %s (%u bytes)\n", keysym, expected,
|
||||||
(unsigned) strlen(expected));
|
(unsigned) strlen(expected));
|
||||||
fprintf(stderr, "Received keysym %#x -> %s (%u bytes)\n\n", keysym, s,
|
fprintf(stderr, "Received keysym %#x -> %s (%u bytes)\n\n", keysym, s,
|
||||||
(unsigned) strlen(s));
|
(unsigned) strlen(s));
|
||||||
|
|
||||||
assert(expected != NULL);
|
|
||||||
return streq(s, expected);
|
return streq(s, expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue