内源检视问题修改, 增加OAT文件

Signed-off-by: zuojiangjiang <zuojiangjiang@huawei.com>
This commit is contained in:
zuojiangjiang 2022-03-21 22:13:17 +08:00
parent daffb1244a
commit d1cc827f23
159 changed files with 283 additions and 221 deletions

69
OAT.xml Normal file
View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (c) 2021 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- OAT(OSS Audit Tool) configuration guide:
basedir: Root dir, the basedir + project path is the real source file location.
licensefile:
1.If the project don't have "LICENSE" in root dir, please define all the license files in this project in , OAT will check license files according to this rule.
tasklist(only for batch mode):
1. task: Define oat check thread, each task will start a new thread.
2. task name: Only an name, no practical effect.
3. task policy: Default policy for projects under this task, this field is required and the specified policy must defined in policylist.
4. task filter: Default filefilter for projects under this task, this field is required and the specified filefilter must defined in filefilterlist.
5. task project: Projects to be checked, the path field define the source root dir of the project.
policyList:
1. policy: All policyitems will be merged to default OAT.xml rules, the name of policy doesn't affect OAT check process.
2. policyitem: The fields type, name, path, desc is required, and the fields rule, group, filefilter is optional,the default value is:
<policyitem type="" name="" path="" desc="" rule="may" group="defaultGroup" filefilter="defaultPolicyFilter"/>
3. policyitem type:
"compatibility" is used to check license compatibility in the specified path;
"license" is used to check source license header in the specified path;
"copyright" is used to check source copyright header in the specified path;
"import" is used to check source dependency in the specified path, such as import ... ,include ...
"filetype" is used to check file type in the specified path, supported file types: archive, binary
"filename" is used to check whether the specified file exists in the specified path(support projectroot in default OAT.xml), supported file names: LICENSE, README, README.OpenSource
4. policyitem name: This field is used for define the license, copyright, "*" means match all, the "!" prefix means could not match this value. For example, "!GPL" means can not use GPL license.
5. policyitem path: This field is used for define the source file scope to apply this policyitem, the "!" prefix means exclude the files. For example, "!.*/lib/.*" means files in lib dir will be exclude while process this policyitem.
6. policyitem rule and group: These two fields are used together to merge policy results. "may" policyitems in the same group means any one in this group passed, the result will be passed.
7. policyitem filefilter: Used to bind filefilter which define filter rules.
8. filefilter: Filter rules, the type filename is used to filter file name, the type filepath is used to filter file path.
Note:If the text contains special characters, please escape them according to the following rules:
" == &gt;
& == &gt;
' == &gt;
< == &gt;
> == &gt;
-->
<configuration>
<oatconfig>
<licensefile></licensefile>
<policylist>
<policy name="projectPolicy" desc="">
</policy>
</policylist>
<filefilterlist>
<filefilter name="defaultFilter" desc="Files not to check">
<filteritem type="filename" name="*.ha|*.hap|*.rpk" desc="valid and invalid bundle files for tests"/>
<filteritem type="filepath" name="figures/.*" desc="Self-developed image"/>
</filefilter>
</filefilterlist>
</oatconfig>
</configuration>

View File

@ -226,5 +226,5 @@ private:
mutable std::recursive_mutex mutex_;
std::map<_Key, _Tp> entries_;
};
}
} // namespace OHOS
#endif // OHOS_DISTRIBUTED_DATA_FRAMEWORKS_COMMON_CONCURRENT_MAP_H

View File

@ -178,6 +178,6 @@ public:
private:
static inline BrokerDelegator<KvStoreDataServiceProxy> delegator_;
};
}
} // namespace OHOS::DistributedKv
#endif // I_KV_STORE_DATA_SERVICE_H

View File

@ -23,6 +23,6 @@ enum class InnerStatus {
DECREASE_REFCOUNT,
ERROR,
};
}
}
} // namespace DistributedKv
} // namespace OHOS
#endif

View File

@ -170,6 +170,5 @@ private:
template<typename T>
static std::list<T> Convert2List(std::vector<T> &&entries);
};
}
} // namespace OHOS::DistributedKv
#endif

View File

@ -27,4 +27,4 @@ void DeviceStatusChangeListenerClient::OnChange(const DeviceInfo &results, const
listener_->OnDeviceChanged(results, type);
}
}
}
} // namespace OHOS::DistributedKv

View File

@ -431,5 +431,4 @@ bool ITypesUtil::WriteVector(Parcel &parcel, const std::vector<T> &val, bool (Pa
}
return true;
}
}
} // namespace OHOS::DistributedKv

View File

@ -47,4 +47,4 @@ void SyncObserver::SyncCompleted(const std::map<std::string, DistributedKv::Stat
callback->SyncCompleted(results);
}
}
}
} // namespace OHOS::DistributedKv

View File

@ -40,5 +40,5 @@ private:
std::recursive_mutex mutex_;
std::vector<std::shared_ptr<KvStoreSyncCallback>> callbacks_;
};
}
} // namespace OHOS::DistributedKv
#endif // DISTRIBUTEDDATAMGR_DATAMGR_SYNC_OBSERVER_H

