From 260e50d627aea535abcd9d9902c1b4ae56da4c54 Mon Sep 17 00:00:00 2001 From: nodist Date: Sun, 20 Sep 2026 17:10:21 -0400 Subject: add config for io and thread --- test/config.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'test/config.c') diff --git a/test/config.c b/test/config.c index 8a1dc64..a8fd1ad 100644 --- a/test/config.c +++ b/test/config.c @@ -19,3 +19,23 @@ KPL_TEST(config_change_module_extension) { KPL_ASSERT(code == KPL_EXIT_CODE_SUCCESS, "Invalid exit code"); KPL_ASSERT(strcmp(config.module_extension, ".l") == 0, "Invalid new module extension"); } + +KPL_TEST(config_io_queue_pow) { + kpl_config config; + const int32_t argc = 3; + const char *argv[] = { "./kpl", "--io-queue-pow=14", "./file.kpl" }; + kpl_config_init(&config); + int32_t code = kpl_config_parse_args(&config, argc, argv); + KPL_ASSERT(code == KPL_EXIT_CODE_SUCCESS, "Invalid exit code"); + KPL_ASSERT(config.io.queue_pow == 14, "Invalid io queue power of two"); +} + +KPL_TEST(config_thread_count) { + kpl_config config; + const int32_t argc = 3; + const char *argv[] = { "./kpl", "--thread-count=1", "./file.kpl" }; + kpl_config_init(&config); + int32_t code = kpl_config_parse_args(&config, argc, argv); + KPL_ASSERT(code == KPL_EXIT_CODE_SUCCESS, "Invalid exit code"); + KPL_ASSERT(config.thread.count == 1, "Invalid thread count"); +} -- cgit v1.2.3