diff --git a/source/util/test/pageBufferTest.cpp b/source/util/test/pageBufferTest.cpp index e86fcf8653..4b9d8c5f51 100644 --- a/source/util/test/pageBufferTest.cpp +++ b/source/util/test/pageBufferTest.cpp @@ -18,7 +18,7 @@ void simpleTest() { int32_t pageId = 0; int32_t groupId = 0; - SFilePage* pBufPage = getNewBufPage(pResultBuf, groupId, &pageId); + SFilePage* pBufPage = static_cast(getNewBufPage(pResultBuf, groupId, &pageId)); ASSERT_TRUE(pBufPage != NULL); ASSERT_EQ(getTotalBufSize(pResultBuf), 1024); @@ -29,25 +29,25 @@ void simpleTest() { releaseBufPage(pResultBuf, pBufPage); - SFilePage* pBufPage1 = getNewBufPage(pResultBuf, groupId, &pageId); + SFilePage* pBufPage1 = static_cast(getNewBufPage(pResultBuf, groupId, &pageId)); - SFilePage* t = getBufPage(pResultBuf, pageId); + SFilePage* t = static_cast(getBufPage(pResultBuf, pageId)); ASSERT_TRUE(t == pBufPage1); - SFilePage* pBufPage2 = getNewBufPage(pResultBuf, groupId, &pageId); - SFilePage* t1 = getBufPage(pResultBuf, pageId); + SFilePage* pBufPage2 = static_cast(getNewBufPage(pResultBuf, groupId, &pageId)); + SFilePage* t1 = static_cast(getBufPage(pResultBuf, pageId)); ASSERT_TRUE(t1 == pBufPage2); - SFilePage* pBufPage3 = getNewBufPage(pResultBuf, groupId, &pageId); - SFilePage* t2 = getBufPage(pResultBuf, pageId); + SFilePage* pBufPage3 = static_cast(getNewBufPage(pResultBuf, groupId, &pageId)); + SFilePage* t2 = static_cast(getBufPage(pResultBuf, pageId)); ASSERT_TRUE(t2 == pBufPage3); - SFilePage* pBufPage4 = getNewBufPage(pResultBuf, groupId, &pageId); - SFilePage* t3 = getBufPage(pResultBuf, pageId); + SFilePage* pBufPage4 = static_cast(getNewBufPage(pResultBuf, groupId, &pageId)); + SFilePage* t3 = static_cast(getBufPage(pResultBuf, pageId)); ASSERT_TRUE(t3 == pBufPage4); - SFilePage* pBufPage5 = getNewBufPage(pResultBuf, groupId, &pageId); - SFilePage* t4 = getBufPage(pResultBuf, pageId); + SFilePage* pBufPage5 = static_cast(getNewBufPage(pResultBuf, groupId, &pageId)); + SFilePage* t4 = static_cast(getBufPage(pResultBuf, pageId)); ASSERT_TRUE(t4 == pBufPage5); destroyDiskbasedBuf(pResultBuf); @@ -62,36 +62,36 @@ void writeDownTest() { int32_t groupId = 0; int32_t nx = 12345; - SFilePage* pBufPage = getNewBufPage(pResultBuf, groupId, &pageId); + SFilePage* pBufPage = static_cast(getNewBufPage(pResultBuf, groupId, &pageId)); ASSERT_TRUE(pBufPage != NULL); *(int32_t*)(pBufPage->data) = nx; writePageId = pageId; releaseBufPage(pResultBuf, pBufPage); - SFilePage* pBufPage1 = getNewBufPage(pResultBuf, groupId, &pageId); - SFilePage* t1 = getBufPage(pResultBuf, pageId); + SFilePage* pBufPage1 = static_cast(getNewBufPage(pResultBuf, groupId, &pageId)); + SFilePage* t1 = static_cast(getBufPage(pResultBuf, pageId)); ASSERT_TRUE(t1 == pBufPage1); ASSERT_TRUE(pageId == 1); - SFilePage* pBufPage2 = getNewBufPage(pResultBuf, groupId, &pageId); - SFilePage* t2 = getBufPage(pResultBuf, pageId); + SFilePage* pBufPage2 = static_cast(getNewBufPage(pResultBuf, groupId, &pageId)); + SFilePage* t2 = static_cast(getBufPage(pResultBuf, pageId)); ASSERT_TRUE(t2 == pBufPage2); ASSERT_TRUE(pageId == 2); - SFilePage* pBufPage3 = getNewBufPage(pResultBuf, groupId, &pageId); - SFilePage* t3 = getBufPage(pResultBuf, pageId); + SFilePage* pBufPage3 = static_cast(getNewBufPage(pResultBuf, groupId, &pageId)); + SFilePage* t3 = static_cast(getBufPage(pResultBuf, pageId)); ASSERT_TRUE(t3 == pBufPage3); ASSERT_TRUE(pageId == 3); - SFilePage* pBufPage4 = getNewBufPage(pResultBuf, groupId, &pageId); - SFilePage* t4 = getBufPage(pResultBuf, pageId); + SFilePage* pBufPage4 = static_cast(getNewBufPage(pResultBuf, groupId, &pageId)); + SFilePage* t4 = static_cast(getBufPage(pResultBuf, pageId)); ASSERT_TRUE(t4 == pBufPage4); ASSERT_TRUE(pageId == 4); releaseBufPage(pResultBuf, t4); // flush the written page to disk, and read it out again - SFilePage* pBufPagex = getBufPage(pResultBuf, writePageId); + SFilePage* pBufPagex = static_cast(getBufPage(pResultBuf, writePageId)); ASSERT_EQ(*(int32_t*)pBufPagex->data, nx); SArray* pa = getDataBufPagesIdList(pResultBuf, groupId); @@ -109,43 +109,43 @@ void recyclePageTest() { int32_t groupId = 0; int32_t nx = 12345; - SFilePage* pBufPage = getNewBufPage(pResultBuf, groupId, &pageId); + SFilePage* pBufPage = static_cast(getNewBufPage(pResultBuf, groupId, &pageId)); ASSERT_TRUE(pBufPage != NULL); releaseBufPage(pResultBuf, pBufPage); - SFilePage* pBufPage1 = getNewBufPage(pResultBuf, groupId, &pageId); - SFilePage* t1 = getBufPage(pResultBuf, pageId); + SFilePage* pBufPage1 = static_cast(getNewBufPage(pResultBuf, groupId, &pageId)); + SFilePage* t1 = static_cast(getBufPage(pResultBuf, pageId)); ASSERT_TRUE(t1 == pBufPage1); ASSERT_TRUE(pageId == 1); - SFilePage* pBufPage2 = getNewBufPage(pResultBuf, groupId, &pageId); - SFilePage* t2 = getBufPage(pResultBuf, pageId); + SFilePage* pBufPage2 = static_cast(getNewBufPage(pResultBuf, groupId, &pageId)); + SFilePage* t2 = static_cast(getBufPage(pResultBuf, pageId)); ASSERT_TRUE(t2 == pBufPage2); ASSERT_TRUE(pageId == 2); - SFilePage* pBufPage3 = getNewBufPage(pResultBuf, groupId, &pageId); - SFilePage* t3 = getBufPage(pResultBuf, pageId); + SFilePage* pBufPage3 = static_cast(getNewBufPage(pResultBuf, groupId, &pageId)); + SFilePage* t3 = static_cast(getBufPage(pResultBuf, pageId)); ASSERT_TRUE(t3 == pBufPage3); ASSERT_TRUE(pageId == 3); - SFilePage* pBufPage4 = getNewBufPage(pResultBuf, groupId, &pageId); - SFilePage* t4 = getBufPage(pResultBuf, pageId); + SFilePage* pBufPage4 = static_cast(getNewBufPage(pResultBuf, groupId, &pageId)); + SFilePage* t4 = static_cast(getBufPage(pResultBuf, pageId)); ASSERT_TRUE(t4 == pBufPage4); ASSERT_TRUE(pageId == 4); releaseBufPage(pResultBuf, t4); - SFilePage* pBufPage5 = getNewBufPage(pResultBuf, groupId, &pageId); - SFilePage* t5 = getBufPage(pResultBuf, pageId); + SFilePage* pBufPage5 = static_cast(getNewBufPage(pResultBuf, groupId, &pageId)); + SFilePage* t5 = static_cast(getBufPage(pResultBuf, pageId)); ASSERT_TRUE(t5 == pBufPage5); ASSERT_TRUE(pageId == 5); // flush the written page to disk, and read it out again - SFilePage* pBufPagex = getBufPage(pResultBuf, writePageId); + SFilePage* pBufPagex = static_cast(getBufPage(pResultBuf, writePageId)); *(int32_t*)(pBufPagex->data) = nx; writePageId = pageId; // update the data releaseBufPage(pResultBuf, pBufPagex); - SFilePage* pBufPagex1 = getBufPage(pResultBuf, 1); + SFilePage* pBufPagex1 = static_cast(getBufPage(pResultBuf, 1)); SArray* pa = getDataBufPagesIdList(pResultBuf, groupId); ASSERT_EQ(taosArrayGetSize(pa), 6);