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

fix problems

上级 264b3f0c
......@@ -193,6 +193,10 @@ static SPage *tdbPCacheFetchImpl(SPCache *pCache, const SPgid *pPgid, TXN *pTxn)
memcpy(pPage->pData, pPageH->pData, pPage->pageSize);
tdbPageInit(pPage, pPageH->pPageHdr - pPageH->pData, pPageH->xCellSize);
pPage->kLen = pPageH->kLen;
pPage->vLen = pPageH->vLen;
pPage->maxLocal = pPageH->maxLocal;
pPage->minLocal = pPageH->minLocal;
} else {
memcpy(&(pPage->pgid), pPgid, sizeof(*pPgid));
pPage->pLruNext = NULL;
......
#include <gtest/gtest.h>
#include "os.h"
#include "tdbInt.h"
#include <string>
......@@ -122,6 +123,8 @@ TEST(tdb_test, simple_test) {
int nData = 10000000;
TXN txn;
taosRemoveDir("tdb");
// Open Env
ret = tdbEnvOpen("tdb", 4096, 64, &pEnv);
GTEST_ASSERT_EQ(ret, 0);
......@@ -235,15 +238,17 @@ TEST(tdb_test, simple_test2) {
TENV *pEnv;
TDB *pDb;
FKeyComparator compFunc;
int nData = 10000;
int nData = 1000000;
TXN txn;
taosRemoveDir("tdb");
// Open Env
ret = tdbEnvOpen("tdb", 1024, 0, &pEnv);
ret = tdbEnvOpen("tdb", 1024, 10, &pEnv);
GTEST_ASSERT_EQ(ret, 0);
// Create a database
compFunc = tKeyCmpr;
compFunc = tDefaultKeyCmpr;
ret = tdbDbOpen("db.db", TDB_VARIANT_LEN, TDB_VARIANT_LEN, compFunc, pEnv, &pDb);
GTEST_ASSERT_EQ(ret, 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册