View File

@ -2342,4 +2342,3 @@ HWTEST_F(LocalSubscribeStoreTest, ChangeNotificationMarshalling001, TestSize.Lev
EXPECT_EQ(changeOut->IsClear(), false);
delete changeOut;
}

View File

@ -165,7 +165,7 @@ void KvStoreSyncCallbackTestImpl::SyncCompleted(const std::map<std::string, Stat
* @tc.require: SR000DORPS AR000DPRQ7 AR000DDPRPL
* @tc.author: hongbo
*/
HWTEST_F(SingleKvStoreClientTest, GetStoreId001 ,TestSize.Level1)
HWTEST_F(SingleKvStoreClientTest, GetStoreId001, TestSize.Level1)
{
EXPECT_NE(singleKvStorePtr, nullptr) << "kvStorePtr is null.";
@ -180,7 +180,7 @@ HWTEST_F(SingleKvStoreClientTest, GetStoreId001 ,TestSize.Level1)
* @tc.require: SR000DORPS AR000DPRQ7 AR000DDPRPL
* @tc.author: hongbo
*/
HWTEST_F(SingleKvStoreClientTest, PutGetDelete001 ,TestSize.Level1)
HWTEST_F(SingleKvStoreClientTest, PutGetDelete001, TestSize.Level1)
{
EXPECT_NE(singleKvStorePtr, nullptr) << "kvStorePtr is null.";
@ -217,7 +217,7 @@ HWTEST_F(SingleKvStoreClientTest, PutGetDelete001 ,TestSize.Level1)
* @tc.require: SR000DORPS AR000DPRQ7 AR000DDPRPL
* @tc.author: hongbo
*/
HWTEST_F(SingleKvStoreClientTest, GetEntriesAndResultSet001 ,TestSize.Level1)
HWTEST_F(SingleKvStoreClientTest, GetEntriesAndResultSet001, TestSize.Level1)
{
EXPECT_NE(singleKvStorePtr, nullptr) << "kvStorePtr is null.";
@ -265,7 +265,7 @@ HWTEST_F(SingleKvStoreClientTest, GetEntriesAndResultSet001 ,TestSize.Level1)
* @tc.require: SR000DORPS AR000DPRQ7 AR000DDPRPL
* @tc.author: hongbo
*/
HWTEST_F(SingleKvStoreClientTest, Subscribe001 ,TestSize.Level1)
HWTEST_F(SingleKvStoreClientTest, Subscribe001, TestSize.Level1)
{
auto observer = std::make_shared<KvStoreObserverTestImpl>();
auto subStatus = singleKvStorePtr->SubscribeKvStore(SubscribeType::SUBSCRIBE_TYPE_ALL, observer);
@ -285,7 +285,7 @@ HWTEST_F(SingleKvStoreClientTest, Subscribe001 ,TestSize.Level1)
* @tc.require: SR000DORPS AR000DPRQ7 AR000DDPRPL
* @tc.author: hongbo
*/
HWTEST_F(SingleKvStoreClientTest, SyncCallback001 ,TestSize.Level1)
HWTEST_F(SingleKvStoreClientTest, SyncCallback001, TestSize.Level1)
{
EXPECT_NE(singleKvStorePtr, nullptr) << "kvStorePtr is null.";
@ -313,7 +313,7 @@ HWTEST_F(SingleKvStoreClientTest, SyncCallback001 ,TestSize.Level1)
* @tc.require: SR000DORPS AR000DPRQ7 AR000DDPRPL
* @tc.author: hongbo
*/
HWTEST_F(SingleKvStoreClientTest, RemoveDeviceData001 ,TestSize.Level1)
HWTEST_F(SingleKvStoreClientTest, RemoveDeviceData001, TestSize.Level1)
{
EXPECT_NE(singleKvStorePtr, nullptr) << "kvStorePtr is null.";
@ -338,7 +338,7 @@ HWTEST_F(SingleKvStoreClientTest, RemoveDeviceData001 ,TestSize.Level1)
* @tc.require: SR000DORPS AR000DPRQ7 AR000DDPRPL
* @tc.author: hongbo
*/
HWTEST_F(SingleKvStoreClientTest, SyncData001 ,TestSize.Level1)
HWTEST_F(SingleKvStoreClientTest, SyncData001, TestSize.Level1)
{
EXPECT_NE(singleKvStorePtr, nullptr) << "kvStorePtr is null.";
std::string deviceId = "no_exist_device_id";
@ -354,7 +354,7 @@ HWTEST_F(SingleKvStoreClientTest, SyncData001 ,TestSize.Level1)
* @tc.require: AR000DPSF1
* @tc.author: YangLeda
*/
HWTEST_F(SingleKvStoreClientTest, TestSchemaStoreC001 ,TestSize.Level1)
HWTEST_F(SingleKvStoreClientTest, TestSchemaStoreC001, TestSize.Level1)
{
std::shared_ptr<SingleKvStore> schemaSingleKvStorePtr;
DistributedKvDataManager manager;
@ -384,7 +384,7 @@ HWTEST_F(SingleKvStoreClientTest, TestSchemaStoreC001 ,TestSize.Level1)
* @tc.require: SR000DOGQE AR000DPUAN
* @tc.author: wangtao
*/
HWTEST_F(SingleKvStoreClientTest, SyncData002 ,TestSize.Level1)
HWTEST_F(SingleKvStoreClientTest, SyncData002, TestSize.Level1)
{
EXPECT_NE(singleKvStorePtr, nullptr) << "kvStorePtr is null.";
std::string deviceId = "no_exist_device_id";
@ -401,7 +401,7 @@ HWTEST_F(SingleKvStoreClientTest, SyncData002 ,TestSize.Level1)
* @tc.require: SR000DOGQE AR000DPUAO
* @tc.author: wangtao
*/
HWTEST_F(SingleKvStoreClientTest, SetSync001 ,TestSize.Level1)
HWTEST_F(SingleKvStoreClientTest, SetSync001, TestSize.Level1)
{
EXPECT_NE(singleKvStorePtr, nullptr) << "kvStorePtr is null.";
KvSyncParam syncParam{ 500 }; // 500ms
@ -420,7 +420,7 @@ HWTEST_F(SingleKvStoreClientTest, SetSync001 ,TestSize.Level1)
* @tc.require: SR000DOGQE AR000DPUAO
* @tc.author: wangtao
*/
HWTEST_F(SingleKvStoreClientTest, SetSync002 ,TestSize.Level1)
HWTEST_F(SingleKvStoreClientTest, SetSync002, TestSize.Level1)
{
EXPECT_NE(singleKvStorePtr, nullptr) << "kvStorePtr is null.";
KvSyncParam syncParam2{ 50 }; // 50ms
@ -1104,4 +1104,3 @@ HWTEST_F(SingleKvStoreClientTest, UnSubscribeWithQuery001, TestSize.Level1)
auto unSubscribeStatus = singleKvStorePtr->UnsubscribeWithQuery(deviceIds, dataQuery);
EXPECT_NE(unSubscribeStatus, Status::SUCCESS) << "sync device should not return success";
}

View File

@ -51,5 +51,5 @@ protected:
virtual int32_t DoUnSubscribe(const RdbSyncerParam& param) = 0;
};
}
} // namespace OHOS::DistributedRdb
#endif

View File

@ -28,5 +28,5 @@ class RdbManager {
public:
static std::shared_ptr<RdbService> GetRdbService(const RdbSyncerParam& param);
};
}
} // namespace OHOS::DistributedRdb
#endif

View File

@ -79,5 +79,5 @@ private:
RdbSyncCompleteNotifier completeNotifier_;
RdbDataChangeNotifier changeNotifier_;
};
}
} // namespace OHOS::DistributedRdb
#endif

View File

@ -38,5 +38,5 @@ public:
virtual int32_t UnSubscribe(const RdbSyncerParam& param, const SubscribeOption& option,
RdbStoreObserver *observer) = 0;
};
}
} // namespace OHOS::DistributedRdb
#endif

