diff --git a/common/shm_utils.cpp b/common/shm_utils.cpp index 1697d0a..f168181 100644 --- a/common/shm_utils.cpp +++ b/common/shm_utils.cpp @@ -113,10 +113,12 @@ int readDataFromShmNoClear(char* buf) int waitDataWithCode(char* code, char* data) { + LOG("waitDataWithCode begin..."); int i = 0; int timeout = 10; char str[MAX_DATA_LENGTH] = { 0 }; if (code == nullptr || data == nullptr) { + LOG("code = nullptr ,data = nullptr"); return RES_FAIL; } while (i < timeout) { diff --git a/distributeddatamgr/cpptest/distributed_kv_store/disdata_func_test.cpp b/distributeddatamgr/cpptest/distributed_kv_store/disdata_func_test.cpp index f661b54..76f9f2e 100755 --- a/distributeddatamgr/cpptest/distributed_kv_store/disdata_func_test.cpp +++ b/distributeddatamgr/cpptest/distributed_kv_store/disdata_func_test.cpp @@ -209,17 +209,19 @@ void DisKvTest::RemoteCreateKV(char* str) char code[CODE_LEN_TEN] = { 0 }; (void)memset_s(str, MAX_DATA_LENGTH, 0, MAX_DATA_LENGTH); - if (memset_s(code, strlen(code), 0, CODE_LEN_TEN) != EOK) { - return; - } Int2String(CTRL_CODE_RESULT_TYPE, str); if (str == nullptr) { + LOG("%s Int2String(CTRL_CODE_RESULT_TYPE, str)", LOGSTR); return; } if (strcpy_s(code, strlen(str) + 1, str) != EOK) { + LOG("%s strcpy_s(code", LOGSTR); return; } + (void)memset_s(str, MAX_DATA_LENGTH, 0, MAX_DATA_LENGTH); + LOG("%s code=%s, str=%s", LOGSTR, code, str); waitDataWithCode(code, str); + LOG("%s waitDataWithCode(code, str)", LOGSTR); int ret = strcmp(str, "0"); if (ret == 0) { LOG("%s SUCCESS: Remote---CREATE_KV ", LOGSTR); @@ -229,21 +231,25 @@ void DisKvTest::RemoteCreateKV(char* str) } void DisKvTest::RemoteDeleteKV(char* str) { - LOG("%s RemoteCreateKV", LOGSTR); + LOG("%s RemoteDeleteKV", LOGSTR); writeCodeDataToShm(CTRL_CODE_DATAMGR_DELETE_KV, str); char code[CODE_LEN_TEN] = { 0 }; (void)memset_s(str, MAX_DATA_LENGTH, 0, MAX_DATA_LENGTH); Int2String(CTRL_CODE_RESULT_TYPE, str); if (str == nullptr) { + LOG("%s Int2String(CTRL_CODE_RESULT_TYPE, str)", LOGSTR); return; } if (strcpy_s(code, strlen(str) + 1, str) != EOK) { + LOG("%s strcpy_s(code", LOGSTR); return; } (void)memset_s(str, MAX_DATA_LENGTH, 0, MAX_DATA_LENGTH); + LOG("%s code=%s, str=%s", LOGSTR, code, str); waitDataWithCode(code, str); + LOG("%s waitDataWithCode(code, str)", LOGSTR); int ret = strcmp(str, "0"); if (ret == 0) { LOG("%s SUCCESS: Remote---DELETE_KV ", LOGSTR);