diff options
author | Michał Łyszczek <michal.lyszczek@bofc.pl> | 2018-01-26 12:52:29 +0100 |
---|---|---|
committer | Michał Łyszczek <michal.lyszczek@bofc.pl> | 2018-01-26 12:52:29 +0100 |
commit | b4f7aa5c75db692c8268022d8766adb6ebf20f54 (patch) | |
tree | e701afdbc404c7cfef95af6fa534a5511d3b25f4 | |
parent | b3a1fb02d27d630564c6800d0bcde4dc69d12456 (diff) | |
download | embedlog-b4f7aa5c75db692c8268022d8766adb6ebf20f54.tar.gz embedlog-b4f7aa5c75db692c8268022d8766adb6ebf20f54.tar.bz2 embedlog-b4f7aa5c75db692c8268022d8766adb6ebf20f54.zip |
add: tests when --disable-out-stderr
-rw-r--r-- | tst/test-el-options.c | 61 |
1 files changed, 56 insertions, 5 deletions
diff --git a/tst/test-el-options.c b/tst/test-el-options.c index 1e6fa85..d6dd878 100644 --- a/tst/test-el-options.c +++ b/tst/test-el-options.c @@ -156,17 +156,68 @@ static void options_level_set(void) static void options_output(void) { int current_outputs; + int i; /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ current_outputs = 0; - mt_fok(el_option(EL_OUT, EL_OUT_STDERR)); - mt_fail(g_options.outputs == EL_OUT_STDERR); - mt_fok(el_option(EL_OUT, (EL_OUT_STDERR | EL_OUT_FILE))); - mt_fail(g_options.outputs == (EL_OUT_STDERR | EL_OUT_FILE)); + for (i = 0; i != EL_OUT_ALL; ++i) + { + int ok = 1; + +#ifndef ENABLE_OUT_STDERR + if (i & EL_OUT_STDERR) + { + ok = 0; + } +#endif + +#ifndef ENABLE_OUT_SYSLOG + if (i & EL_OUT_SYSLOG) + { + ok = 0; + } +#endif + +#ifndef ENABLE_OUT_FILE + if (i & EL_OUT_FILE) + { + ok = 0; + } +#endif + +#ifndef ENABLE_OUT_NET + if (i & EL_OUT_NET) + { + ok = 0; + } +#endif + +#ifndef ENABLE_OUT_TTY + if (i & EL_OUT_TTY) + { + ok = 0; + } +#endif + +#ifndef ENABLE_OUT_CUSTOM + if (i & EL_OUT_CUSTOM) + { + ok = 0; + } +#endif + + if (ok) + { + mt_fok(el_option(EL_OUT, i)); + continue; + } + + printf("i %02x\n", i); + mt_ferr(el_option(EL_OUT, i), ENODEV); + } mt_ferr(el_option(EL_OUT, EL_OUT_ALL + 7), EINVAL); - mt_fail(g_options.outputs == (EL_OUT_STDERR | EL_OUT_FILE)); } |