Commit 93da7856 authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

valgrind 3.5.0 found some mem leaks in the tests [t:2001]

git-svn-id: file:///svn/toku/tokudb@14556 c7de825b-a66e-492c-adef-691d508d4ae1
parent e9e22dd4
......@@ -76,5 +76,8 @@ test_main (int UU(argc), char UU(*argv[])) {
}
closedir(direct);
}
r = env->close(env, 0); assert(r == 0);
return 0;
}
......@@ -82,7 +82,9 @@ test_dup_key (int dup_mode, u_int32_t put_flags, int rexpect, int rexpectdupdup)
r = db->set_pagesize(db, 4096); assert(r == 0);
r = db->open(db, null_txn, fname, "main", DB_BTREE, DB_CREATE, 0666);
if (maybe_do_db_dup_warning(r, dup_mode)) {
r = db->close(db, 0); assert(r == 0); return;
r = db->close(db, 0); assert(r == 0);
r = env->close(env, 0); assert(r == 0);
return;
}
assert(r == 0);
......@@ -133,13 +135,17 @@ test_dup_dup (int dup_mode, u_int32_t put_flags, int rexpect, int rexpectdupdup)
db->set_errfile(db, stderr);
r = db->set_flags(db, dup_mode);
if (maybe_do_db_dup_warning(r, dup_mode)) {
r = db->close(db, 0); assert(r == 0); return;
r = db->close(db, 0); assert(r == 0);
r = env->close(env, 0); assert(r == 0);
return;
}
assert(r == 0);
r = db->set_pagesize(db, 4096); assert(r == 0);
r = db->open(db, null_txn, fname, "main", DB_BTREE, DB_CREATE, 0666);
if (maybe_do_db_dup_warning(r, dup_mode)) {
r = db->close(db, 0); assert(r == 0); return;
r = db->close(db, 0); assert(r == 0);
r = env->close(env, 0); assert(r == 0);
return;
}
assert(r == 0);
......@@ -191,6 +197,7 @@ test_put_00_01_01 (int dup_mode, u_int32_t put_flags) {
r = db->set_flags(db, dup_mode);
if (maybe_do_db_dup_warning(r, dup_mode)) {
r = db->close(db, 0); assert(r == 0);
r = env->close(env, 0); assert(r == 0);
return;
}
assert(r == 0);
......
......@@ -45,6 +45,7 @@ test_dup_flags (u_int32_t dup_flags) {
if (r != 0 && dup_flags == DB_DUP) {
if (verbose) printf("%s:%d: WARNING: tokudb does not support DB_DUP\n", __FILE__, __LINE__);
r = db->close(db, 0); assert(r == 0);
r = env->close(env, 0); assert(r == 0);
return;
}
}
......
......@@ -109,6 +109,7 @@ test_hsoc (int pagesize, int dup_mode) {
r = cursor->c_close(cursor); assert(r == 0);
r = db->close(db, 0); assert(r == 0);
r = env->close(env, 0); assert(r == 0);
}
int
......
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