diff options
| author | nodist <kevin.comas.git@gmail.com> | 2026-10-20 14:11:31 -0400 |
|---|---|---|
| committer | nodist <kevin.comas.git@gmail.com> | 2026-10-20 14:11:31 -0400 |
| commit | 689719e0a1f139e28e57a4df334d5fde354b3379 (patch) | |
| tree | 2b5e0d0c4aced4886ff3c67729adceba45cac3b0 /test/config.c | |
| parent | baa6f9cdea938c06435635f906b128f7940a59ec (diff) | |
config parse cli arguments
Diffstat (limited to 'test/config.c')
| -rw-r--r-- | test/config.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/config.c b/test/config.c new file mode 100644 index 0000000..eb5d0ca --- /dev/null +++ b/test/config.c @@ -0,0 +1,18 @@ + +#include "kpl_test.h" + +KPL_TEST(set_thread_count) { + kpl_env env = {}; + int32_t argc = 4; + char *argv[] = {"./kpl", "-t", "4", "file.kpl"}; + KPL_ASSERT(kpl_env_config(&env, argc, argv) == KPL_EXIT_CODE_SUCCESS, "Should return success"); + KPL_ASSERT(env.thread_count == 4, "Threads should not be -1"); +} + +KPL_TEST(set_io_uring_queue_pow2_size) { + kpl_env env = {}; + int32_t argc = 4; + char *argv[] = {"./kpl", "-i", "12", "file.kpl"}; + KPL_ASSERT(kpl_env_config(&env, argc, argv) == KPL_EXIT_CODE_SUCCESS, "Should return success"); + KPL_ASSERT(env.io_uring_queue_size_pow2 != KPL_IO_URING_QUEUE_SIZE_POW2_DEFAULT, "Should not be default"); +} |
