mariadb/windows/tests/test-stat.c
Yoni Fogel 97a6c4d3fe Addresses #1531 made test-stat more comprehensive
git-svn-id: file:///svn/toku/tokudb@10349 c7de825b-a66e-492c-adef-691d508d4ae1
2013-04-16 23:57:44 -04:00

33 lines
619 B
C

#include <toku_portability.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <assert.h>
#include <sys/stat.h>
void test_stat(char *dirname, int result) {
int r;
struct stat s;
r = stat(dirname, &s);
printf("stat %s %d\n", dirname, r); fflush(stdout);
assert(r==result);
}
int main(void) {
int r;
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", 0);
test_stat("./testdir", 0);
test_stat("./testdir/", 0);
return 0;
}