View File

@ -102,5 +102,5 @@ public:
struct DropOption {
};
}
} // namespace OHOS::DistributedRdb
#endif

View File

@ -21,4 +21,4 @@ std::shared_ptr<RdbService> RdbManager::GetRdbService(const RdbSyncerParam& para
{
return RdbManagerImpl::GetInstance().GetRdbService(param);
}
}
} // namespace OHOS::DistributedRdb

View File

@ -145,4 +145,4 @@ void RdbManagerImpl::ResetServiceHandle()
distributedDataMgr_ = nullptr;
rdbService_ = nullptr;
}
}
} // namespace OHOS::DistributedRdb

View File

@ -71,5 +71,5 @@ private:
std::shared_ptr<RdbService> rdbService_;
std::string bundleName_;
};
}
} // namespace OHOS::DistributedRdb
#endif

View File

@ -164,4 +164,4 @@ int32_t RdbNotifierStub::OnChange(const std::string& storeName, const std::vecto
}
return RDB_OK;
}
}
} // namespace OHOS::DistributedRdb

View File

@ -375,4 +375,4 @@ void RdbServiceProxy::ImportObservers(ObserverMap &observers)
return false;
});
}
}
} // namespace OHOS::DistributedRdb

View File

@ -83,5 +83,5 @@ private:
static inline BrokerDelegator<RdbServiceProxy> delegator_;
};
}
} // namespace OHOS::DistributedRdb
#endif

View File

@ -22,6 +22,6 @@
namespace OHOS::DistributedData {
napi_status InitConstProperties(napi_env env, napi_value exports);
}
} // namespace OHOS::DistributedData
#endif // OHOS_JS_CONST_PROPERTIES_H

View File

@ -21,7 +21,7 @@
namespace OHOS::DistributedData {
class JsDeviceKVStore : public JsKVStore {
public:
JsDeviceKVStore(const std::string& storeId);
explicit JsDeviceKVStore(const std::string& storeId);
~JsDeviceKVStore() = default;
static napi_value Constructor(napi_env env);
@ -39,5 +39,5 @@ private:
static napi_value OnEvent(napi_env env, napi_callback_info info);
static napi_value OffEvent(napi_env env, napi_callback_info info);
};
}
} // namespace OHOS::DistributedData
#endif // OHOS_DEVICE_KV_STORE_H

