From 16cccb11b1217cb6d697f5b4862ad8bd2a430a89 Mon Sep 17 00:00:00 2001 From: "Dmitrij D. Czarkoff" Date: Wed, 6 Jan 2016 00:07:53 +0100 Subject: Fix navigator_add test It was not fixed after imv_navigator_poll_changed() function was changed. --- test/navigator.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'test') 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 #include +#include #include #include #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); -- cgit v1.2.3