[PULL libxkbcommon] Bug fixes and test changes

Ran Benita ran234 at gmail.com
Sun Apr 8 14:23:28 PDT 2012


Another large pull request, same format as before (feel free to shout!).
See the list below for some commentary.

The following changes since commit cc5588c65b504c8815e3fc56bec90b6d9ae3db24:

  Fail gracefully on failure to find component include (2012-03-29 17:39:11 +0100)

are available in the git repository at:

  git at github.com:bluetech/libxkbcommon.git tests
  https://github.com/bluetech/libxkbcommon/tree/tests

for you to fetch changes up to 85ded2292f537ac88118cdfebdfcef741e748307:

  Use stdbool.h (2012-04-09 01:43:12 +0300)

----------------------------------------------------------------
Ran Benita (30):

Fairly straightforward fixes, I think they should all be good, but
should be cherry-pickable (hope my rebasing didn't mess that up).
      Move AC_USE_SYSTEMS_EXTENSIONS before AM_INIT_AUTOMAKE
      Fix compiler warnings
      Set xorg-macros CFLAGS correctly
      Fix KeyInfo's syms array size calculation
      Make temporary fix for stale xkb_atoms
      Fix missing initialization after freeing atoms
      Avoid use of partly initialized VModInfo in error path
      Add a NULL check before before strcmp'ing
      Fix possible overflow in scanner
      makekeys: use correct format strings
      makekeys: free strings before exiting
      Remove useless check from xkb_intern_atom
      Use straight strtok_r instead of wrapper
      Replace remaining use of Atom instead of xkb_atom_t
      Remove unused struct definition
      Constify a global table and function arguments
      Do not enable yacc trace facility unconditionally

A couple of things I noticed while writing the tests. The commit
messages explain the rationale.
      Implement missing xkb_state_ref and add return value
      Constify the syms_out argument to xkb_key_get_syms()

Since Daniel did all the hard work cleaning up the header, all that's
left is to make it happen: libxkbcommon disto packages should be
dependency free after these two as far as I can tell (except maybe a
xkeyboard-config recommendation). Maybe we should completely replace
_X_EXPORT by some XKB_EXPORT macro?
      Remove Xfuncproto.h and XKB.h from xkbcommon/xkbcommon.h
      Remove xproto and kbproto from pkg-config file

The following changes seem like improvement, unless there's some reason
to do it manually?
      Implicitly include config.h in all files
      Pass DFLT_XKB_CONFIG_ROOT through config.h

A change I needed for the interactive test (see below) and makes sense
to to me.
      Add xkb_state_get_map()

This is a big commit which needs some splitting (which I can still do if
needed). Anyone writing the tests ought to be a C programmer, so why use
ugly shell? :) The shell stuff had a lot of boilerplate, and hid things
like segfaults in failtests. The commit message explains more.
      Overhaul test suite

This is the function we discussed about. No UTF-8 bonus points for me,
though :)
      Add xkb_keysym_to_unicode

A simple event-loop program which captures evdev and prints stuff to the
screen. I wrote it because I felt bad for removing the argv parsing from
the other tests, and because I had something like it written already. It
already shows some bugs (at least with my config): try keypad with
NumLock on, try seeing the group names... Couldn't figure out the root
cause of them yet.
      Add an interactive evdev test

A couple formatting changes I couldn't resist, can be dropped.
      Reformat actionHandler dispatch table
      Fix formatting in xkbcomp headers

And a sneaky attempt to remove this useless Bool stuff. Can be dropped
as well.
      Use stdbool.h

