提交 e835a6cc 编写于 作者: H Hongze Cheng

more TDB

上级 b3575d7c
# # tdbTest # tdbTest
# add_executable(tdbTest "tdbTest.cpp") add_executable(tdbTest "tdbTest.cpp")
# target_link_libraries(tdbTest tdb gtest gtest_main) target_link_libraries(tdbTest tdb gtest gtest_main)
\ No newline at end of file \ No newline at end of file
...@@ -2,13 +2,32 @@ ...@@ -2,13 +2,32 @@
#include "tdb.h" #include "tdb.h"
TEST(tdb_api_test, tdb_create_open_close_db_test) { #define A_ASSERT(op) GTEST_ASSERT_EQ(op, 0)
// int ret;
// TDB *dbp;
// tdbCreateDB(&dbp, TDB_BTREE_T); TEST(tdb_test, simple_test) {
TENV *pEnv;
TDB * pDb1, *pDb2;
// tdbOpenDB(dbp, 0); // ENV
tdbEnvCreate(&pEnv);
tdbEnvSetPageSize(pEnv, 1024);
tdbEnvSetCacheSize(pEnv, 10240);
tdbEnvOpen(&pEnv);
// tdbCloseDB(dbp, 0); // DB
tdbOpen(&pDb1, "db.db", "db1", pEnv);
tdbOpen(&pDb2, "db.db", "db2", pEnv);
// Insert
// Query
// Delete
// Query
// Close
tdbClose(pDb1);
tdbClose(pDb2);
tdbEnvClose(pEnv);
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册