diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-12-29 18:33:18 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-12-29 18:33:18 +0000 |
| commit | a780a8b66fab4aa09a9d0aeb6c394908746a222e (patch) | |
| tree | b9967b67d681500c981f165275d2d807f96f9793 /tests | |
| parent | test: config: test mouse section (diff) | |
test: config: test csd section
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test-config.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/test-config.c b/tests/test-config.c index f9f722ab..e7a4477f 100644 --- a/tests/test-config.c +++ b/tests/test-config.c @@ -542,6 +542,40 @@ test_section_mouse(void) } static void +test_section_csd(void) +{ + struct config conf = {0}; + struct context ctx = { + .conf = &conf, .section = "csd", .path = "unittest"}; + + test_invalid_key(&ctx, &parse_section_csd, "invalid-key"); + + test_enum( + &ctx, &parse_section_csd, "preferred", + 3, + (const char *[]){"none", "client", "server"}, + (int []){CONF_CSD_PREFER_NONE, + CONF_CSD_PREFER_CLIENT, + CONF_CSD_PREFER_SERVER}, + (int *)&conf.csd.preferred); + test_uint16(&ctx, &parse_section_csd, "size", &conf.csd.title_height); + test_uint16(&ctx, &parse_section_csd, "border-width", + &conf.csd.border_width_visible); + test_uint16(&ctx, &parse_section_csd, "button-width", + &conf.csd.button_width); + + /* TODO: color */ + /* TODO: font */ + /* TODO: border-color */ + /* TODO: button-color */ + /* TODO: button-minimize-color */ + /* TODO: button-maximize-color */ + /* TODO: button-close-color */ + + config_free(conf); +} + +static void test_key_binding(struct context *ctx, bool (*parse_fun)(struct context *ctx), int action, int max_action, const char *const *map, struct config_key_binding_list *bindings, @@ -970,6 +1004,8 @@ main(int argc, const char *const *argv) test_section_url(); test_section_cursor(); test_section_mouse(); + /* TODO: test_section_colors() */ + test_section_csd(); test_section_key_bindings(); test_section_key_bindings_collisions(); test_section_search_bindings(); @@ -978,6 +1014,7 @@ main(int argc, const char *const *argv) test_section_url_bindings_collisions(); test_section_mouse_bindings(); test_section_mouse_bindings_collisions(); + /* TODO: test_section_tweak() */ log_deinit(); return 0; } |