View File

@ -23,7 +23,7 @@ namespace OHOS::DistributedData {
class JsFieldNode {
public:
using json = nlohmann::json;
JsFieldNode(const std::string& fName);
explicit JsFieldNode(const std::string& fName);
~JsFieldNode() = default;
std::string GetFieldName();
@ -58,5 +58,5 @@ private:
bool isWithDefaultValue = false;
bool isNullable = false;
};
}
} // namespace OHOS::DistributedData
#endif // OHOS_FIELD_NODE_H

View File

@ -55,5 +55,5 @@ private:
std::list<std::shared_ptr<DeathRecipient>> deathRecipient_ {};
std::shared_ptr<UvQueue> uvQueue_;
};
}
} // namespace OHOS::DistributedData
#endif // OHOS_KV_MANAGER_H

View File

@ -35,7 +35,7 @@ enum {
*/
class JsKVStore {
public:
JsKVStore(const std::string& storeId);
explicit JsKVStore(const std::string& storeId);
virtual ~JsKVStore();
void SetNative(std::shared_ptr<DistributedKv::SingleKvStore>& kvStore);

View File

@ -46,6 +46,5 @@ private:
std::shared_ptr<DistributedKv::KvStoreResultSet> resultSet_ = nullptr;
};
}
} // namespace OHOS::DistributedData
#endif // OHOS_KV_STORE_RESELTSET_H

View File

@ -30,5 +30,5 @@ private:
std::shared_ptr<UvQueue> uvQueue_;
napi_ref callback_;
};
}
} // namespace OHOS::DistributedData
#endif // OHOS_JS_OBSERVER_H

View File

@ -62,5 +62,5 @@ private:
private:
DistributedKv::DataQuery query_;
};
}
} // namespace OHOS::DistributedData
#endif // OHOS_QUERY_H

View File

@ -23,7 +23,7 @@
namespace OHOS::DistributedData {
class JsSchema {
public:
JsSchema(napi_env env);
explicit JsSchema(napi_env env);
~JsSchema();
static napi_value Constructor(napi_env env);
@ -59,5 +59,5 @@ private:
uint32_t mode = SCHEMA_MODE_SLOPPY;
uint32_t skip = 0;
};
}
} // namespace OHOS::DistributedData
#endif // OHOS_SCHEMA_H

View File

@ -21,7 +21,7 @@
namespace OHOS::DistributedData {
class JsSingleKVStore : public JsKVStore {
public:
JsSingleKVStore(const std::string& storeId);
explicit JsSingleKVStore(const std::string& storeId);
~JsSingleKVStore() = default;
static napi_value Constructor(napi_env env);
@ -40,5 +40,5 @@ private:
static napi_value SetSyncParam(napi_env env, napi_callback_info info);
static napi_value GetSecurityLevel(napi_env env, napi_callback_info info);
};
}
} // namespace OHOS::DistributedData
#endif // OHOS_SINGLE_KV_STORE_H

View File

@ -173,5 +173,5 @@ private:
TUPLE_SIZE
};
};
}
} // namespace OHOS::DistributedData
#endif // OHOS_JS_UTIL_H

View File

@ -112,5 +112,5 @@ private:
};
static void GenerateOutput(ContextBase* ctxt);
};
}
} // namespace OHOS::DistributedData
#endif // OHOS_NAPI_QUEUE_H

View File

@ -39,5 +39,5 @@ private:
napi_env env_ = nullptr;
uv_loop_s* loop_ = nullptr;
};
}
} // namespace OHOS::DistributedData
#endif // OHOS_UV_QUEUE_H

View File

@ -140,4 +140,4 @@ napi_status InitConstProperties(napi_env env, napi_value exports)
return napi_define_properties(env, exports, count, properties);
}
}
} // namespace OHOS::DistributedData

View File

@ -274,4 +274,4 @@ std::string JsFieldNode::Dump()
};
return jsNode.dump();
}
}
} // namespace OHOS::DistributedData

View File

@ -373,4 +373,4 @@ void JsKVManager::DeathRecipient::OnRemoteDied()
{
AsyncCall();
}
}
} // namespace OHOS::DistributedData

View File

@ -271,4 +271,4 @@ napi_value JsKVStoreResultSet::GetEntry(napi_env env, napi_callback_info info) /
NAPI_ASSERT(env, ctxt->status == napi_ok, "GetEntry failed!");
return ctxt->output;
}
} //
} // namespace OHOS::DistributedData

View File

@ -57,4 +57,4 @@ void JSObserver::AsyncCall(UvQueue::NapiArgsGenerator genArgs)
return callback;
}, genArgs);
}
}
} // namespace OHOS::DistributedData

View File

@ -664,4 +664,4 @@ napi_value JsQuery::GetSqlLike(napi_env env, napi_callback_info info)
JSUtil::SetValue(env, query.ToString(), ctxt->output);
return ctxt->output;
}
} //
} // namespace OHOS::DistributedData

View File

