parent
e7570bcb78
commit
e325e65eb8
|
@ -156,6 +156,8 @@ main(void)
|
|||
struct atom_table *table;
|
||||
xkb_atom_t atom1, atom2, atom3;
|
||||
|
||||
test_init();
|
||||
|
||||
table = atom_table_new();
|
||||
assert(table);
|
||||
|
||||
|
|
|
@ -169,6 +169,8 @@ test_recursive(void)
|
|||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
test_init();
|
||||
|
||||
struct xkb_context *ctx = test_get_context(0);
|
||||
struct xkb_keymap *keymap;
|
||||
char *original, *dump;
|
||||
|
|
|
@ -51,6 +51,15 @@
|
|||
|
||||
#include "tools/tools-common.h"
|
||||
|
||||
|
||||
/* Setup test */
|
||||
void
|
||||
test_init(void)
|
||||
{
|
||||
/* Make stdout always unbuffered, to ensure we always get it entirely */
|
||||
setbuf(stdout, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Test a sequence of keysyms, resulting from a sequence of key presses,
|
||||
* against the keysyms they're supposed to generate.
|
||||
|
@ -298,8 +307,6 @@ test_get_context(enum test_context_flags test_flags)
|
|||
struct xkb_context *ctx;
|
||||
char *path;
|
||||
|
||||
setbuf(stdout, NULL);
|
||||
|
||||
ctx_flags = XKB_CONTEXT_NO_DEFAULT_INCLUDES;
|
||||
if (test_flags & CONTEXT_ALLOW_ENVIRONMENT_NAMES) {
|
||||
unsetenv("XKB_DEFAULT_RULES");
|
||||
|
|
|
@ -942,6 +942,8 @@ main(int argc, char *argv[])
|
|||
{
|
||||
struct xkb_context *ctx;
|
||||
|
||||
test_init();
|
||||
|
||||
ctx = test_get_context(CONTEXT_NO_FLAG);
|
||||
assert(ctx);
|
||||
|
||||
|
|
|
@ -290,6 +290,8 @@ test_include_order(void)
|
|||
int
|
||||
main(void)
|
||||
{
|
||||
test_init();
|
||||
|
||||
struct xkb_context *context = test_get_context(0);
|
||||
xkb_atom_t atom;
|
||||
|
||||
|
|
|
@ -40,6 +40,8 @@ test_file(struct xkb_context *ctx, const char *path_rel)
|
|||
int
|
||||
main(void)
|
||||
{
|
||||
test_init();
|
||||
|
||||
struct xkb_context *ctx = test_get_context(0);
|
||||
|
||||
assert(test_file(ctx, "keymaps/basic.xkb"));
|
||||
|
|
|
@ -233,6 +233,8 @@ test_multiple_keysyms_per_level(void)
|
|||
int
|
||||
main(void)
|
||||
{
|
||||
test_init();
|
||||
|
||||
test_garbage_key();
|
||||
test_keymap();
|
||||
test_numeric_keysyms();
|
||||
|
|
|
@ -29,6 +29,8 @@
|
|||
int
|
||||
main(void)
|
||||
{
|
||||
test_init();
|
||||
|
||||
struct xkb_context *ctx = test_get_context(0);
|
||||
struct xkb_keymap *keymap;
|
||||
|
||||
|
|
|
@ -298,6 +298,8 @@ test_utf32_to_keysym(uint32_t ucs, xkb_keysym_t expected)
|
|||
int
|
||||
main(void)
|
||||
{
|
||||
test_init();
|
||||
|
||||
/* Bounds */
|
||||
assert(XKB_KEYSYM_MIN == 0);
|
||||
assert(XKB_KEYSYM_MIN < XKB_KEYSYM_MAX);
|
||||
|
|
|
@ -75,6 +75,8 @@ main(void)
|
|||
struct xkb_context *ctx;
|
||||
int ret;
|
||||
|
||||
test_init();
|
||||
|
||||
ret = setenv("XKB_LOG_LEVEL", "warn", 1);
|
||||
assert(ret == 0);
|
||||
ret = setenv("XKB_LOG_VERBOSITY", "5", 1);
|
||||
|
|
|
@ -59,5 +59,7 @@ test_message_get(void)
|
|||
int
|
||||
main(void)
|
||||
{
|
||||
test_init();
|
||||
|
||||
test_message_get();
|
||||
}
|
||||
|
|
|
@ -154,6 +154,8 @@ test_modmap_none(void)
|
|||
int
|
||||
main(void)
|
||||
{
|
||||
test_init();
|
||||
|
||||
test_modmap_none();
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -1068,6 +1068,8 @@ test_invalid_include(void)
|
|||
int
|
||||
main(void)
|
||||
{
|
||||
test_init();
|
||||
|
||||
test_no_include_paths();
|
||||
test_invalid_include();
|
||||
test_load_basic();
|
||||
|
|
|
@ -93,6 +93,8 @@ main(int argc, char *argv[])
|
|||
{
|
||||
struct xkb_context *ctx;
|
||||
|
||||
test_init();
|
||||
|
||||
setenv("XKB_CONFIG_ROOT", TEST_XKB_CONFIG_ROOT, 1);
|
||||
|
||||
ctx = test_get_context(0);
|
||||
|
|
|
@ -91,6 +91,8 @@ main(int argc, char *argv[])
|
|||
{
|
||||
struct xkb_context *ctx;
|
||||
|
||||
test_init();
|
||||
|
||||
ctx = test_get_context(0);
|
||||
assert(ctx);
|
||||
|
||||
|
|
|
@ -110,6 +110,8 @@ test_rmlvo_env(struct xkb_context *ctx, const char *rules, const char *model,
|
|||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
test_init();
|
||||
|
||||
struct xkb_context *ctx = test_get_context(CONTEXT_ALLOW_ENVIRONMENT_NAMES);
|
||||
|
||||
assert(ctx);
|
||||
|
|
|
@ -712,6 +712,8 @@ test_ctrl_string_transformation(struct xkb_keymap *keymap)
|
|||
int
|
||||
main(void)
|
||||
{
|
||||
test_init();
|
||||
|
||||
struct xkb_context *context = test_get_context(0);
|
||||
struct xkb_keymap *keymap;
|
||||
|
||||
|
|
|
@ -34,6 +34,8 @@
|
|||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
test_init();
|
||||
|
||||
struct xkb_context *ctx = test_get_context(0);
|
||||
struct xkb_keymap *keymap;
|
||||
char *original, *dump, *dump2;
|
||||
|
|
|
@ -44,6 +44,9 @@
|
|||
assert_printf(streq_not_null(expected, got), \
|
||||
test_name ". Expected \"%s\", got: \"%s\"\n", expected, got)
|
||||
|
||||
void
|
||||
test_init(void);
|
||||
|
||||
/* The offset between KEY_* numbering, and keycodes in the XKB evdev
|
||||
* dataset. */
|
||||
#define EVDEV_OFFSET 8
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "test.h"
|
||||
#include "utf8.h"
|
||||
#include "utils.h"
|
||||
|
||||
|
@ -180,6 +181,8 @@ test_utf32_to_utf8(void)
|
|||
int
|
||||
main(void)
|
||||
{
|
||||
test_init();
|
||||
|
||||
test_is_valid_utf8();
|
||||
test_utf32_to_utf8();
|
||||
|
||||
|
|
|
@ -36,6 +36,8 @@ main(void)
|
|||
{
|
||||
char buffer[10];
|
||||
|
||||
test_init();
|
||||
|
||||
assert(!snprintf_safe(buffer, 0, "foo"));
|
||||
assert(!snprintf_safe(buffer, 1, "foo"));
|
||||
assert(!snprintf_safe(buffer, 3, "foo"));
|
||||
|
|
|
@ -86,5 +86,7 @@ err_conn:
|
|||
}
|
||||
|
||||
int main(void) {
|
||||
test_init();
|
||||
|
||||
return x11_tests_run();
|
||||
}
|
||||
|
|
|
@ -117,5 +117,7 @@ err_conn:
|
|||
}
|
||||
|
||||
int main(void) {
|
||||
test_init();
|
||||
|
||||
return x11_tests_run();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue