"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/api/fsio.c" between
proftpd-1.3.6b.tar.gz and proftpd-1.3.6c.tar.gz

About: ProFTPD is a highly configurable FTP server software (with FTPS and SFTP support).

fsio.c  (proftpd-1.3.6b):fsio.c  (proftpd-1.3.6c)
/* /*
* ProFTPD - FTP server testsuite * ProFTPD - FTP server testsuite
* Copyright (c) 2008-2017 The ProFTPD Project team * Copyright (c) 2008-2019 The ProFTPD Project team
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 67 skipping to change at line 67
} }
init_fs(); init_fs();
pr_fs_statcache_set_policy(PR_TUNABLE_FS_STATCACHE_SIZE, pr_fs_statcache_set_policy(PR_TUNABLE_FS_STATCACHE_SIZE,
PR_TUNABLE_FS_STATCACHE_MAX_AGE, 0); PR_TUNABLE_FS_STATCACHE_MAX_AGE, 0);
if (getenv("TEST_VERBOSE") != NULL) { if (getenv("TEST_VERBOSE") != NULL) {
pr_trace_set_levels("fsio", 1, 20); pr_trace_set_levels("fsio", 1, 20);
pr_trace_set_levels("fs.statcache", 1, 20); pr_trace_set_levels("fs.statcache", 1, 20);
} }
} }
static void tear_down(void) { static void tear_down(void) {
if (fsio_cwd != NULL) { if (fsio_cwd != NULL) {
free(fsio_cwd); free(fsio_cwd);
fsio_cwd = NULL; fsio_cwd = NULL;
} }
(void) pr_fsio_guard_chroot(FALSE); (void) pr_fsio_guard_chroot(FALSE);
pr_fs_statcache_set_policy(PR_TUNABLE_FS_STATCACHE_SIZE, pr_fs_statcache_set_policy(PR_TUNABLE_FS_STATCACHE_SIZE,
skipping to change at line 2690 skipping to change at line 2689
START_TEST (fsio_statcache_expired_test) { START_TEST (fsio_statcache_expired_test) {
unsigned int cache_size, max_age; unsigned int cache_size, max_age;
int res; int res;
struct stat st; struct stat st;
cache_size = max_age = 1; cache_size = max_age = 1;
pr_fs_statcache_set_policy(cache_size, max_age, 0); pr_fs_statcache_set_policy(cache_size, max_age, 0);
/* First is a cache miss...*/ /* First is a cache miss...*/
mark_point();
res = pr_fsio_stat("/tmp", &st); res = pr_fsio_stat("/tmp", &st);
fail_unless(res == 0, "Failed to stat '/tmp': %s", strerror(errno)); fail_unless(res == 0, "Failed to stat '/tmp': %s", strerror(errno));
/* Wait for that cached data to expire...*/ /* Wait for that cached data to expire...*/
sleep(max_age + 1); sleep(max_age + 1);
/* This is another cache miss, hopefully. */ /* This is another cache miss, hopefully. */
mark_point();
res = pr_fsio_stat("/tmp2", &st); res = pr_fsio_stat("/tmp2", &st);
fail_unless(res < 0, "Check of '/tmp2' succeeded unexpectedly"); fail_unless(res < 0, "Check of '/tmp2' succeeded unexpectedly");
fail_unless(errno == ENOENT, "Expected ENOENT (%d), got %s (%d)", ENOENT, fail_unless(errno == ENOENT, "Expected ENOENT (%d), got %s (%d)", ENOENT,
strerror(errno), errno); strerror(errno), errno);
mark_point();
pr_fs_clear_cache(); pr_fs_clear_cache();
} }
END_TEST END_TEST
START_TEST (fsio_statcache_dump_test) { START_TEST (fsio_statcache_dump_test) {
mark_point(); mark_point();
pr_fs_statcache_dump(); pr_fs_statcache_dump();
} }
END_TEST END_TEST
 End of changes. 5 change blocks. 
2 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)