@ -235,4 +235,4 @@ std::string JsSchema::Dump()
};
return js.dump();
}
}
} // namespace OHOS::DistributedData

View File

@ -737,7 +737,7 @@ napi_status JSUtil::GetValue(napi_env env, napi_value in, std::list<DistributedK
napi_status JSUtil::SetValue(napi_env env, const std::list<DistributedKv::Entry>& in, napi_value& out)
{
ZLOGD("napi_value <- std::list<DistributedKv::Entry> %{public}u", static_cast<int>(in.size()));
ZLOGD("napi_value <- std::list<DistributedKv::Entry> %{public}d", static_cast<int>(in.size()));
napi_status status = napi_create_array_with_length(env, in.size(), &out);
CHECK_RETURN(status == napi_ok, "create array failed!", status);
int index = 0;
@ -777,7 +777,7 @@ napi_status JSUtil::GetValue(napi_env env, napi_value in, std::vector<Distribute
napi_status JSUtil::SetValue(napi_env env, const std::vector<DistributedKv::Entry>& in, napi_value& out)
{
ZLOGD("napi_value <- std::vector<DistributedKv::Entry> %{public}u", static_cast<int>(in.size()));
ZLOGD("napi_value <- std::vector<DistributedKv::Entry> %{public}d", static_cast<int>(in.size()));
napi_status status = napi_create_array_with_length(env, in.size(), &out);
CHECK_RETURN(status == napi_ok, "create array failed!", status);
int index = 0;
@ -818,7 +818,7 @@ napi_status JSUtil::GetValue(napi_env env, napi_value in, std::vector<Distribute
napi_status JSUtil::SetValue(napi_env env, const std::vector<DistributedKv::StoreId>& in, napi_value& out)
{
ZLOGD("napi_value <- std::vector<DistributedKv::StoreId> %{public}u", static_cast<int>(in.size()));
ZLOGD("napi_value <- std::vector<DistributedKv::StoreId> %{public}d", static_cast<int>(in.size()));
napi_status status = napi_create_array_with_length(env, in.size(), &out);
CHECK_RETURN((status == napi_ok), "create_array failed!", status);
int index = 0;
@ -995,4 +995,4 @@ bool JSUtil::Equals(napi_env env, napi_value value, napi_ref copy)
napi_strict_equals(env, value, copyValue, &isEquals);
return isEquals;
}
} // OHOS::DistributedData
} // namespace OHOS::DistributedData

View File

@ -79,4 +79,4 @@ napi_env UvQueue::GetEnv()
{
return env_;
}
}
} // namespace OHOS::DistributedData

View File

@ -218,6 +218,6 @@ protected:
// Status of this control operation.
KVSTORE_API virtual Status Control(KvControlCmd cmd, const KvParam &inputParam, KvParam &output) = 0;
};
} // namespace AppDistributedKv
} // namespace DistributedKv
} // namespace OHOS
#endif // SINGLE_KV_STORE_H

View File

@ -30,4 +30,4 @@ std::shared_ptr<BroadcastSender> BroadcastSender::GetInstance()
}
return instance_;
}
}
} // namespace OHOS::DistributedKv

View File

@ -60,4 +60,4 @@ void BroadcastSenderImpl::SendEvent(const EventParams &params)
CommonEventManager::UnSubscribeCommonEvent(subscriberPtr);
ZLOGI("SendEvent result:%{public}d.", result);
}
}
} // namespace OHOS::DistributedKv

View File

@ -26,5 +26,5 @@ private:
static const inline std::string ACTION_NAME = "DistributedDataMgrStarter";
static const inline std::string PKG_NAME = "pkgName";
};
}
} // namespace OHOS::DistributedKv
#endif // BROADCAST_SENDER_IMPL_H

View File

@ -68,6 +68,6 @@ union Head {
HeaderInfo headerInfo;
uint8_t headArray[DataBuffer::HEADER_LEN];
} __attribute__((packed));
}
}
} // namespace AppDistributedKv
} // namespace OHOS
#endif // DISTRIBUTEDDATAMGR_DATA_BUFFER_H

View File

@ -109,5 +109,5 @@ bool DdsTrace::SetBytraceEnable()
ZLOGD("success, current tag is true");
return true;
}
} // namespace OHOS
} // namespace DistributedKv
} // namespace OHOS

View File

