diff --git a/services/distributeddataservice/libs/distributeddb/test/unittest/common/common/distributeddb_notification_chain_test.cpp b/services/distributeddataservice/libs/distributeddb/test/unittest/common/common/distributeddb_notification_chain_test.cpp index 7d90625f76c395cd84331b497562caf15e4c8a70..27061306f29fa627bb419f2ef6d8703bd65b4312 100755 --- a/services/distributeddataservice/libs/distributeddb/test/unittest/common/common/distributeddb_notification_chain_test.cpp +++ b/services/distributeddataservice/libs/distributeddb/test/unittest/common/common/distributeddb_notification_chain_test.cpp @@ -31,8 +31,8 @@ namespace { int g_onEventTestNum = 0; bool g_onFinalizeCalled = false; - auto g_onEventFunction = [](void *arg) { - g_onEventTestNum = *(reinterpret_cast(arg)); + auto g_onEventFunction = [](const void *arg) { + g_onEventTestNum = *(reinterpret_cast(arg)); LOGI("g_onEventFunction called."); }; diff --git a/services/distributeddataservice/test/common/distributeddb/src/distributeddb_nb_test_tools.cpp b/services/distributeddataservice/test/common/distributeddb/src/distributeddb_nb_test_tools.cpp index d929793b9201a3a2ca0a63a59fa0a8aa8c8f020e..29fb2b05d40f931753771d8fb9648ee1fb69501d 100755 --- a/services/distributeddataservice/test/common/distributeddb/src/distributeddb_nb_test_tools.cpp +++ b/services/distributeddataservice/test/common/distributeddb/src/distributeddb_nb_test_tools.cpp @@ -473,33 +473,33 @@ bool DistributedDBNbTestTools::MoveToNextFromBegin(KvStoreResultSet &resultSet, for (int position = -1; position < recordCnt; ++position) { // the first pos after getentries is -1. bool expectRes = resultSet.MoveToNext(); if (position < (recordCnt - 1)) { - result = result & expectRes; + result = result && expectRes; } else { - result = result & (!expectRes); + result = result && (!expectRes); } if (!result) { MST_LOG("resultSet.MoveToNext() doesn't meet expectations!!!"); break; } positionGot = position + 1; - result = result & (resultSet.GetPosition() == positionGot); + result = result && (resultSet.GetPosition() == positionGot); if (!result) { MST_LOG("resultSet.GetPosition() != positionGot!!!"); break; } if (position < (recordCnt - 1)) { - result = result & (resultSet.GetEntry(entry) == OK); + result = result && (resultSet.GetEntry(entry) == OK); if (!result) { MST_LOG("resultSet.GetEntry() != OK"); break; } - result = result & (entry.key == entries[positionGot].key) & (entry.value == entries[positionGot].value); + result = result && (entry.key == entries[positionGot].key) && (entry.value == entries[positionGot].value); if (!result) { MST_LOG("entry != entries[positionGot]"); break; } } else { - result = result & (resultSet.GetEntry(entry) == NOT_FOUND); + result = result && (resultSet.GetEntry(entry) == NOT_FOUND); } } return result; @@ -553,4 +553,4 @@ void KvStoreNbCorruptInfo::CorruptCallBackOfExport(const std::string &appId, con MST_LOG("[KvStoreNbCorruptInfo::CorruptCallBackOfExport] Export failed!"); pathResult.result = false; } -} \ No newline at end of file +}