test: Add convenience functions for xkey.sh

master
Dan Nicholson 2009-01-22 20:10:19 -08:00
parent e8c7f68539
commit 49a06f926d
1 changed files with 16 additions and 13 deletions

View File

@ -13,18 +13,21 @@ check_error()
fi
}
val=`${builddir}/xkey -s Undo` && \
check_error Undo 0xff65 $val || \
check_string()
{
val=`${builddir}/xkey -s "$1"` &&
check_error "$1" "$2" "$val" ||
exit $?
}
val=`${builddir}/xkey -k 0x1008ff56` && \
check_error 0x1008FF56 XF86Close $val || \
check_key()
{
val=`${builddir}/xkey -k "$1"` && \
check_error "$1" "$2" "$val" || \
exit $?
}
val=`${builddir}/xkey -s ThisKeyShouldNotExist` && \
check_error ThisKeyShouldNotExist NoSymbol $val || \
exit $?
val=`${builddir}/xkey -k 0x0` && \
check_error 0x0 NULL $val || \
exit $?
check_string Undo 0xff65
check_key 0x1008FF56 XF86Close
check_string ThisKeyShouldNotExist NoSymbol
check_key 0x0 NULL