@ -54,7 +54,7 @@ HWTEST_F(DistributedataDfxMSTTest, Dfx001, TestSize.Level0)
*/
auto comFault = Reporter::GetInstance()->CommunicationFault();
EXPECT_NE(nullptr, comFault);
struct FaultMsg msg{.faultType= FaultType::SERVICE_FAULT, .moduleName = "comm", .interfaceName = "sendData",
struct FaultMsg msg{.faultType = FaultType::SERVICE_FAULT, .moduleName = "comm", .interfaceName = "sendData",
.errorType = Fault::CF_CREATE_SESSION};
auto repStatus = comFault->Report(msg);
EXPECT_TRUE(repStatus == ReportStatus::SUCCESS);

View File

@ -62,7 +62,7 @@ HWTEST_F(DistributedataDfxUTTest, Dfx001, TestSize.Level0)
*/
auto comFault = Reporter::GetInstance()->CommunicationFault();
EXPECT_NE(nullptr, comFault);
struct FaultMsg msg{.faultType= FaultType::SERVICE_FAULT, .moduleName = "comm", .interfaceName = "sendData",
struct FaultMsg msg{.faultType = FaultType::SERVICE_FAULT, .moduleName = "comm", .interfaceName = "sendData",
.errorType = Fault::CF_CREATE_SESSION};
auto repStatus = comFault->Report(msg);
EXPECT_TRUE(repStatus == ReportStatus::SUCCESS);
@ -97,7 +97,7 @@ HWTEST_F(DistributedataDfxUTTest, Dfx002, TestSize.Level0)
*/
auto dbFault = Reporter::GetInstance()->DatabaseFault();
EXPECT_NE(nullptr, dbFault);
struct FaultMsg msg{.faultType= FaultType::SERVICE_FAULT, .moduleName = "database",
struct FaultMsg msg{.faultType = FaultType::SERVICE_FAULT, .moduleName = "database",
.interfaceName = "getKvStore",
.errorType = Fault::DF_DB_DAMAGE};
auto repStatus = dbFault->Report(msg);

View File

@ -182,4 +182,3 @@ T Constant::TrimCopy(T s)
} // namespace DistributedKv
} // namespace OHOS
#endif // KV_DATASERVICE_CONSTANT_H

View File

@ -51,5 +51,5 @@ private:
std::unique_ptr<std::thread> thread_;
std::condition_variable condition_;
};
} // namespace DistributedKv::OHOS
} // namespace OHOS::DistributedKv
#endif // KV_SCHEDULER_H

View File

@ -37,5 +37,5 @@ private:
static std::mutex mutex_;
static std::shared_ptr<BroadcastSender> instance_;
};
}
} // namespace OHOS::DistributedKv
#endif // BROADCAST_SENDER_H

View File

@ -47,6 +47,6 @@ private:
uint32_t traceCount{ 0 };
bool isSendToHiview{ false };
};
} // namespace OHOS
} // namespace DistributedKv
} // namespace OHOS
#endif

View File

@ -74,5 +74,5 @@ bool MeidaLibChecker::IsValid(pid_t uid, const std::string &bundleName)
return true;
}
}
}
} // namespace DistributedData
} // namespace OHOS

View File

@ -32,7 +32,7 @@ private:
static constexpr pid_t SYSTEM_UID = 10000;
std::map<std::string, std::string> trusts_;
};
}
}
} // namespace DistributedData
} // namespace OHOS
#endif // OHOS_DISTRIBUTED_DATA_SERVICES_DISTRIBUTEDDATASERVICE_ADAPTER_PERMISSION_SRC_MEIDA_LIB_CHECKER_H

View File

@ -41,4 +41,4 @@ AppDistributedKv::ChangeLevelType DeviceChangeListenerImpl::GetChangeLevelType()
{
return AppDistributedKv::ChangeLevelType::MIN;
}
}
} // namespace OHOS::DistributedKv

View File

@ -32,5 +32,5 @@ public:
private:
std::map<IRemoteObject *, sptr<IDeviceStatusChangeListener>> &observers_;
};
}
} // namespace OHOS::DistributedKv
#endif // DEV_DEVICE_CHANGE_LISTENER_IMPL_H

View File

@ -238,4 +238,4 @@ KvStoreResultSetImpl *DeviceKvStoreImpl::CreateResultSet(
{
return new (std::nothrow) DeviceKvStoreResultSetImpl(resultSet, prix);
}
}
} // namespace OHOS::DistributedKv

View File

@ -49,5 +49,5 @@ private:
void DeletePrefixAndSuffix(const Key &in, std::vector<uint8_t> &out);
static std::string localDeviceId_;
};
}
} // namespace OHOS::DistributedKv
#endif // DEVICE_KVSTORE_IMPL_H

View File

@ -81,4 +81,4 @@ void DeviceKvStoreObserverImpl::Transfer(const std::list<DistributedDB::Entry> &
output.push_back(tmpEntry);
}
}
}
} // namespace OHOS::DistributedKv

View File

@ -29,5 +29,5 @@ private:
std::string localDeviceId_;
sptr<IKvStoreObserver> observerProxy_;
};
}
} // namespace OHOS::DistributedKv
#endif // DEVICE_KVSTORE_OBSERVER_IMPL_H

View File

@ -49,4 +49,4 @@ Status DeviceKvStoreResultSetImpl::GetEntry(Entry &entry)
ZLOGD("RS end.");
return Status::SUCCESS;
}
}
} // namespace OHOS::DistributedKv

View File

@ -24,6 +24,6 @@ public:
explicit DeviceKvStoreResultSetImpl(DistributedDB::KvStoreResultSet *resultSet, DistributedDB::Key keyPrefix = {});
Status GetEntry(Entry &entry) override;
};
}
} // namespace OHOS::DistributedKv
#endif // DEVICE_KVSTORE_RESULTSET_IMPL_H

View File

