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