From e058a43689f996b41ce605953c695bbef1f16ef4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 29 Dec 2021 19:03:59 +0100 Subject: [PATCH] test: config: main: test dpi-aware, selection-target and initial-window-mode --- tests/test-config.c | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/tests/test-config.c b/tests/test-config.c index 892b3915..0eebf4bb 100644 --- a/tests/test-config.c +++ b/tests/test-config.c @@ -393,15 +393,39 @@ test_section_main(void) test_spawn_template(&ctx, &parse_section_main, "notify", &conf.notify); + test_enum( + &ctx, &parse_section_main, "dpi-aware", + 9, + (const char *[]){"on", "true", "yes", "1", + "off", "false", "no", "0", + "auto"}, + (int []){DPI_AWARE_YES, DPI_AWARE_YES, DPI_AWARE_YES, DPI_AWARE_YES, + DPI_AWARE_NO, DPI_AWARE_NO, DPI_AWARE_NO, DPI_AWARE_NO, + DPI_AWARE_AUTO}, + (int *)&conf.dpi_aware); + + test_enum(&ctx, &parse_section_main, "selection-target", + 4, + (const char *[]){"none", "primary", "clipboard", "both"}, + (int []){SELECTION_TARGET_NONE, + SELECTION_TARGET_PRIMARY, + SELECTION_TARGET_CLIPBOARD, + SELECTION_TARGET_BOTH}, + (int *)&conf.selection_target); + + test_enum( + &ctx, &parse_section_main, "initial-window-mode", + 3, + (const char *[]){"windowed", "maximized", "fullscreen"}, + (int []){STARTUP_WINDOWED, STARTUP_MAXIMIZED, STARTUP_FULLSCREEN}, + (int *)&conf.startup_mode); + /* TODO: font (custom) */ /* TODO: include (custom) */ - /* TODO: dpi-aware (enum/boolean) */ /* TODO: bold-text-in-bright (enum/boolean) */ /* TODO: pad (geometry + optional string)*/ /* TODO: initial-window-size-pixels (geometry) */ /* TODO: initial-window-size-chars (geometry) */ - /* TODO: selection-target (enum) */ - /* TODO: initial-window-mode (enum) */ config_free(conf); }