Skip to content

Commit

Permalink
keysyms: Test xkb_keysym_to_utf8 length
Browse files Browse the repository at this point in the history
  • Loading branch information
wismill committed Jan 10, 2024
1 parent 817179d commit f77c97b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/keysym.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ main(void)
ks_prev = ks;
/* Check assigned keysyms bounds */
assert((int32_t)XKB_KEYSYM_MIN_ASSIGNED <= (int32_t)ks && ks <= XKB_KEYSYM_MAX_ASSIGNED);
/* Check utf8 */
char utf8[7];
int needed = xkb_keysym_to_utf8(ks, utf8, sizeof(utf8));
assert(0 <= needed && needed <= 5);
}
iter = xkb_keysym_iterator_unref(iter);
assert(ks_prev == XKB_KEYSYM_MAX_ASSIGNED);
Expand Down

0 comments on commit f77c97b

Please sign in to comment.