summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@googlemail.com>2012-10-27 18:32:43 +0200
committerDavid Herrmann <dh.herrmann@googlemail.com>2012-10-27 18:32:43 +0200
commit9d2018f52184709bc72b58126fa23354c3316c09 (patch)
tree5340c1785cf21a2defff5cc84e036417ea2bf4f6 /tests
parent6e05334695d75c4a772ef22129e541fa8108bdb3 (diff)
build: fix "make check" build failures
I forgot again to keep these up to date. The conf-layer updates broke them horribly. However, we now build them correctly without kmscon-core by including all required layers directly. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/test_include.h22
-rw-r--r--tests/test_input.c6
-rw-r--r--tests/test_output.c6
3 files changed, 20 insertions, 14 deletions
diff --git a/tests/test_include.h b/tests/test_include.h
index d4e924f..126b5a2 100644
--- a/tests/test_include.h
+++ b/tests/test_include.h
@@ -39,7 +39,7 @@
"\t --debug [off] Enable debug mode\n" \
"\t --silent [off] Suppress notices and warnings\n"
-struct {
+static struct {
bool help;
bool exit;
bool verbose;
@@ -47,6 +47,8 @@ struct {
bool silent;
} test_conf;
+static struct conf_ctx *test_ctx;
+
static int aftercheck_debug(struct conf_option *opt, int argc, char **argv,
int idx)
{
@@ -70,10 +72,10 @@ static int aftercheck_help(struct conf_option *opt, int argc, char **argv,
}
#define TEST_OPTIONS \
- CONF_OPTION_BOOL('h', "help", aftercheck_help, &test_conf.help, false), \
- CONF_OPTION_BOOL('v', "verbose", NULL, &test_conf.verbose, false), \
- CONF_OPTION_BOOL(0, "debug", aftercheck_debug, &test_conf.debug, false), \
- CONF_OPTION_BOOL(0, "silent", NULL, &test_conf.silent, false)
+ CONF_OPTION_BOOL_FULL('h', "help", aftercheck_help, NULL, NULL, &test_conf.help, false), \
+ CONF_OPTION_BOOL('v', "verbose", &test_conf.verbose, false), \
+ CONF_OPTION_BOOL_FULL(0, "debug", aftercheck_debug, NULL, NULL, &test_conf.debug, false), \
+ CONF_OPTION_BOOL(0, "silent", &test_conf.silent, false)
static void sig_generic(struct ev_eloop *p, struct signalfd_siginfo *info,
void *data)
@@ -90,7 +92,11 @@ static int test_prepare(struct conf_option *opts, size_t len,
int ret;
struct ev_eloop *eloop;
- ret = conf_parse_argv(opts, len, argc, argv);
+ ret = conf_ctx_new(&test_ctx, opts, len, &test_conf);
+ if (ret)
+ return ret;
+
+ ret = conf_ctx_parse_argv(test_ctx, argc, argv);
if (ret)
goto err_out;
@@ -128,7 +134,7 @@ static int test_prepare(struct conf_option *opts, size_t len,
err_unref:
ev_eloop_unref(eloop);
err_out:
- conf_free(opts, len);
+ conf_ctx_free(test_ctx);
return ret;
}
@@ -144,5 +150,5 @@ static void test_exit(struct conf_option *opts, size_t len,
ev_eloop_unregister_signal_cb(eloop, SIGINT, sig_generic, eloop);
ev_eloop_unregister_signal_cb(eloop, SIGTERM, sig_generic, eloop);
ev_eloop_unref(eloop);
- conf_free(opts, len);
+ conf_ctx_free(test_ctx);
}
diff --git a/tests/test_input.c b/tests/test_input.c
index 74a0916..dba1bb8 100644
--- a/tests/test_input.c
+++ b/tests/test_input.c
@@ -176,9 +176,9 @@ static void print_help()
struct conf_option options[] = {
TEST_OPTIONS,
- CONF_OPTION_STRING(0, "xkb-layout", NULL, &input_conf.xkb_layout, ""),
- CONF_OPTION_STRING(0, "xkb-variant", NULL, &input_conf.xkb_variant, ""),
- CONF_OPTION_STRING(0, "xkb-options", NULL, &input_conf.xkb_options, ""),
+ CONF_OPTION_STRING(0, "xkb-layout", &input_conf.xkb_layout, ""),
+ CONF_OPTION_STRING(0, "xkb-variant", &input_conf.xkb_variant, ""),
+ CONF_OPTION_STRING(0, "xkb-options", &input_conf.xkb_options, ""),
};
int main(int argc, char **argv)
diff --git a/tests/test_output.c b/tests/test_output.c
index ed6ff6d..fef617f 100644
--- a/tests/test_output.c
+++ b/tests/test_output.c
@@ -192,9 +192,9 @@ static void print_help()
struct conf_option options[] = {
TEST_OPTIONS,
- CONF_OPTION_BOOL(0, "fbdev", NULL, &output_conf.fbdev, false),
- CONF_OPTION_BOOL(0, "test", NULL, &output_conf.test, false),
- CONF_OPTION_STRING(0, "dev", NULL, &output_conf.dev, NULL),
+ CONF_OPTION_BOOL(0, "fbdev", &output_conf.fbdev, false),
+ CONF_OPTION_BOOL(0, "test", &output_conf.test, false),
+ CONF_OPTION_STRING(0, "dev", &output_conf.dev, NULL),
};
int main(int argc, char **argv)