summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2012-05-11 15:03:43 +0100
committerDaniel Stone <daniel@fooishbar.org>2012-05-11 15:03:43 +0100
commit7b00485a6bc2facdb56ccdaa12b4900f118d66b5 (patch)
tree33b821b995483ddc43a376d56694d6280545e257 /test
parentf95b41131d4c1815ee4643f5addb1d2d1ad68728 (diff)
downloadxorg-lib-libxkbcommon-7b00485a6bc2facdb56ccdaa12b4900f118d66b5.tar.gz
Rename 'ctx' back to 'context' in external API
Still keep things as 'ctx' internally so we don't have to worry about typing it too often, but rename the user-visible API back as it was kinda ugly. This partially reverts e7bb1e5f. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'test')
-rw-r--r--test/context.c6
-rw-r--r--test/filecomp.c24
-rw-r--r--test/namescomp.c14
-rw-r--r--test/rulescomp.c12
-rw-r--r--test/state.c10
5 files changed, 33 insertions, 33 deletions
diff --git a/test/context.c b/test/context.c
index 77060ad..016c5ea 100644
--- a/test/context.c
+++ b/test/context.c
@@ -30,13 +30,13 @@
int
main(void)
{
- struct xkb_ctx *ctx = xkb_ctx_new(0);
+ struct xkb_context *context = xkb_context_new(0);
- assert(ctx);
+ assert(context);
/* FIXME: Test include path stuff. */
- xkb_ctx_unref(ctx);
+ xkb_context_unref(context);
return 0;
}
diff --git a/test/filecomp.c b/test/filecomp.c
index e595ed5..5465b2c 100644
--- a/test/filecomp.c
+++ b/test/filecomp.c
@@ -40,28 +40,28 @@ static int
test_file(const char *path)
{
int fd;
- struct xkb_ctx *ctx;
+ struct xkb_context *context;
struct xkb_keymap *keymap;
fd = open(path, O_RDONLY);
assert(fd >= 0);
- ctx = xkb_ctx_new(0);
- assert(ctx);
+ context = xkb_context_new(0);
+ assert(context);
fprintf(stderr, "\nCompiling path: %s\n", path);
- keymap = xkb_map_new_from_fd(ctx, fd, XKB_KEYMAP_FORMAT_TEXT_V1, 0);
+ keymap = xkb_map_new_from_fd(context, fd, XKB_KEYMAP_FORMAT_TEXT_V1, 0);
close(fd);
if (!keymap) {
fprintf(stderr, "Failed to compile keymap\n");
- xkb_ctx_unref(ctx);
+ xkb_context_unref(context);
return 0;
}
xkb_map_unref(keymap);
- xkb_ctx_unref(ctx);
+ xkb_context_unref(context);
return 1;
}
@@ -78,22 +78,22 @@ test_file_name(const char *file_name)
static int
test_string(const char *string)
{
- struct xkb_ctx *ctx;
+ struct xkb_context *context;
struct xkb_keymap *keymap;
- ctx = xkb_ctx_new(0);
- assert(ctx);
+ context = xkb_context_new(0);
+ assert(context);
fprintf(stderr, "\nCompiling string\n");
- keymap = xkb_map_new_from_string(ctx, string, XKB_KEYMAP_FORMAT_TEXT_V1, 0);
+ keymap = xkb_map_new_from_string(context, string, XKB_KEYMAP_FORMAT_TEXT_V1, 0);
if (!keymap) {
- xkb_ctx_unref(ctx);
+ xkb_context_unref(context);
return 0;
}
xkb_map_unref(keymap);
- xkb_ctx_unref(ctx);
+ xkb_context_unref(context);
return 1;
}
diff --git a/test/namescomp.c b/test/namescomp.c
index 58a17fc..81ef369 100644
--- a/test/namescomp.c
+++ b/test/namescomp.c
@@ -37,7 +37,7 @@ test_names(const char *keycodes, const char *types,
const char *compat, const char *symbols)
{
int ret = 1;
- struct xkb_ctx *ctx;
+ struct xkb_context *context;
struct xkb_keymap *keymap;
struct xkb_component_names kccgst = {
.keymap = NULL,
@@ -47,21 +47,21 @@ test_names(const char *keycodes, const char *types,
.symbols = strdup(symbols),
};
- ctx = xkb_ctx_new(0);
- assert(ctx);
+ context = xkb_context_new(0);
+ assert(context);
fprintf(stderr, "\nCompiling %s %s %s %s\n", kccgst.keycodes, kccgst.types,
kccgst.compat, kccgst.symbols);
- keymap = xkb_map_new_from_kccgst(ctx, &kccgst, 0);
+ keymap = xkb_map_new_from_kccgst(context, &kccgst, 0);
if (!keymap) {
ret = 0;
- goto err_ctx;
+ goto err_context;
}
xkb_map_unref(keymap);
-err_ctx:
- xkb_ctx_unref(ctx);
+err_context:
+ xkb_context_unref(context);
free(kccgst.keycodes);
free(kccgst.types);
free(kccgst.compat);
diff --git a/test/rulescomp.c b/test/rulescomp.c
index 403ff65..fbf335d 100644
--- a/test/rulescomp.c
+++ b/test/rulescomp.c
@@ -33,7 +33,7 @@ static int
test_rmlvo(const char *rules, const char *model, const char *layout,
const char *variant, const char *options)
{
- struct xkb_ctx *ctx;
+ struct xkb_context *context;
struct xkb_keymap *keymap;
struct xkb_rule_names rmlvo = {
.rules = rules,
@@ -43,20 +43,20 @@ test_rmlvo(const char *rules, const char *model, const char *layout,
.options = options
};
- ctx = xkb_ctx_new(0);
- assert(ctx);
+ context = xkb_context_new(0);
+ assert(context);
fprintf(stderr, "\nCompiling %s %s %s %s %s\n", rmlvo.rules, rmlvo.model,
rmlvo.layout, rmlvo.variant, rmlvo.options);
- keymap = xkb_map_new_from_names(ctx, &rmlvo, 0);
+ keymap = xkb_map_new_from_names(context, &rmlvo, 0);
if (!keymap) {
- xkb_ctx_unref(ctx);
+ xkb_context_unref(context);
return 0;
}
xkb_map_unref(keymap);
- xkb_ctx_unref(ctx);
+ xkb_context_unref(context);
return 1;
}
diff --git a/test/state.c b/test/state.c
index c16518c..ab1524b 100644
--- a/test/state.c
+++ b/test/state.c
@@ -224,7 +224,7 @@ test_serialisation(struct xkb_keymap *keymap)
int
main(void)
{
- struct xkb_ctx *ctx;
+ struct xkb_context *context;
struct xkb_keymap *keymap;
struct xkb_rule_names rmlvo = {
.rules = "evdev",
@@ -234,15 +234,15 @@ main(void)
.options = NULL,
};
- ctx = xkb_ctx_new(0);
- assert(ctx);
+ context = xkb_context_new(0);
+ assert(context);
- keymap = xkb_map_new_from_names(ctx, &rmlvo, 0);
+ keymap = xkb_map_new_from_names(context, &rmlvo, 0);
assert(keymap);
test_update_key(keymap);
test_serialisation(keymap);
xkb_map_unref(keymap);
- xkb_ctx_unref(ctx);
+ xkb_context_unref(context);
}