diff --git a/source/dnode/mnode/impl/test/stream/stream.cpp b/source/dnode/mnode/impl/test/stream/stream.cpp index 5cf9b52de7..0a1e9a0059 100644 --- a/source/dnode/mnode/impl/test/stream/stream.cpp +++ b/source/dnode/mnode/impl/test/stream/stream.cpp @@ -49,7 +49,9 @@ SRpcMsg buildHbReq() { entry.stage = 4; } - taosArrayPush(msg.pTaskStatus, &entry); + void* px = taosArrayPush(msg.pTaskStatus, &entry); + ASSERT(px != NULL); + } // (p->checkpointId != 0) && p->checkpointFailed @@ -65,7 +67,8 @@ SRpcMsg buildHbReq() { entry.checkpointInfo.activeId = 1; entry.checkpointInfo.failed = true; - taosArrayPush(msg.pTaskStatus, &entry); + void* px = taosArrayPush(msg.pTaskStatus, &entry); + ASSERT(px != NULL); } int32_t tlen = 0; @@ -122,8 +125,11 @@ void setTask(SStreamTask* pTask, int32_t nodeId, int64_t streamId, int32_t taskI entry.stage = 1; entry.status = TASK_STATUS__READY; - taosHashPut(pExecNode->pTaskMap, &id, sizeof(id), &entry, sizeof(entry)); - taosArrayPush(pExecNode->pTaskList, &id); + int32_t code = taosHashPut(pExecNode->pTaskMap, &id, sizeof(id), &entry, sizeof(entry)); + ASSERT(code == 0); + + void* px = taosArrayPush(pExecNode->pTaskList, &id); + ASSERT(px != NULL); } void initStreamExecInfo() { @@ -141,7 +147,8 @@ void initNodeInfo() { SNodeEntry entry = {0}; entry.nodeId = 2; entry.stageUpdated = true; - taosArrayPush(execInfo.pNodeList, &entry); + void* px = taosArrayPush(execInfo.pNodeList, &entry); + ASSERT(px != NULL); } } // namespace @@ -149,15 +156,17 @@ class StreamTest : public testing::Test { // 继承了 testing::Test protected: static void SetUpTestSuite() { - mndInitExecInfo(); + int32_t code = mndInitExecInfo(); + ASSERT(code == 0); + initStreamExecInfo(); initNodeInfo(); - std::cout<<"setup env for streamTest suite"<(taosMemoryCalloc(1, sizeof(SMnode))); {// init sdb @@ -203,7 +213,8 @@ TEST_F(StreamTest, kill_checkpoint_trans) { const char* pDbName = "test_db_name"; int32_t len = strlen(pDbName); - taosHashPut(info.pDBMap, pDbName, len, NULL, 0); + int32_t code = taosHashPut(info.pDBMap, pDbName, len, NULL, 0); + ASSERT(code == 0); killAllCheckpointTrans(pMnode, &info); @@ -225,12 +236,17 @@ TEST_F(StreamTest, kill_checkpoint_trans) { pTask->id.streamId = defStreamId; pTask->id.taskId = 1; pTask->exec.qmsg = (char*)taosMemoryCalloc(1,1); - taosThreadMutexInit(&pTask->lock, NULL); + int32_t code = taosThreadMutexInit(&pTask->lock, NULL); + ASSERT(code == 0); - taosArrayPush(pLevel, &pTask); + void* px = taosArrayPush(pLevel, &pTask); + ASSERT(px != NULL); - taosArrayPush(pStream->tasks, &pLevel); - mndCreateStreamResetStatusTrans(pMnode, pStream); + px = taosArrayPush(pStream->tasks, &pLevel); + ASSERT(px != NULL); + + int32_t code = mndCreateStreamResetStatusTrans(pMnode, pStream); + ASSERT(code == 0); tFreeStreamObj(pStream); sdbCleanup(pMnode->pSdb);