Thanks and happy Passover!
Ran

 .gitignore                                  |    1 +
 Makefile.am                                 |   45 ++-
 configure.ac                                |   19 +-
 include/xkbcommon/xkbcommon.h               |  116 ++++---
 makekeys/makekeys.c                         |   15 +-
 src/XKBcommonint.h                          |    9 +-
 src/alloc.c                                 |    6 +-
 src/atom.c                                  |   88 +++--
 src/context.c                               |   23 +-
 src/keysym.c                                |   14 +-
 src/malloc.c                                |    9 +-
 src/map.c                                   |   36 +-
 src/maprules.c                              |  118 +++----
 src/misc.c                                  |   42 +--
 src/state.c                                 |   45 ++-
 src/text.c                                  |    7 +-
 src/unicode.c                               |  326 ++++++++++++++++++
 src/utils.c                                 |    6 +-
 src/utils.h                                 |    9 +-
 src/xkb.c                                   |   21 +-
 src/xkballoc.h                              |    4 +-
 src/xkbcomp/action.c                        |  283 ++++++++-------
 src/xkbcomp/action.h                        |   20 +-
 src/xkbcomp/alias.c                         |   28 +-
 src/xkbcomp/alias.h                         |   29 +-
 src/xkbcomp/compat.c                        |  115 +++----
 src/xkbcomp/expr.c                          |  183 +++++-----
 src/xkbcomp/expr.h                          |  147 ++++----
 src/xkbcomp/indicators.c                    |   28 +-
 src/xkbcomp/indicators.h                    |   36 +-
 src/xkbcomp/keycodes.c                      |   70 ++--
 src/xkbcomp/keycodes.h                      |   15 +-
 src/xkbcomp/keymap.c                        |    6 +-
 src/xkbcomp/keytypes.c                      |  147 ++++----
 src/xkbcomp/misc.c                          |   71 ++--
 src/xkbcomp/misc.h                          |   88 ++---
 src/xkbcomp/parseutils.c                    |   30 +-
 src/xkbcomp/parseutils.h                    |  160 ++++-----
 src/xkbcomp/symbols.c                       |  326 +++++++++---------
 src/xkbcomp/vmod.c                          |   58 ++--
 src/xkbcomp/vmod.h                          |   37 +-
 src/xkbcomp/xkbcomp.c                       |   13 +-
 src/xkbcomp/xkbcomp.h                       |   14 +-
 src/xkbcomp/xkbparse.y                      |   10 +-
 src/xkbcomp/xkbpath.c                       |   12 +-
 src/xkbcomp/xkbpath.h                       |   26 +-
 src/xkbcomp/xkbscan.l                       |   33 +-
 src/xkbmisc.h                               |   12 +-
 src/xkbrules.h                              |    7 +-
 test/.gitignore                             |    2 +
 test/Makefile.am                            |   18 -
 test/canonicalise.c                         |  154 ++++++---
 test/canonicalise.sh                        |   56 ---
 test/context.c                              |    9 +-
 test/context.sh                             |   13 -
 test/{ => data}/bad.xkb                     |    0
 test/{ => data}/basic.xkb                   |    0
 test/{ => data}/comprehensive-plus-geom.xkb |    0
 test/{ => data}/default.xkb                 |    0
 test/filecomp.c                             |  100 +++---
 test/interactive.c                          |  497 +++++++++++++++++++++++++++
 test/namescomp.c                            |   62 ++--
 test/namescomp.sh                           |   37 --
 test/rulescomp.c                            |   52 +--
 test/rulescomp.sh                           |   34 --
 test/state.c                                |   20 +-
 test/state.sh                               |   13 -
 test/unicode.c                              |   85 +++++
 test/xkey.c                                 |   69 ++--
 test/xkey.sh                                |   49 ---
 xkbcommon.pc.in                             |    1 -
 71 files changed, 2464 insertions(+), 1770 deletions(-)
 create mode 100644 src/unicode.c
 delete mode 100644 test/Makefile.am
 delete mode 100755 test/canonicalise.sh
 delete mode 100755 test/context.sh
 rename test/{ => data}/bad.xkb (100%)
 rename test/{ => data}/basic.xkb (100%)
 rename test/{ => data}/comprehensive-plus-geom.xkb (100%)
 rename test/{ => data}/default.xkb (100%)
 create mode 100644 test/interactive.c
 delete mode 100755 test/namescomp.sh
 delete mode 100755 test/rulescomp.sh
 delete mode 100755 test/state.sh
 create mode 100644 test/unicode.c
 delete mode 100755 test/xkey.sh


More information about the xorg-devel mailing list