Commit 9032d529 authored by Rich Prohaska's avatar Rich Prohaska

use DIR for db files

git-svn-id: file:///svn/tokudb@644 c7de825b-a66e-492c-adef-691d508d4ae1
parent 45a0280b
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include <assert.h> #include <assert.h>
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
#include <sys/stat.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <db.h> #include <db.h>
...@@ -13,7 +14,7 @@ void test_dup_flags(int dup_flags) { ...@@ -13,7 +14,7 @@ void test_dup_flags(int dup_flags) {
DB_ENV * const null_env = 0; DB_ENV * const null_env = 0;
DB *db; DB *db;
DB_TXN * const null_txn = 0; DB_TXN * const null_txn = 0;
const char * const fname = "test.dup.flags.brt"; const char * const fname = DIR "/" "test_dup_flags.brt";
int r; int r;
unlink(fname); unlink(fname);
...@@ -96,7 +97,7 @@ void test_insert(int n, int dup_mode) { ...@@ -96,7 +97,7 @@ void test_insert(int n, int dup_mode) {
DB_ENV * const null_env = 0; DB_ENV * const null_env = 0;
DB *db; DB *db;
DB_TXN * const null_txn = 0; DB_TXN * const null_txn = 0;
const char * const fname = "test.insert.brt"; const char * const fname = DIR "/" "test_insert.brt";
int r; int r;
int i; int i;
...@@ -199,7 +200,7 @@ void test_nonleaf_insert(int n, int dup_mode) { ...@@ -199,7 +200,7 @@ void test_nonleaf_insert(int n, int dup_mode) {
DB_ENV * const null_env = 0; DB_ENV * const null_env = 0;
DB *db; DB *db;
DB_TXN * const null_txn = 0; DB_TXN * const null_txn = 0;
const char * const fname = "test.nonleaf.insert.brt"; const char * const fname = DIR "/" "test_nonleaf_insert.brt";
int r; int r;
int i; int i;
...@@ -314,7 +315,7 @@ void test_dup_delete(int n, int dup_mode) { ...@@ -314,7 +315,7 @@ void test_dup_delete(int n, int dup_mode) {
DB_ENV * const null_env = 0; DB_ENV * const null_env = 0;
DB *db; DB *db;
DB_TXN * const null_txn = 0; DB_TXN * const null_txn = 0;
const char * const fname = "test.dup.insert.brt"; const char * const fname = DIR "/" "test_dup_delete.brt";
int r; int r;
unlink(fname); unlink(fname);
...@@ -408,7 +409,7 @@ void test_dup_delete_delete(int n) { ...@@ -408,7 +409,7 @@ void test_dup_delete_delete(int n) {
DB_ENV * const null_env = 0; DB_ENV * const null_env = 0;
DB *db; DB *db;
DB_TXN * const null_txn = 0; DB_TXN * const null_txn = 0;
const char * const fname = "test.dup.insert.brt"; const char * const fname = DIR "/" "test_dup_delete_delete.brt";
int r; int r;
unlink(fname); unlink(fname);
...@@ -492,7 +493,7 @@ void test_dup_delete_insert(int n, int dup_mode) { ...@@ -492,7 +493,7 @@ void test_dup_delete_insert(int n, int dup_mode) {
DB_ENV * const null_env = 0; DB_ENV * const null_env = 0;
DB *db; DB *db;
DB_TXN * const null_txn = 0; DB_TXN * const null_txn = 0;
const char * const fname = "test.dup.insert.brt"; const char * const fname = DIR "/" "test_dup_delete_insert.brt";
int r; int r;
unlink(fname); unlink(fname);
...@@ -599,7 +600,7 @@ void test_all_dup_delete_insert(int n) { ...@@ -599,7 +600,7 @@ void test_all_dup_delete_insert(int n) {
DB_ENV * const null_env = 0; DB_ENV * const null_env = 0;
DB *db; DB *db;
DB_TXN * const null_txn = 0; DB_TXN * const null_txn = 0;
const char * const fname = "test.dup.insert.brt"; const char * const fname = DIR "/" "test_all_dup_delete_insert.brt";
int r; int r;
unlink(fname); unlink(fname);
...@@ -678,7 +679,7 @@ void test_walk_empty(int n, int dup_mode) { ...@@ -678,7 +679,7 @@ void test_walk_empty(int n, int dup_mode) {
DB_ENV * const null_env = 0; DB_ENV * const null_env = 0;
DB *db; DB *db;
DB_TXN * const null_txn = 0; DB_TXN * const null_txn = 0;
const char * const fname = "test.dup.insert.brt"; const char * const fname = DIR "/" "test_walk_empty.brt";
int r; int r;
unlink(fname); unlink(fname);
...@@ -747,13 +748,14 @@ void test_walk_empty(int n, int dup_mode) { ...@@ -747,13 +748,14 @@ void test_walk_empty(int n, int dup_mode) {
assert(r == 0); assert(r == 0);
} }
/* insert, close, delete, insert, search */
void test_icdi_search(int n, int dup_mode) { void test_icdi_search(int n, int dup_mode) {
printf("test_icdi_search:%d %d\n", n, dup_mode); printf("test_icdi_search:%d %d\n", n, dup_mode);
DB_ENV * const null_env = 0; DB_ENV * const null_env = 0;
DB *db; DB *db;
DB_TXN * const null_txn = 0; DB_TXN * const null_txn = 0;
const char * const fname = "test.dup.insert.brt"; const char * const fname = DIR "/" "test_icdi_search.brt";
int r; int r;
unlink(fname); unlink(fname);
...@@ -835,13 +837,14 @@ void test_icdi_search(int n, int dup_mode) { ...@@ -835,13 +837,14 @@ void test_icdi_search(int n, int dup_mode) {
assert(r == 0); assert(r == 0);
} }
/* insert, close, insert, search */
void test_ici_search(int n, int dup_mode) { void test_ici_search(int n, int dup_mode) {
printf("test_ici_search:%d %d\n", n, dup_mode); printf("test_ici_search:%d %d\n", n, dup_mode);
DB_ENV * const null_env = 0; DB_ENV * const null_env = 0;
DB *db; DB *db;
DB_TXN * const null_txn = 0; DB_TXN * const null_txn = 0;
const char * const fname = "test.dup.insert.brt"; const char * const fname = DIR "/" "test_ici_search.brt";
int r; int r;
unlink(fname); unlink(fname);
...@@ -937,13 +940,14 @@ void expect_db_lookup(DB *db, int k, int v) { ...@@ -937,13 +940,14 @@ void expect_db_lookup(DB *db, int k, int v) {
free(val.data); free(val.data);
} }
/* insert 0, insert 1, close, insert 0, search 0 */
void test_i0i1ci0_search(int n, int dup_mode) { void test_i0i1ci0_search(int n, int dup_mode) {
printf("test_i0i1ci0_search:%d %d\n", n, dup_mode); printf("test_i0i1ci0_search:%d %d\n", n, dup_mode);
DB_ENV * const null_env = 0; DB_ENV * const null_env = 0;
DB *db; DB *db;
DB_TXN * const null_txn = 0; DB_TXN * const null_txn = 0;
const char * const fname = "test.dup.insert.brt"; const char * const fname = DIR "/" "test_i0i1ci0.brt";
int r; int r;
unlink(fname); unlink(fname);
...@@ -995,6 +999,9 @@ void test_i0i1ci0_search(int n, int dup_mode) { ...@@ -995,6 +999,9 @@ void test_i0i1ci0_search(int n, int dup_mode) {
int main() { int main() {
int i; int i;
system("rm -rf " DIR);
mkdir(DIR, 0777);
/* test flags */ /* test flags */
test_dup_flags(DB_DUP); test_dup_flags(DB_DUP);
test_dup_flags(DB_DUP + DB_DUPSORT); test_dup_flags(DB_DUP + DB_DUPSORT);
......
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