@ -70,5 +70,5 @@ bool KvStoreFlowCtrlManager::IsTokenEnoughSlice(TokenBucket &tokenBucket, uint64
return tokenBucket.leftNumInTokenBucket >= 1;
}
}
}
}
} // namespace DistributedKv
} // namespace OHOS

View File

@ -55,7 +55,7 @@ private:
TokenBucket sustainedTokenBucket_; // token bucket to deal with sustained events.
};
}
}
} // namespace DistributedKv
} // namespace OHOS
#endif // FOUNDATION_KVSTORE_FLOW_CTRL_MANAGER_H

View File

@ -120,4 +120,4 @@ void KvStoreAppAccessor::OnCallback(const std::string &userId, const std::string
ZLOGD("AppId:%s is closed.", appId.c_str());
}
}
}
} // namespace OHOS::DistributedKv

View File

@ -44,5 +44,5 @@ public:
private:
KvStoreAppAccessor();
};
}
} // namespace OHOS::DistributedKv
#endif // KVSTORE_APP_ACCESSOR_H

View File

@ -257,4 +257,4 @@ DBStatus Security::GetDirSecurityOption(const std::string &filePath, SecurityOpt
ZLOGI("the filePath is a directory!");
return DBStatus::NOT_SUPPORT;
}
}
} // namespace OHOS::DistributedKv

View File

@ -22,4 +22,4 @@ Uninstaller &Uninstaller::GetInstance()
static UninstallerImpl uninstaller;
return uninstaller;
}
}
} // namespace OHOS::DistributedKv

View File

@ -30,5 +30,5 @@ public:
KVSTORE_API virtual ~Uninstaller() {};
KVSTORE_API static Uninstaller &GetInstance();
};
}
} // namespace OHOS::DistributedKv
#endif // DISTRIBUTEDDATAMGR_UNINSTALLER_H

View File

@ -124,4 +124,4 @@ Status UninstallerImpl::Init(KvStoreDataService *kvStoreDataService)
th.detach();
return Status::SUCCESS;
}
}
} // namespace OHOS::DistributedKv

View File

@ -42,5 +42,5 @@ public:
private:
std::shared_ptr<UninstallEventSubscriber> subscriber_ {};
};
}
} // namespace OHOS::DistributedKv
#endif // DISTRIBUTEDDATAMGR_UNINSTALLER_IMPL_H

View File

@ -35,5 +35,5 @@ public:
return 0;
}
};
}
} // namespace OHOS::DistributedRdb
#endif

View File

@ -94,5 +94,5 @@ CheckerManager::Checker *CheckerManager::GetChecker(const std::string &checker)
}
return it->second;
}
}
}
} // namespace DistributedData
} // namespace OHOS

View File

@ -89,5 +89,5 @@ bool BundleChecker::IsValid(pid_t uid, const std::string &bundleName)
auto bundleInfo = std::make_unique<BundleInfo>();
return bmsClient.GetBundleInfo(bundle, BundleFlag::GET_BUNDLE_DEFAULT, *bundleInfo, Constants::ANY_USERID);
}
}
}
} // namespace DistributedData
} // namespace OHOS

View File

@ -53,5 +53,5 @@ bool SystemChecker::IsValid(pid_t uid, const std::string &bundleName)
{
return (uid < SYSTEM_UID && uid != CheckerManager::INVALID_UID);
}
}
}
} // namespace DistributedData
} // namespace OHOS

View File

@ -26,5 +26,5 @@ int32_t Event::GetEventId() const
{
return evtId_;
}
}
}
} // namespace DistributedData
} // namespace OHOS

View File

@ -141,6 +141,6 @@ void EventCenter::AsyncQueue::AddHandler(int32_t evtId, std::function<void(const
handlers_[evtId] = std::move(handler);
}
}
}
} // namespace DistributedData
} // namespace OHOS

View File

@ -49,6 +49,6 @@ private:
std::map<std::string, Checker *> checkers_;
ConcurrentMap<std::string, std::function<Checker *()>> getters_;
};
}
}
} // namespace DistributedData
} // namespace OHOS
#endif // OHOS_DISTRIBUTED_DATA_SERVICES_FRAMEWORK_CHECKER_CHECKER_MANAGER_H

View File

@ -31,6 +31,6 @@ private:
static constexpr pid_t SYSTEM_UID = 10000;
std::map<std::string, std::string> trusts_;
};
}
}
} // namespace DistributedData
} // namespace OHOS
#endif // OHOS_DISTRIBUTED_DATA_SERVICES_FRAMEWORK_CHECKER_BUNDLE_CHECKER_H

View File

@ -32,6 +32,6 @@ private:
std::map<std::string, std::string> trusts_;
static SystemChecker instance_;
};
}
}
} // namespace DistributedData
} // namespace OHOS
#endif // OHOS_DISTRIBUTED_DATA_SERVICES_FRAMEWORK_SYSTEM_CHECKER_H

View File

@ -35,6 +35,6 @@ public:
private:
int32_t evtId_;
};
}
}
} // namespace DistributedData
} // namespace OHOS
#endif // OHOS_DISTRIBUTED_DATA_SERVICES_FRAMEWORK_EVENTCENTER_EVENT_H

View File

