提交 4e6ea0d2 编写于 作者: H Hongze Cheng

new test

上级 0492362f
......@@ -121,7 +121,7 @@ TEST(tdb_test, simple_test) {
int nData = 1000000;
// Open Env
ret = tdbEnvOpen("tdb", 4096, 256000, &pEnv);
ret = tdbEnvOpen("tdb", 4096, 100, &pEnv);
GTEST_ASSERT_EQ(ret, 0);
// Create a database
......@@ -134,22 +134,20 @@ TEST(tdb_test, simple_test) {
char val[64];
{ // Insert some data
for (int i = 1; i <= nData;) {
tdbBegin(pEnv);
int i = 1;
for (;;) {
if (i > nData) break;
for (int k = 0; k < 10; k++) {
sprintf(key, "key%d", i);
sprintf(val, "value%d", i);
ret = tdbDbInsert(pDb, key, strlen(key), val, strlen(val));
GTEST_ASSERT_EQ(ret, 0);
i++;
}
tdbCommit(pEnv);
}
}
{ // Query the data
void *pVal = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册