Commit 97a6c4d3 authored by Yoni Fogel's avatar Yoni Fogel

Addresses #1531 made test-stat more comprehensive

git-svn-id: file:///svn/toku/tokudb@10349 c7de825b-a66e-492c-adef-691d508d4ae1
parent 5696890b
......@@ -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;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment