mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 23:04:20 +01:00
Addresses #1531 made test-stat more comprehensive
git-svn-id: file:///svn/toku/tokudb@10349 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
5696890bb1
commit
97a6c4d3fe
1 changed files with 9 additions and 6 deletions
|
@ -5,26 +5,29 @@
|
|||
#include <assert.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
void test_stat(char *dirname) {
|
||||
void test_stat(char *dirname, int result) {
|
||||
int r;
|
||||
struct stat s;
|
||||
r = stat(dirname, &s);
|
||||
printf("stat %s %d\n", dirname, r);
|
||||
printf("stat %s %d\n", dirname, r); fflush(stdout);
|
||||
assert(r==result);
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
int r;
|
||||
|
||||
test_stat(".");
|
||||
test_stat(".", 0);
|
||||
test_stat("./", 0);
|
||||
|
||||
r = system("rm -rf testdir"); assert(r==0);
|
||||
r = toku_os_mkdir("testdir", S_IRWXU);
|
||||
assert(r == 0);
|
||||
|
||||
test_stat("testdir");
|
||||
test_stat("testdir", 0);
|
||||
|
||||
test_stat("./testdir");
|
||||
test_stat("./testdir", 0);
|
||||
|
||||
test_stat("./testdir/");
|
||||
test_stat("./testdir/", 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue