chsck_vio: fix readdir test by removing it.
authorOlivier Goffart <ogoffart@woboq.com>
Sun, 24 Sep 2017 18:06:08 +0000 (20:06 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Thu, 5 Oct 2017 20:01:36 +0000 (22:01 +0200)
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

index 31da1113bebd0a04379cfe4471e4d354d56f2a69..0607dcaa83fd15ae48d03358a274da28a0e1c58f 100644 (file)
@@ -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<csync_file_stat_t> 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);