test case: mem overflow
This commit is contained in:
parent
539543b011
commit
90e54d0603
|
@ -169,7 +169,8 @@ TEST_F(MndTestFunc, 03_Retrieve_Func) {
|
||||||
SRetrieveFuncReq retrieveReq = {0};
|
SRetrieveFuncReq retrieveReq = {0};
|
||||||
retrieveReq.numOfFuncs = 1;
|
retrieveReq.numOfFuncs = 1;
|
||||||
retrieveReq.pFuncNames = taosArrayInit(1, TSDB_FUNC_NAME_LEN);
|
retrieveReq.pFuncNames = taosArrayInit(1, TSDB_FUNC_NAME_LEN);
|
||||||
taosArrayPush(retrieveReq.pFuncNames, "f1");
|
char name[TSDB_FUNC_NAME_LEN] = "f1";
|
||||||
|
taosArrayPush(retrieveReq.pFuncNames, name);
|
||||||
|
|
||||||
int32_t contLen = tSerializeSRetrieveFuncReq(NULL, 0, &retrieveReq);
|
int32_t contLen = tSerializeSRetrieveFuncReq(NULL, 0, &retrieveReq);
|
||||||
void* pReq = rpcMallocCont(contLen);
|
void* pReq = rpcMallocCont(contLen);
|
||||||
|
@ -220,7 +221,8 @@ TEST_F(MndTestFunc, 03_Retrieve_Func) {
|
||||||
retrieveReq.numOfFuncs = TSDB_FUNC_MAX_RETRIEVE + 1;
|
retrieveReq.numOfFuncs = TSDB_FUNC_MAX_RETRIEVE + 1;
|
||||||
retrieveReq.pFuncNames = taosArrayInit(TSDB_FUNC_MAX_RETRIEVE + 1, TSDB_FUNC_NAME_LEN);
|
retrieveReq.pFuncNames = taosArrayInit(TSDB_FUNC_MAX_RETRIEVE + 1, TSDB_FUNC_NAME_LEN);
|
||||||
for (int32_t i = 0; i < TSDB_FUNC_MAX_RETRIEVE + 1; ++i) {
|
for (int32_t i = 0; i < TSDB_FUNC_MAX_RETRIEVE + 1; ++i) {
|
||||||
taosArrayPush(retrieveReq.pFuncNames, "1");
|
char name[TSDB_FUNC_NAME_LEN] = "1";
|
||||||
|
taosArrayPush(retrieveReq.pFuncNames, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t contLen = tSerializeSRetrieveFuncReq(NULL, 0, &retrieveReq);
|
int32_t contLen = tSerializeSRetrieveFuncReq(NULL, 0, &retrieveReq);
|
||||||
|
@ -237,7 +239,8 @@ TEST_F(MndTestFunc, 03_Retrieve_Func) {
|
||||||
SRetrieveFuncReq retrieveReq = {0};
|
SRetrieveFuncReq retrieveReq = {0};
|
||||||
retrieveReq.numOfFuncs = 1;
|
retrieveReq.numOfFuncs = 1;
|
||||||
retrieveReq.pFuncNames = taosArrayInit(1, TSDB_FUNC_NAME_LEN);
|
retrieveReq.pFuncNames = taosArrayInit(1, TSDB_FUNC_NAME_LEN);
|
||||||
taosArrayPush(retrieveReq.pFuncNames, "f2");
|
char name[TSDB_FUNC_NAME_LEN] = "f2";
|
||||||
|
taosArrayPush(retrieveReq.pFuncNames, name);
|
||||||
|
|
||||||
int32_t contLen = tSerializeSRetrieveFuncReq(NULL, 0, &retrieveReq);
|
int32_t contLen = tSerializeSRetrieveFuncReq(NULL, 0, &retrieveReq);
|
||||||
void* pReq = rpcMallocCont(contLen);
|
void* pReq = rpcMallocCont(contLen);
|
||||||
|
@ -279,7 +282,8 @@ TEST_F(MndTestFunc, 03_Retrieve_Func) {
|
||||||
SRetrieveFuncReq retrieveReq = {0};
|
SRetrieveFuncReq retrieveReq = {0};
|
||||||
retrieveReq.numOfFuncs = 1;
|
retrieveReq.numOfFuncs = 1;
|
||||||
retrieveReq.pFuncNames = taosArrayInit(1, TSDB_FUNC_NAME_LEN);
|
retrieveReq.pFuncNames = taosArrayInit(1, TSDB_FUNC_NAME_LEN);
|
||||||
taosArrayPush(retrieveReq.pFuncNames, "f2");
|
char name[TSDB_FUNC_NAME_LEN] = "f2";
|
||||||
|
taosArrayPush(retrieveReq.pFuncNames, name);
|
||||||
|
|
||||||
int32_t contLen = tSerializeSRetrieveFuncReq(NULL, 0, &retrieveReq);
|
int32_t contLen = tSerializeSRetrieveFuncReq(NULL, 0, &retrieveReq);
|
||||||
void* pReq = rpcMallocCont(contLen);
|
void* pReq = rpcMallocCont(contLen);
|
||||||
|
@ -316,8 +320,10 @@ TEST_F(MndTestFunc, 03_Retrieve_Func) {
|
||||||
SRetrieveFuncReq retrieveReq = {0};
|
SRetrieveFuncReq retrieveReq = {0};
|
||||||
retrieveReq.numOfFuncs = 2;
|
retrieveReq.numOfFuncs = 2;
|
||||||
retrieveReq.pFuncNames = taosArrayInit(1, TSDB_FUNC_NAME_LEN);
|
retrieveReq.pFuncNames = taosArrayInit(1, TSDB_FUNC_NAME_LEN);
|
||||||
taosArrayPush(retrieveReq.pFuncNames, "f2");
|
char name1[TSDB_FUNC_NAME_LEN] = "f2";
|
||||||
taosArrayPush(retrieveReq.pFuncNames, "f1");
|
taosArrayPush(retrieveReq.pFuncNames, name1);
|
||||||
|
char name2[TSDB_FUNC_NAME_LEN] = "f1";
|
||||||
|
taosArrayPush(retrieveReq.pFuncNames, name2);
|
||||||
|
|
||||||
int32_t contLen = tSerializeSRetrieveFuncReq(NULL, 0, &retrieveReq);
|
int32_t contLen = tSerializeSRetrieveFuncReq(NULL, 0, &retrieveReq);
|
||||||
void* pReq = rpcMallocCont(contLen);
|
void* pReq = rpcMallocCont(contLen);
|
||||||
|
@ -367,8 +373,10 @@ TEST_F(MndTestFunc, 03_Retrieve_Func) {
|
||||||
SRetrieveFuncReq retrieveReq = {0};
|
SRetrieveFuncReq retrieveReq = {0};
|
||||||
retrieveReq.numOfFuncs = 2;
|
retrieveReq.numOfFuncs = 2;
|
||||||
retrieveReq.pFuncNames = taosArrayInit(1, TSDB_FUNC_NAME_LEN);
|
retrieveReq.pFuncNames = taosArrayInit(1, TSDB_FUNC_NAME_LEN);
|
||||||
taosArrayPush(retrieveReq.pFuncNames, "f2");
|
char name1[TSDB_FUNC_NAME_LEN] = "f2";
|
||||||
taosArrayPush(retrieveReq.pFuncNames, "f3");
|
taosArrayPush(retrieveReq.pFuncNames, name1);
|
||||||
|
char name2[TSDB_FUNC_NAME_LEN] = "f3";
|
||||||
|
taosArrayPush(retrieveReq.pFuncNames, name2);
|
||||||
|
|
||||||
int32_t contLen = tSerializeSRetrieveFuncReq(NULL, 0, &retrieveReq);
|
int32_t contLen = tSerializeSRetrieveFuncReq(NULL, 0, &retrieveReq);
|
||||||
void* pReq = rpcMallocCont(contLen);
|
void* pReq = rpcMallocCont(contLen);
|
||||||
|
@ -483,7 +491,8 @@ TEST_F(MndTestFunc, 05_Actual_code) {
|
||||||
SRetrieveFuncReq retrieveReq = {0};
|
SRetrieveFuncReq retrieveReq = {0};
|
||||||
retrieveReq.numOfFuncs = 1;
|
retrieveReq.numOfFuncs = 1;
|
||||||
retrieveReq.pFuncNames = taosArrayInit(1, TSDB_FUNC_NAME_LEN);
|
retrieveReq.pFuncNames = taosArrayInit(1, TSDB_FUNC_NAME_LEN);
|
||||||
taosArrayPush(retrieveReq.pFuncNames, "udf1");
|
char name[TSDB_FUNC_NAME_LEN] = "udf1";
|
||||||
|
taosArrayPush(retrieveReq.pFuncNames, name);
|
||||||
|
|
||||||
int32_t contLen = tSerializeSRetrieveFuncReq(NULL, 0, &retrieveReq);
|
int32_t contLen = tSerializeSRetrieveFuncReq(NULL, 0, &retrieveReq);
|
||||||
void* pReq = rpcMallocCont(contLen);
|
void* pReq = rpcMallocCont(contLen);
|
||||||
|
|
Loading…
Reference in New Issue