From 0936cfee5d2adf9031c73f93a1147bc419b52391 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Sun, 24 Sep 2017 20:06:08 +0200 Subject: [PATCH] chsck_vio: fix readdir test by removing it. The code that was creating the files in the directory was removed in commit 6906b8d30c846bf0e03f1252b71e169e50786efa. The directory is empty so the result is expected to be null. It was passing before because the code was returning an entry for . and .., but since commit 35f80bd4390bb3ab92ccd8fa740d96c18ce16e93 this is no longer the case --- test/csync/vio_tests/check_vio.cpp | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/test/csync/vio_tests/check_vio.cpp b/test/csync/vio_tests/check_vio.cpp index 31da1113b..0607dcaa8 100644 --- a/test/csync/vio_tests/check_vio.cpp +++ b/test/csync/vio_tests/check_vio.cpp @@ -137,31 +137,12 @@ static void check_csync_vio_closedir_null(void **state) assert_int_equal(rc, -1); } -static void check_csync_vio_readdir(void **state) -{ - CSYNC *csync = (CSYNC*)*state; - csync_vio_handle_t *dh; - std::unique_ptr dirent; - int rc; - - dh = csync_vio_opendir(csync, CSYNC_TEST_DIR); - assert_non_null(dh); - - dirent = csync_vio_readdir(csync, dh); - assert_non_null(dirent.get()); - - rc = csync_vio_closedir(csync, dh); - assert_int_equal(rc, 0); -} - - int torture_run_tests(void) { const struct CMUnitTest tests[] = { cmocka_unit_test_setup_teardown(check_csync_vio_opendir, setup_dir, teardown), cmocka_unit_test_setup_teardown(check_csync_vio_opendir_perm, setup, teardown), cmocka_unit_test(check_csync_vio_closedir_null), - cmocka_unit_test_setup_teardown(check_csync_vio_readdir, setup_dir, teardown), }; return cmocka_run_group_tests(tests, NULL, NULL); -- 2.30.2