tdb/ofp-test: fix memory leaks
This commit is contained in:
parent
76a734c53a
commit
fe197ccf9c
|
@ -190,6 +190,15 @@ static void insertOfp(void) {
|
||||||
// commit current transaction
|
// commit current transaction
|
||||||
tdbCommit(pEnv, txn);
|
tdbCommit(pEnv, txn);
|
||||||
tdbPostCommit(pEnv, txn);
|
tdbPostCommit(pEnv, txn);
|
||||||
|
|
||||||
|
closePool(pPool);
|
||||||
|
|
||||||
|
// Close a database
|
||||||
|
tdbTbClose(pDb);
|
||||||
|
|
||||||
|
// Close Env
|
||||||
|
ret = tdbClose(pEnv);
|
||||||
|
GTEST_ASSERT_EQ(ret, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TEST(TdbOVFLPagesTest, DISABLED_TbInsertTest) {
|
// TEST(TdbOVFLPagesTest, DISABLED_TbInsertTest) {
|
||||||
|
@ -233,6 +242,13 @@ TEST(TdbOVFLPagesTest, TbGetTest) {
|
||||||
|
|
||||||
tdbFree(pVal);
|
tdbFree(pVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Close a database
|
||||||
|
tdbTbClose(pDb);
|
||||||
|
|
||||||
|
// Close Env
|
||||||
|
ret = tdbClose(pEnv);
|
||||||
|
GTEST_ASSERT_EQ(ret, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TEST(TdbOVFLPagesTest, DISABLED_TbDeleteTest) {
|
// TEST(TdbOVFLPagesTest, DISABLED_TbDeleteTest) {
|
||||||
|
@ -334,6 +350,15 @@ tdbBegin(pEnv, &txn);
|
||||||
// commit current transaction
|
// commit current transaction
|
||||||
tdbCommit(pEnv, txn);
|
tdbCommit(pEnv, txn);
|
||||||
tdbPostCommit(pEnv, txn);
|
tdbPostCommit(pEnv, txn);
|
||||||
|
|
||||||
|
closePool(pPool);
|
||||||
|
|
||||||
|
// Close a database
|
||||||
|
tdbTbClose(pDb);
|
||||||
|
|
||||||
|
// Close Env
|
||||||
|
ret = tdbClose(pEnv);
|
||||||
|
GTEST_ASSERT_EQ(ret, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TEST(tdb_test, DISABLED_simple_insert1) {
|
// TEST(tdb_test, DISABLED_simple_insert1) {
|
||||||
|
@ -407,6 +432,8 @@ TEST(tdb_test, simple_insert1) {
|
||||||
tdbCommit(pEnv, txn);
|
tdbCommit(pEnv, txn);
|
||||||
tdbPostCommit(pEnv, txn);
|
tdbPostCommit(pEnv, txn);
|
||||||
|
|
||||||
|
closePool(pPool);
|
||||||
|
|
||||||
{ // Query the data
|
{ // Query the data
|
||||||
void *pVal = NULL;
|
void *pVal = NULL;
|
||||||
int vLen;
|
int vLen;
|
||||||
|
|
Loading…
Reference in New Issue