]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/test/test-kbd-util.c
strv: make iterator in STRV_FOREACH() declaread in the loop
[thirdparty/systemd.git] / src / test / test-kbd-util.c
CommitLineData
fef4fe1a
LP
1/* SPDX-License-Identifier: LGPL-2.1-or-later */
2
3#include "kbd-util.h"
4#include "log.h"
5#include "strv.h"
6#include "tests.h"
7
8int main(int argc, char *argv[]) {
9 _cleanup_strv_free_ char **maps = NULL;
fef4fe1a
LP
10 int r;
11
12 log_show_color(true);
13 test_setup_logging(LOG_DEBUG);
14
15 r = get_keymaps(&maps);
16 if (r < 0) {
ba669952 17 log_error_errno(r, "Failed to acquire keymaps: %m");
fef4fe1a
LP
18 return 0;
19 }
20
21 STRV_FOREACH(m, maps) {
22 log_info("Found keymap: %s", *m);
23 assert_se(keymap_exists(*m) > 0);
24 }
25
26 return 0;
27}