diff options
-rw-r--r-- | test/navigator.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/navigator.c b/test/navigator.c index 66f3a43..ca5f200 100644 --- a/test/navigator.c +++ b/test/navigator.c @@ -1,20 +1,23 @@ #include <stdarg.h> #include <stddef.h> +#include <fcntl.h> #include <setjmp.h> #include <cmocka.h> #include "navigator.h" +#define FILENAME "example.file" + static void test_navigator_add(void **state) { (void)state; struct imv_navigator nav; imv_navigator_init(&nav); - assert_false(imv_navigator_poll_changed(&nav)); - imv_navigator_add(&nav, "path/to/some/file", 0); - assert_true(imv_navigator_poll_changed(&nav)); - assert_string_equal(imv_navigator_selection(&nav), "path/to/some/file"); + assert_false(imv_navigator_poll_changed(&nav, 0)); + imv_navigator_add(&nav, FILENAME, 0); + assert_true(imv_navigator_poll_changed(&nav, 0)); + assert_string_equal(imv_navigator_selection(&nav), FILENAME); imv_navigator_destroy(&nav); } @@ -23,6 +26,7 @@ int main(void) { const struct CMUnitTest tests[] = { cmocka_unit_test(test_navigator_add), + cmocka_unit_test(test_navigator_file_changed), }; return cmocka_run_group_tests(tests, NULL, NULL); |