@ -62,6 +62,6 @@ private:
ConcurrentMap<int32_t, std::list<std::function<void(const Event &)>>> observers_;
static thread_local AsyncQueue *asyncQueue_;
};
}
}
} // namespace DistributedData
} // namespace OHOS
#endif // OHOS_DISTRIBUTED_DATA_SERVICES_FRAMEWORK_EVENTCENTER_EVENT_CENTER_H

View File

@ -27,6 +27,6 @@ struct MetaData final : public Serializable {
bool Marshal(json &node) const override;
bool Unmarshal(const json &node) override;
};
}
}
} // namespace DistributedData
} // namespace OHOS
#endif // OHOS_DISTRIBUTED_DATA_SERVICES_FRAMEWORK_METADATA_META_DATA_H

View File

@ -27,6 +27,6 @@ struct SecretKeyMetaData final : public Serializable {
API_EXPORT bool Marshal(json &node) const override;
API_EXPORT bool Unmarshal(const json &node) override;
};
}
}
} // namespace DistributedData
} // namespace OHOS
#endif // OHOS_DISTRIBUTED_DATA_SERVICES_FRAMEWORK_METADATA_SECRET_KEY_META_DATA_H

View File

@ -30,7 +30,7 @@ namespace DistributedData {
struct Serializable {
public:
using json = nlohmann::json;
using size_type= nlohmann::json::size_type;
using size_type = nlohmann::json::size_type;
using error_handler_t = nlohmann::detail::error_handler_t;
API_EXPORT json Marshall() const;
template<typename T>
@ -112,6 +112,6 @@ protected:
API_EXPORT static const json &GetSubNode(const json &node, const std::string &name);
};
}
}
} // namespace DistributedData
} // namespace OHOS
#endif // OHOS_DISTRIBUTED_DATA_FRAMEWORKS_COMMON_SERIALIZABLE_H

View File

@ -23,6 +23,6 @@ class Anonymous {
public:
API_EXPORT static std::string Change(const std::string &name);
};
}
}
} // namespace DistributedData
} // namespace OHOS
#endif // OHOS_DISTRIBUTED_DATA_SERVICES_FRAMEWORK_UTILS_ANONYMOUS_H

View File

@ -44,5 +44,5 @@ private:
int interval_ = 0;
int value_ = 0;
};
}
} // namespace OHOS::DistributedData
#endif // OHOS_DISTRIBUTED_DATA_SERVICES_FRAMEWORK_UTILS_BLOCK_INTEGER_H

View File

@ -182,4 +182,3 @@ T Constant::TrimCopy(T s)
} // namespace DistributedKv
} // namespace OHOS
#endif // KV_DATASERVICE_CONSTANT_H

View File

@ -26,6 +26,6 @@ public:
API_EXPORT static std::string Sha256(const void *data, size_t size, bool isUpper = false);
API_EXPORT static std::vector<uint8_t> Random(int32_t len);
};
}
}
} // namespace DistributedData
} // namespace OHOS
#endif // OHOS_DISTRIBUTED_DATA_SERVICES_FRAMEWORK_UTILS_CRYPTO_H

View File

@ -30,5 +30,5 @@ bool MetaData::Unmarshal(const json &node)
GetValue(node, GET_NAME(secretKeyMetaData), secretKeyMetaData);
return true;
}
}
}
} // namespace DistributedData
} // namespace OHOS

View File

@ -36,5 +36,5 @@ bool SecretKeyMetaData::Unmarshal(const json &node)
GetValue(node, GET_NAME(kvStoreType), kvStoreType);
return true;
}
}
}
} // namespace DistributedData
} // namespace OHOS

View File

@ -33,5 +33,5 @@ std::string Anonymous::Change(const std::string &name)
return (name.substr(0, HEAD_SIZE) + REPLACE_CHAIN + name.substr(name.length() - END_SIZE, END_SIZE));
}
}
}
} // namespace DistributedData
} // namespace OHOS

View File

@ -37,4 +37,4 @@ BlockInteger &BlockInteger::operator=(int value)
value_ = value;
return *this;
}
}
} // namespace OHOS::DistributedData

View File

@ -53,5 +53,5 @@ std::string Crypto::Sha256(const void *data, size_t size, bool isUpper)
hash[SHA256_DIGEST_LENGTH * 2] = 0;
return reinterpret_cast<char *>(hash);
}
}
}
} // namespace DistributedData
} // namespace OHOS

View File

@ -31,6 +31,6 @@ private:
static constexpr const char *DEFAULT_LABEL = "distributeddata";
using Constructor = void(*)(const char *);
};
}
}
} // namespace DistributedData
} // namespace OHOS
#endif // OHOS_DISTRIBUTED_DATA_SERVICES_BOOTSTRAP_BOOTSTRAP_H

View File

@ -37,6 +37,6 @@ private:
GlobalConfig config_;
bool isInited = false;
};
}
}
} // namespace DistributedData
} // namespace OHOS
#endif // OHOS_DISTRIBUTED_DATA_SERVICES_CONFIG_CONFIG_FACTORY_H

Some files were not shown because too many files have changed in this diff Show More