Commit 5a83acc1 authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

refs[t:2445] test the toku_fsync_directory function. verify with strace by hand.

git-svn-id: file:///svn/toku/tokudb@20826 c7de825b-a66e-492c-adef-691d508d4ae1
parent f5ead676
// use strace to very that the toku_fsync_directory function works
#include "test.h"
#include <stdlib.h>
#include <string.h>
#define ENVDIR "dir." __FILE__
static int verbose = 0;
int test_main(int argc, char *const argv[]) {
int r;
for (int i=1; i<argc; i++) {
if (strcmp(argv[i], "-v") == 0) {
if (verbose < 0) verbose = 0;
verbose++;
continue;
} else if (strcmp(argv[i], "-q") == 0) {
verbose = 0;
continue;
} else {
exit(1);
}
}
r = system("rm -rf " ENVDIR);
CKERR(r);
r = toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
CKERR(r);
r = toku_os_mkdir(ENVDIR "/test", S_IRWXU+S_IRWXG+S_IRWXO);
CKERR(r);
r = toku_fsync_directory(""); CKERR(r);
r = toku_fsync_directory("."); CKERR(r);
r = toku_fsync_directory(ENVDIR "/test/a"); CKERR(r);
r = toku_fsync_directory("./" ENVDIR "/test/a"); CKERR(r);
r = toku_fsync_directory("/tmp/x"); CKERR(r);
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