diff --git a/frameworks/core/include/common_event_proxy.h b/frameworks/core/include/common_event_proxy.h index 1cf916088f4684691811bfc4652dfe921630aa8f..0934b2318d2e62b34a40783fe4dcb5c1955599f9 100644 --- a/frameworks/core/include/common_event_proxy.h +++ b/frameworks/core/include/common_event_proxy.h @@ -31,7 +31,7 @@ public: virtual bool PublishCommonEvent(const CommonEventData &event, const CommonEventPublishInfo &publishinfo, const sptr &commonEventListener, const uid_t &uid) override; virtual bool SubscribeCommonEvent( - const CommonEventSubscribeInfo &subscriberInfo, const sptr &commonEventListener) override; + const CommonEventSubscribeInfo &subscribeInfo, const sptr &commonEventListener) override; virtual bool UnsubscribeCommonEvent(const sptr &commonEventListener) override; virtual bool GetStickyCommonEvent(const std::string &event, CommonEventData &eventData) override; virtual bool DumpState(const std::string &event, std::vector &state) override; diff --git a/frameworks/core/include/common_event_stub.h b/frameworks/core/include/common_event_stub.h index 0fdafbf27f362f65b0d306159313526dd360b10c..c0c65b7467244b52f3a2b8d24f5a24a024753801 100644 --- a/frameworks/core/include/common_event_stub.h +++ b/frameworks/core/include/common_event_stub.h @@ -37,7 +37,7 @@ public: virtual bool PublishCommonEvent(const CommonEventData &event, const CommonEventPublishInfo &publishinfo, const sptr &commonEventListener, const uid_t &uid) override; virtual bool SubscribeCommonEvent( - const CommonEventSubscribeInfo &subscriberInfo, const sptr &commonEventListener) override; + const CommonEventSubscribeInfo &subscribeInfo, const sptr &commonEventListener) override; virtual bool UnsubscribeCommonEvent(const sptr &commonEventListener) override; virtual bool GetStickyCommonEvent(const std::string &event, CommonEventData &eventData) override; virtual bool DumpState(const std::string &event, std::vector &state) override; diff --git a/frameworks/core/include/icommon_event.h b/frameworks/core/include/icommon_event.h index 140838fe8e46d2dc9ad8ccbc129c1c66a0f09126..96f47711aabd4e6c26c81d789fe4ac5ece584c50 100644 --- a/frameworks/core/include/icommon_event.h +++ b/frameworks/core/include/icommon_event.h @@ -33,7 +33,7 @@ public: virtual bool PublishCommonEvent(const CommonEventData &event, const CommonEventPublishInfo &publishinfo, const sptr &commonEventListener, const uid_t &uid) = 0; virtual bool SubscribeCommonEvent( - const CommonEventSubscribeInfo &subscriberInfo, const sptr &commonEventListener) = 0; + const CommonEventSubscribeInfo &subscribeInfo, const sptr &commonEventListener) = 0; virtual bool UnsubscribeCommonEvent(const sptr &commonEventListener) = 0; virtual bool GetStickyCommonEvent(const std::string &event, CommonEventData &eventData) = 0; virtual bool DumpState(const std::string &event, std::vector &state) = 0; diff --git a/frameworks/core/src/common_event_proxy.cpp b/frameworks/core/src/common_event_proxy.cpp index f3e3b68fc2237b01a0df5dd1651015811150b885..55d46f35e887f21b18837a4897b187f509c43567 100644 --- a/frameworks/core/src/common_event_proxy.cpp +++ b/frameworks/core/src/common_event_proxy.cpp @@ -101,15 +101,15 @@ bool CommonEventProxy::PublishCommonEvent(const CommonEventData &event, const Co } bool CommonEventProxy::SubscribeCommonEvent( - const CommonEventSubscribeInfo &subscriberInfo, const sptr &commonEventListener) + const CommonEventSubscribeInfo &subscribeInfo, const sptr &commonEventListener) { EVENT_LOGD("start"); MessageParcel data; MessageParcel reply; - if (!data.WriteParcelable(&subscriberInfo)) { - EVENT_LOGE("Failed to write parcelable subscriberInfo"); + if (!data.WriteParcelable(&subscribeInfo)) { + EVENT_LOGE("Failed to write parcelable subscribeInfo"); return false; } if (!data.WriteParcelable(commonEventListener)) { diff --git a/frameworks/core/src/common_event_stub.cpp b/frameworks/core/src/common_event_stub.cpp index 843fbb59d73938d8ce16f37a1170ae8bfcdce01c..7ebf5337cfe7b467a7afb6d0d59e7c59ef222e88 100644 --- a/frameworks/core/src/common_event_stub.cpp +++ b/frameworks/core/src/common_event_stub.cpp @@ -71,9 +71,9 @@ int CommonEventStub::OnRemoteRequest(uint32_t code, MessageParcel &data, Message } case static_cast(ICommonEvent::Message::CES_SUBSCRIBE_COMMON_EVENT): { - std::unique_ptr subscriberInfo(data.ReadParcelable()); + std::unique_ptr subscribeInfo(data.ReadParcelable()); sptr commonEventListener = data.ReadParcelable(); - if (!subscriberInfo) { + if (!subscribeInfo) { EVENT_LOGE("Failed to ReadParcelable"); return ERR_INVALID_VALUE; } @@ -81,7 +81,7 @@ int CommonEventStub::OnRemoteRequest(uint32_t code, MessageParcel &data, Message EVENT_LOGE("Failed to ReadParcelable"); return ERR_INVALID_VALUE; } - bool ret = SubscribeCommonEvent(*subscriberInfo, commonEventListener); + bool ret = SubscribeCommonEvent(*subscribeInfo, commonEventListener); if (!reply.WriteBool(ret)) { EVENT_LOGE("Failed to write reply"); return ERR_INVALID_VALUE; @@ -191,7 +191,7 @@ bool CommonEventStub::PublishCommonEvent(const CommonEventData &event, const Com } bool CommonEventStub::SubscribeCommonEvent( - const CommonEventSubscribeInfo &subscriberInfo, const sptr &commonEventListener) + const CommonEventSubscribeInfo &subscribeInfo, const sptr &commonEventListener) { EVENT_LOGD("called"); diff --git a/frameworks/native/test/unittest/common_event_subscribe_test.cpp b/frameworks/native/test/unittest/common_event_subscribe_test.cpp index 9a1931c9e0c18e85ef987ea3fead969d3a11257e..0aa907e22d15e73cf12dcb61ec3bd21814da34bb 100644 --- a/frameworks/native/test/unittest/common_event_subscribe_test.cpp +++ b/frameworks/native/test/unittest/common_event_subscribe_test.cpp @@ -102,7 +102,7 @@ public: } virtual bool SubscribeCommonEvent( - const CommonEventSubscribeInfo &subscriberInfo, const OHOS::sptr &commonEventListener) + const CommonEventSubscribeInfo &subscribeInfo, const OHOS::sptr &commonEventListener) { return false; } @@ -154,8 +154,8 @@ HWTEST_F(CommonEventSubscribeTest, CommonEventSubscribe_001, TestSize.Level1) /* Subscribe */ MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENT); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); bool subscribeResult = CommonEventManager::SubscribeCommonEvent(subscriber); EXPECT_EQ(true, subscribeResult); @@ -214,9 +214,9 @@ HWTEST_F(CommonEventSubscribeTest, CommonEventSubscribe_002, TestSize.Level1) { MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENT); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - std::shared_ptr subscribera = std::make_shared(subscriberInfo); - std::shared_ptr subscriberb = std::make_shared(subscriberInfo); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + std::shared_ptr subscribera = std::make_shared(subscribeInfo); + std::shared_ptr subscriberb = std::make_shared(subscribeInfo); bool subscribeResulta = CommonEventManager::SubscribeCommonEvent(subscribera); @@ -256,8 +256,8 @@ HWTEST_F(CommonEventSubscribeTest, CommonEventSubscribe_003, TestSize.Level1) HWTEST_F(CommonEventSubscribeTest, CommonEventSubscribe_004, TestSize.Level1) { MatchingSkills matchingSkills; - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); bool subscribeResult = CommonEventManager::SubscribeCommonEvent(subscriber); @@ -277,8 +277,8 @@ HWTEST_F(CommonEventSubscribeTest, CommonEventSubscribe_005, TestSize.Level1) { MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENT); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); CommonEventManager::SubscribeCommonEvent(subscriber); @@ -322,11 +322,11 @@ HWTEST_F(CommonEventSubscribeTest, CommonEventSubscribe_007, TestSize.Level1) CommonEventStubTest CommonEventStubTest; MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENT); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); OHOS::MessageParcel data, reply; OHOS::MessageOption option; - data.WriteParcelable(&subscriberInfo); + data.WriteParcelable(&subscribeInfo); int subscribeResult = CommonEventStubTest.OnRemoteRequest( static_cast(ICommonEvent::Message::CES_SUBSCRIBE_COMMON_EVENT), data, reply, option); @@ -348,11 +348,11 @@ HWTEST_F(CommonEventSubscribeTest, CommonEventSubscribe_008, TestSize.Level1) CommonEventStubTest CommonEventStubTest; MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENT); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); OHOS::MessageParcel data, reply; OHOS::MessageOption option; - data.WriteParcelable(&subscriberInfo); + data.WriteParcelable(&subscribeInfo); int subscribeResult = CommonEventStubTest.OnRemoteRequest(static_cast(-1), data, reply, option); @@ -373,13 +373,13 @@ HWTEST_F(CommonEventSubscribeTest, CommonEventSubscribe_009, TestSize.Level1) { MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENT); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); std::shared_ptr innerCommonEventManager = std::make_shared(); OHOS::sptr sp(nullptr); struct tm curTime; - EXPECT_EQ(false, innerCommonEventManager->SubscribeCommonEvent(subscriberInfo, sp, curTime, 0, 0, "")); + EXPECT_EQ(false, innerCommonEventManager->SubscribeCommonEvent(subscribeInfo, sp, curTime, 0, 0, "")); } /* @@ -396,8 +396,8 @@ HWTEST_F(CommonEventSubscribeTest, CommonEventSubscribe_010, TestSize.Level1) { MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENT); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); OHOS::sptr commonEventListener = new CommonEventListener(subscriber); std::shared_ptr innerCommonEventManager = std::make_shared(); OHOS::sptr commonEventListenerPtr(commonEventListener); @@ -424,9 +424,9 @@ HWTEST_F(CommonEventSubscribeTest, CommonEventSubscribe_011, TestSize.Level1) { MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENT); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); std::shared_ptr commonEventSubscribeInfo = - std::make_shared(subscriberInfo); + std::make_shared(subscribeInfo); struct tm curTime{0}; @@ -449,10 +449,10 @@ HWTEST_F(CommonEventSubscribeTest, CommonEventSubscribe_011, TestSize.Level1) HWTEST_F(CommonEventSubscribeTest, CommonEventSubscribe_012, TestSize.Level1) { MatchingSkills matchingSkills; - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); std::shared_ptr commonEventSubscribeInfo = - std::make_shared(subscriberInfo); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::make_shared(subscribeInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); OHOS::sptr commonEventListener = new CommonEventListener(subscriber); std::shared_ptr innerCommonEventManager = std::make_shared(); OHOS::sptr commonEventListenerSp(commonEventListener); @@ -495,10 +495,10 @@ HWTEST_F(CommonEventSubscribeTest, CommonEventSubscribe_013, TestSize.Level1) HWTEST_F(CommonEventSubscribeTest, CommonEventSubscribe_014, TestSize.Level1) { MatchingSkills matchingSkills; - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); std::shared_ptr commonEventSubscribeInfo = - std::make_shared(subscriberInfo); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::make_shared(subscribeInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); CommonEventListener commonEventListener(subscriber); commonEventListener.runner_ = nullptr; @@ -518,10 +518,10 @@ HWTEST_F(CommonEventSubscribeTest, CommonEventSubscribe_014, TestSize.Level1) HWTEST_F(CommonEventSubscribeTest, CommonEventSubscribe_015, TestSize.Level1) { MatchingSkills matchingSkills; - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); std::shared_ptr commonEventSubscribeInfo = - std::make_shared(subscriberInfo); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::make_shared(subscribeInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); CommonEventListener commonEventListener(subscriber); commonEventListener.handler_ = nullptr; diff --git a/frameworks/native/test/unittest/common_event_unsubscribe_test.cpp b/frameworks/native/test/unittest/common_event_unsubscribe_test.cpp index 14a41bd236820f2e9b481757d9e7e33005c79466..d9a8771926f91cec0d3f0cc4057b9d3ec28768d8 100644 --- a/frameworks/native/test/unittest/common_event_unsubscribe_test.cpp +++ b/frameworks/native/test/unittest/common_event_unsubscribe_test.cpp @@ -76,7 +76,7 @@ public: } virtual bool SubscribeCommonEvent( - const CommonEventSubscribeInfo &subscriberInfo, const OHOS::sptr &commonEventListener) + const CommonEventSubscribeInfo &subscribeInfo, const OHOS::sptr &commonEventListener) { return false; } @@ -151,8 +151,8 @@ void CommonEventUnSubscribeTest::SetMatchingSkillsWithScheme(const std::string & HWTEST_F(CommonEventUnSubscribeTest, UnSubscribe_001, TestSize.Level1) { CommonEventUnSubscribeTest::SetMatchingSkillsWithEvent("event"); - CommonEventSubscribeInfo subscriberInfo(matchingSkills_); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + CommonEventSubscribeInfo subscribeInfo(matchingSkills_); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); std::shared_ptr helper; EXPECT_EQ(true, helper->UnSubscribeCommonEvent(subscriber)); } @@ -168,8 +168,8 @@ HWTEST_F(CommonEventUnSubscribeTest, UnSubscribe_001, TestSize.Level1) HWTEST_F(CommonEventUnSubscribeTest, UnSubscribe_002, TestSize.Level1) { CommonEventUnSubscribeTest::SetMatchingSkillsWithEvent("event"); - CommonEventSubscribeInfo subscriberInfo(matchingSkills_); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + CommonEventSubscribeInfo subscribeInfo(matchingSkills_); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); EXPECT_EQ(true, DelayedSingleton::GetInstance()->UnSubscribeCommonEvent(subscriber)); } @@ -184,8 +184,8 @@ HWTEST_F(CommonEventUnSubscribeTest, UnSubscribe_002, TestSize.Level1) HWTEST_F(CommonEventUnSubscribeTest, UnSubscribe_003, TestSize.Level1) { CommonEventUnSubscribeTest::SetMatchingSkillsWithEvent("event"); - CommonEventSubscribeInfo subscriberInfo(matchingSkills_); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + CommonEventSubscribeInfo subscribeInfo(matchingSkills_); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); DelayedSingleton::GetInstance()->SubscribeCommonEvent(subscriber); EXPECT_EQ(true, DelayedSingleton::GetInstance()->UnSubscribeCommonEvent(subscriber)); } @@ -201,8 +201,8 @@ HWTEST_F(CommonEventUnSubscribeTest, UnSubscribe_003, TestSize.Level1) HWTEST_F(CommonEventUnSubscribeTest, UnSubscribe_004, TestSize.Level1) { CommonEventUnSubscribeTest::SetMatchingSkillsWithEvent("event"); - CommonEventSubscribeInfo subscriberInfo(matchingSkills_); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + CommonEventSubscribeInfo subscribeInfo(matchingSkills_); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); sptr commonEventListener = new CommonEventListener(subscriber); std::shared_ptr innerCommonEventManager = std::make_shared(); EXPECT_EQ(true, innerCommonEventManager->UnsubscribeCommonEvent(commonEventListener)); @@ -219,8 +219,8 @@ HWTEST_F(CommonEventUnSubscribeTest, UnSubscribe_004, TestSize.Level1) HWTEST_F(CommonEventUnSubscribeTest, UnSubscribe_005, TestSize.Level1) { CommonEventUnSubscribeTest::SetMatchingSkillsWithEvent("event"); - CommonEventSubscribeInfo subscriberInfo(matchingSkills_); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + CommonEventSubscribeInfo subscribeInfo(matchingSkills_); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); sptr commonEventListener = new CommonEventListener(subscriber); EXPECT_EQ( ERR_OK, DelayedSingleton::GetInstance()->RemoveSubscriber(commonEventListener)); @@ -321,9 +321,9 @@ HWTEST_F(CommonEventUnSubscribeTest, UnSubscribe_010, TestSize.Level1) HWTEST_F(CommonEventUnSubscribeTest, UnSubscribe_011, TestSize.Level1) { CommonEventUnSubscribeTest::SetMatchingSkillsWithEvent("event"); - CommonEventSubscribeInfo subscriberInfo(matchingSkills_); + CommonEventSubscribeInfo subscribeInfo(matchingSkills_); // make a subcriber object - std::shared_ptr subscriberTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberTest = std::make_shared(subscribeInfo); OHOS::sptr commonEventListener = new CommonEventListener(subscriberTest); DelayedSingleton::GetInstance()->death_ = nullptr; EXPECT_EQ( diff --git a/interfaces/innerkits/native/include/common_event_subscriber.h b/interfaces/innerkits/native/include/common_event_subscriber.h index c51d11ef44591496b2ad309da25c16ec0b4f5cce..0a74a0d1a3992ebe61c17e2418177e07f0747190 100644 --- a/interfaces/innerkits/native/include/common_event_subscriber.h +++ b/interfaces/innerkits/native/include/common_event_subscriber.h @@ -34,7 +34,7 @@ public: * A constructor used to create a CommonEventSubscriber instance with the * subscribeInfo parameter passed. * - * @param subscriberInfo the subscriberInfo + * @param subscribeInfo the subscribeInfo */ explicit CommonEventSubscriber(const CommonEventSubscribeInfo &subscribeInfo); diff --git a/interfaces/kits/js/@ohos.commonEvent.d.ts b/interfaces/kits/js/@ohos.commonEvent.d.ts index 2c57934e66e09e0cc8f3ede3ee1d5e9122e5a272..e10a421e8e7266d8dddac51043eccc0b949d7e44 100644 --- a/interfaces/kits/js/@ohos.commonEvent.d.ts +++ b/interfaces/kits/js/@ohos.commonEvent.d.ts @@ -47,7 +47,7 @@ declare namespace commonEvent { /** - * create the CommonEventSubscriber for the SubscriberInfo. + * create the CommonEventSubscriber for the SubscribeInfo. * * @since 7 * @param subscribeInfo Indicate the information of the subscriber. @@ -57,7 +57,7 @@ declare namespace commonEvent { function createSubscriber(subscribeInfo: CommonEventSubscribeInfo, callback: AsyncCallback): void; /** - * create the CommonEventSubscriber for the SubscriberInfo. + * create the CommonEventSubscriber for the SubscribeInfo. * * @since 7 * @param subscribeInfo Indicate the information of the subscriber. diff --git a/interfaces/kits/napi/common_event/include/common_event.h b/interfaces/kits/napi/common_event/include/common_event.h index a8ceb2a0bb4bbac09a0331b8021d5dcda5ebb0e6..b1ee8b0143f6396c56fc3a701f1f2bdcc949d29c 100644 --- a/interfaces/kits/napi/common_event/include/common_event.h +++ b/interfaces/kits/napi/common_event/include/common_event.h @@ -190,7 +190,7 @@ struct AsyncCallbackInfoCreate { napi_async_work asyncWork; napi_ref callback = nullptr; napi_deferred deferred = nullptr; - napi_ref subscriberInfo = nullptr; + napi_ref subscribeInfo = nullptr; bool isCallback = false; napi_value result = nullptr; }; diff --git a/interfaces/kits/napi/common_event/src/common_event.cpp b/interfaces/kits/napi/common_event/src/common_event.cpp index f2a36bb76286b2f7fdf2b665dcbb544ba53bec30..d6909589c9745145d416df86dce3281273f5fb87 100644 --- a/interfaces/kits/napi/common_event/src/common_event.cpp +++ b/interfaces/kits/napi/common_event/src/common_event.cpp @@ -279,7 +279,7 @@ napi_value CreateSubscriber(napi_env env, napi_callback_info info) } AsyncCallbackInfoCreate *asyncCallbackInfo = - new (std::nothrow) AsyncCallbackInfoCreate {.env = env, .asyncWork = nullptr, .subscriberInfo = nullptr}; + new (std::nothrow) AsyncCallbackInfoCreate {.env = env, .asyncWork = nullptr, .subscribeInfo = nullptr}; if (asyncCallbackInfo == nullptr) { EVENT_LOGE("asyncCallbackInfo is null"); return NapiGetNull(env); @@ -288,7 +288,7 @@ napi_value CreateSubscriber(napi_env env, napi_callback_info info) PaddingAsyncCallbackInfoCreateSubscriber(env, argc, asyncCallbackInfo, callback, promise); - napi_create_reference(env, argv[0], 1, &asyncCallbackInfo->subscriberInfo); + napi_create_reference(env, argv[0], 1, &asyncCallbackInfo->subscribeInfo); napi_value resourceName = nullptr; napi_create_string_latin1(env, "CreateSubscriber", NAPI_AUTO_LENGTH, &resourceName); @@ -303,11 +303,11 @@ napi_value CreateSubscriber(napi_env env, napi_callback_info info) AsyncCallbackInfoCreate *asyncCallbackInfo = (AsyncCallbackInfoCreate *)data; napi_value constructor = nullptr; - napi_value subscriberInfoRefValue = nullptr; - napi_get_reference_value(env, asyncCallbackInfo->subscriberInfo, &subscriberInfoRefValue); + napi_value subscribeInfoRefValue = nullptr; + napi_get_reference_value(env, asyncCallbackInfo->subscribeInfo, &subscribeInfoRefValue); napi_get_reference_value(env, g_CommonEventSubscriber, &constructor); - napi_new_instance(env, constructor, 1, &subscriberInfoRefValue, &asyncCallbackInfo->result); + napi_new_instance(env, constructor, 1, &subscribeInfoRefValue, &asyncCallbackInfo->result); ReturnCallbackPromise(env, asyncCallbackInfo->isCallback, @@ -318,8 +318,8 @@ napi_value CreateSubscriber(napi_env env, napi_callback_info info) if (asyncCallbackInfo->callback != nullptr) { napi_delete_reference(env, asyncCallbackInfo->callback); } - if (asyncCallbackInfo->subscriberInfo != nullptr) { - napi_delete_reference(env, asyncCallbackInfo->subscriberInfo); + if (asyncCallbackInfo->subscribeInfo != nullptr) { + napi_delete_reference(env, asyncCallbackInfo->subscribeInfo); } napi_delete_async_work(env, asyncCallbackInfo->asyncWork); if (asyncCallbackInfo) { @@ -2321,7 +2321,7 @@ napi_value GetEventsByCreateSubscriber(const napi_env &env, const napi_value &ar EVENT_LOGI("GetEventsByCreateSubscriber str = %{public}s", str); events.push_back(str); } - + return NapiGetNull(env); } @@ -2432,20 +2432,20 @@ napi_value CommonEventSubscriberConstructor(napi_env env, napi_callback_info inf matchingSkills.AddEvent(event); } - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); if (hasPermission) { - subscriberInfo.SetPermission(permission); + subscribeInfo.SetPermission(permission); } if (hasPublisherDeviceId) { - subscriberInfo.SetDeviceId(publisherDeviceId); + subscribeInfo.SetDeviceId(publisherDeviceId); } if (hasPriority) { - subscriberInfo.SetPriority(priority); + subscribeInfo.SetPriority(priority); } - SubscriberInstance *objectInfo = new (std::nothrow) SubscriberInstance(subscriberInfo); + SubscriberInstance *objectInfo = new (std::nothrow) SubscriberInstance(subscribeInfo); if (objectInfo == nullptr) { EVENT_LOGE("objectInfo is null"); return NapiGetNull(env); diff --git a/services/ces/include/common_event_manager_service.h b/services/ces/include/common_event_manager_service.h index 4d5f856037f00d099ae6fcf8881f3629a83c6c90..9abcf863dbc91d88a8325de6d104b95b259ef69a 100644 --- a/services/ces/include/common_event_manager_service.h +++ b/services/ces/include/common_event_manager_service.h @@ -41,7 +41,7 @@ public: const sptr &commonEventListener, const uid_t &uid) override; virtual bool SubscribeCommonEvent( - const CommonEventSubscribeInfo &subscriberInfo, const sptr &commonEventListener) override; + const CommonEventSubscribeInfo &subscribeInfo, const sptr &commonEventListener) override; virtual bool UnsubscribeCommonEvent(const sptr &commonEventListener) override; diff --git a/services/ces/include/common_event_sticky_manager.h b/services/ces/include/common_event_sticky_manager.h index 3a0e34bc75d26cfdad653f4a9ed159583762c4d9..c3a842e175332fabce19006790b20a9db14c32dd 100644 --- a/services/ces/include/common_event_sticky_manager.h +++ b/services/ces/include/common_event_sticky_manager.h @@ -34,7 +34,7 @@ public: using CommonEventPublishInfoPtr = std::shared_ptr; using SubscribeInfoPtr = std::shared_ptr; - int FindStickyEvents(const SubscribeInfoPtr &subscriberInfo, std::vector &commonEventRecords); + int FindStickyEvents(const SubscribeInfoPtr &subscribeInfo, std::vector &commonEventRecords); bool GetStickyCommonEvent(const std::string &event, CommonEventData &eventData); diff --git a/services/ces/include/common_event_subscriber_manager.h b/services/ces/include/common_event_subscriber_manager.h index 8a669e1de06b8246c2bc7c353fd2b7ad5c4d6e19..85cf92175397e501da871e8e40b22ea628229403 100644 --- a/services/ces/include/common_event_subscriber_manager.h +++ b/services/ces/include/common_event_subscriber_manager.h @@ -32,7 +32,7 @@ namespace OHOS { namespace EventFwk { struct EventSubscriberRecord { - std::shared_ptr eventSubscriberInfo; + std::shared_ptr eventSubscribeInfo; sptr commonEventListener; struct tm recordTime; pid_t pid; @@ -42,7 +42,7 @@ struct EventSubscriberRecord { int64_t freezeTime; EventSubscriberRecord() - : eventSubscriberInfo(nullptr), commonEventListener(nullptr), pid(0), uid(0), isFreeze(false), freezeTime(0) + : eventSubscribeInfo(nullptr), commonEventListener(nullptr), pid(0), uid(0), isFreeze(false), freezeTime(0) {} }; @@ -56,7 +56,7 @@ struct FrozenEventRecord { inline bool operator<(const std::shared_ptr &a, const std::shared_ptr &b) { - return a->eventSubscriberInfo->GetPriority() > b->eventSubscriberInfo->GetPriority(); + return a->eventSubscribeInfo->GetPriority() > b->eventSubscribeInfo->GetPriority(); } using SubscriberRecordPtr = std::shared_ptr; @@ -69,7 +69,7 @@ public: virtual ~CommonEventSubscriberManager() override; - int InsertSubscriber(const SubscribeInfoPtr &eventSubscriberInfo, const sptr &commonEventListener, + int InsertSubscriber(const SubscribeInfoPtr &eventSubscribeInfo, const sptr &commonEventListener, const struct tm &recordTime, const pid_t &pid, const uid_t &uid, const std::string &bundleName); int RemoveSubscriber(const sptr &commonEventListener); diff --git a/services/ces/include/inner_common_event_manager.h b/services/ces/include/inner_common_event_manager.h index d26801db6cb5de88baef107053fc25c38a5936ee..1b1eecf9c638553cbbc010d995a5f0f5dc087122 100644 --- a/services/ces/include/inner_common_event_manager.h +++ b/services/ces/include/inner_common_event_manager.h @@ -31,7 +31,7 @@ public: const sptr &commonEventListener, const struct tm &recordTime, const pid_t &pid, const uid_t &uid, const std::string &bundleName); - bool SubscribeCommonEvent(const CommonEventSubscribeInfo &subscriberInfo, + bool SubscribeCommonEvent(const CommonEventSubscribeInfo &subscribeInfo, const sptr &commonEventListener, const struct tm &recordTime, const pid_t &pid, const uid_t &uid, const std::string &bundleName); diff --git a/services/ces/src/common_event_control_manager.cpp b/services/ces/src/common_event_control_manager.cpp index 284953afa8648668d25546f5575d552a4d2d306e..f0307fe70d2888a8813e9d5d97d0ce8e6abb2930 100644 --- a/services/ces/src/common_event_control_manager.cpp +++ b/services/ces/src/common_event_control_manager.cpp @@ -320,9 +320,9 @@ void CommonEventControlManager::EnqueueHistoryEventRecord(const std::shared_ptr< HistorySubscriberRecord receiver; receiver.recordTime = vec->recordTime; receiver.bundleName = vec->bundleName; - receiver.priority = vec->eventSubscriberInfo->GetPriority(); - receiver.permission = vec->eventSubscriberInfo->GetPermission(); - receiver.deviceId = vec->eventSubscriberInfo->GetDeviceId(); + receiver.priority = vec->eventSubscribeInfo->GetPriority(); + receiver.permission = vec->eventSubscribeInfo->GetPermission(); + receiver.deviceId = vec->eventSubscribeInfo->GetDeviceId(); receiver.isFreeze = vec->isFreeze; receiver.freezeTime = vec->freezeTime; record.receivers.emplace_back(receiver); @@ -651,7 +651,7 @@ int CommonEventControlManager::CheckPermission( bool skip = false; bool ret = false; - std::string subscriberRequiredPermission = subscriberRecord.eventSubscriberInfo->GetPermission(); + std::string subscriberRequiredPermission = subscriberRecord.eventSubscribeInfo->GetPermission(); std::vector publisherRequiredPermissions = eventRecord.publishInfo->GetSubscriberPermissions(); Permission per = DelayedSingleton::GetInstance()->GetEventPermission( diff --git a/services/ces/src/common_event_manager_service.cpp b/services/ces/src/common_event_manager_service.cpp index 24c7165d2f20fee0c6281178966699aa448375bb..db1f108ffda45ab2dcd2baf2fafd51040b6d3429 100644 --- a/services/ces/src/common_event_manager_service.cpp +++ b/services/ces/src/common_event_manager_service.cpp @@ -186,7 +186,7 @@ bool CommonEventManagerService::PublishCommonEventDetailed(const CommonEventData } bool CommonEventManagerService::SubscribeCommonEvent( - const CommonEventSubscribeInfo &subscriberInfo, const sptr &commonEventListener) + const CommonEventSubscribeInfo &subscribeInfo, const sptr &commonEventListener) { EVENT_LOGI("enter"); @@ -205,7 +205,7 @@ bool CommonEventManagerService::SubscribeCommonEvent( std::function SubscribeCommonEventFunc = std::bind(&InnerCommonEventManager::SubscribeCommonEvent, innerCommonEventManager_, - subscriberInfo, + subscribeInfo, commonEventListener, recordTime, callingPid, diff --git a/services/ces/src/common_event_sticky_manager.cpp b/services/ces/src/common_event_sticky_manager.cpp index ad4752960f3eb6dbb1a1ff9608486b8f36c923bb..8a85b25782ad3364d31a3ebae10bee7667194811 100644 --- a/services/ces/src/common_event_sticky_manager.cpp +++ b/services/ces/src/common_event_sticky_manager.cpp @@ -20,16 +20,16 @@ namespace OHOS { namespace EventFwk { int CommonEventStickyManager::FindStickyEvents( - const SubscribeInfoPtr &subscriberInfo, std::vector &commonEventRecords) + const SubscribeInfoPtr &subscribeInfo, std::vector &commonEventRecords) { EVENT_LOGI("enter"); - if (subscriberInfo == nullptr) { - EVENT_LOGE("subscriberInfo is null"); + if (subscribeInfo == nullptr) { + EVENT_LOGE("subscribeInfo is null"); return ERR_INVALID_VALUE; } - auto events = subscriberInfo->GetMatchingSkills().GetEvents(); + auto events = subscribeInfo->GetMatchingSkills().GetEvents(); if (events.size() == 0) { EVENT_LOGW("No subscribed events"); return ERR_INVALID_VALUE; diff --git a/services/ces/src/common_event_subscriber_manager.cpp b/services/ces/src/common_event_subscriber_manager.cpp index 0b575f5fef6c955ccff4e73ea87dd68eb1bd8ad7..06fb1ea855bd6c31f63bd3c0a7625c344eb518cd 100644 --- a/services/ces/src/common_event_subscriber_manager.cpp +++ b/services/ces/src/common_event_subscriber_manager.cpp @@ -35,14 +35,14 @@ CommonEventSubscriberManager::~CommonEventSubscriberManager() EVENT_LOGI("CommonEventSubscriberManager instance destoryed"); } -int CommonEventSubscriberManager::InsertSubscriber(const SubscribeInfoPtr &eventSubscriberInfo, +int CommonEventSubscriberManager::InsertSubscriber(const SubscribeInfoPtr &eventSubscribeInfo, const sptr &commonEventListener, const struct tm &recordTime, const pid_t &pid, const uid_t &uid, const std::string &bundleName) { EVENT_LOGI("enter"); - if (eventSubscriberInfo == nullptr) { - EVENT_LOGE("eventSubscriberInfo is null"); + if (eventSubscribeInfo == nullptr) { + EVENT_LOGE("eventSubscribeInfo is null"); return ERR_INVALID_VALUE; } @@ -51,7 +51,7 @@ int CommonEventSubscriberManager::InsertSubscriber(const SubscribeInfoPtr &event return ERR_INVALID_VALUE; } - std::vector events = eventSubscriberInfo->GetMatchingSkills().GetEvents(); + std::vector events = eventSubscribeInfo->GetMatchingSkills().GetEvents(); if (events.size() <= 0) { EVENT_LOGE("No subscribed events"); return ERR_INVALID_VALUE; @@ -63,7 +63,7 @@ int CommonEventSubscriberManager::InsertSubscriber(const SubscribeInfoPtr &event return ERR_INVALID_VALUE; } - record->eventSubscriberInfo = eventSubscriberInfo; + record->eventSubscribeInfo = eventSubscribeInfo; record->commonEventListener = commonEventListener; record->recordTime = recordTime; record->pid = pid; @@ -115,41 +115,41 @@ void CommonEventSubscriberManager::DumpDetailed( std::string pid = format + "PID: " + std::to_string(record->pid) + "\n"; std::string uid = format + "UID: " + std::to_string(record->uid) + "\n"; std::string bundleName = format + "BundleName: " + record->bundleName + "\n"; - std::string priority = format + "Priority: " + std::to_string(record->eventSubscriberInfo->GetPriority()) + "\n"; - std::string permission = format + "Permission: " + record->eventSubscriberInfo->GetPermission() + "\n"; - std::string deviceId = format + "DevicedID: " + record->eventSubscriberInfo->GetDeviceId() + "\n"; + std::string priority = format + "Priority: " + std::to_string(record->eventSubscribeInfo->GetPriority()) + "\n"; + std::string permission = format + "Permission: " + record->eventSubscribeInfo->GetPermission() + "\n"; + std::string deviceId = format + "DevicedID: " + record->eventSubscribeInfo->GetDeviceId() + "\n"; std::string events = format + "\tEvent: "; std::string separator; - for (int eventNum = 0; eventNum < record->eventSubscriberInfo->GetMatchingSkills().CountEvent(); ++eventNum) { + for (int eventNum = 0; eventNum < record->eventSubscribeInfo->GetMatchingSkills().CountEvent(); ++eventNum) { if (eventNum == 0) { separator = ""; } else { separator = ", "; } - events = events + separator + record->eventSubscriberInfo->GetMatchingSkills().GetEvent(eventNum); + events = events + separator + record->eventSubscribeInfo->GetMatchingSkills().GetEvent(eventNum); } events = events + "\n"; std::string entities = format + "\tEntity: "; - for (int entityNum = 0; entityNum < record->eventSubscriberInfo->GetMatchingSkills().CountEntities(); ++entityNum) { + for (int entityNum = 0; entityNum < record->eventSubscribeInfo->GetMatchingSkills().CountEntities(); ++entityNum) { if (entityNum == 0) { separator = ""; } else { separator = ", "; } - entities = entities + separator + record->eventSubscriberInfo->GetMatchingSkills().GetEntity(entityNum); + entities = entities + separator + record->eventSubscribeInfo->GetMatchingSkills().GetEntity(entityNum); } entities = entities + "\n"; std::string scheme = format + "\tScheme: "; - for (int schemeNum = 0; schemeNum < record->eventSubscriberInfo->GetMatchingSkills().CountSchemes(); ++schemeNum) { + for (int schemeNum = 0; schemeNum < record->eventSubscribeInfo->GetMatchingSkills().CountSchemes(); ++schemeNum) { if (schemeNum == 0) { separator = ""; } else { separator = ", "; } - scheme = scheme + separator + record->eventSubscriberInfo->GetMatchingSkills().GetScheme(schemeNum); + scheme = scheme + separator + record->eventSubscribeInfo->GetMatchingSkills().GetScheme(schemeNum); } scheme = scheme + "\n"; @@ -243,7 +243,7 @@ int CommonEventSubscriberManager::RemoveSubscriberRecordLocked(const sptrcommonEventListener) { RemoveFrozenEventsBySubscriber((*it)); (*it)->commonEventListener = nullptr; - events = (*it)->eventSubscriberInfo->GetMatchingSkills().GetEvents(); + events = (*it)->eventSubscribeInfo->GetMatchingSkills().GetEvents(); subscribers_.erase(it); break; } @@ -281,7 +281,7 @@ void CommonEventSubscriberManager::GetSubscriberRecordsByWantLocked( std::multiset subscriberRecords = recordsItem->second; for (auto it = subscriberRecords.begin(); it != subscriberRecords.end(); it++) { - if ((*it)->eventSubscriberInfo->GetMatchingSkills().Match(want)) { + if ((*it)->eventSubscribeInfo->GetMatchingSkills().Match(want)) { records.emplace_back(*it); } } diff --git a/services/ces/src/inner_common_event_manager.cpp b/services/ces/src/inner_common_event_manager.cpp index ed34c47d15b4a3892e5cd7551a6728f532922771..10a6d70be3cfbf1a5e7c2ed0f116528679a90b7b 100644 --- a/services/ces/src/inner_common_event_manager.cpp +++ b/services/ces/src/inner_common_event_manager.cpp @@ -90,13 +90,13 @@ bool InnerCommonEventManager::PublishCommonEvent(const CommonEventData &data, co return true; } -bool InnerCommonEventManager::SubscribeCommonEvent(const CommonEventSubscribeInfo &subscriberInfo, +bool InnerCommonEventManager::SubscribeCommonEvent(const CommonEventSubscribeInfo &subscribeInfo, const sptr &commonEventListener, const struct tm &recordTime, const pid_t &pid, const uid_t &uid, const std::string &bundleName) { EVENT_LOGI("enter"); - if (subscriberInfo.GetMatchingSkills().CountEvent() == 0) { + if (subscribeInfo.GetMatchingSkills().CountEvent() == 0) { EVENT_LOGE("the subscriber has no event"); return false; } @@ -105,7 +105,7 @@ bool InnerCommonEventManager::SubscribeCommonEvent(const CommonEventSubscribeInf return false; } - std::shared_ptr sp = std::make_shared(subscriberInfo); + std::shared_ptr sp = std::make_shared(subscribeInfo); DelayedSingleton::GetInstance()->InsertSubscriber( sp, commonEventListener, recordTime, pid, uid, bundleName); diff --git a/services/test/mock/src/iservice_registry.cpp b/services/test/mock/src/iservice_registry.cpp deleted file mode 100644 index b2bd89696ff8658aaed4ef5387be26962ac6e8b6..0000000000000000000000000000000000000000 --- a/services/test/mock/src/iservice_registry.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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. - */ - -#include "hilog_wrapper.h" -#include "iservice_registry.h" -#include "system_ability_manager.h" - -namespace OHOS { -SystemAbilityManagerClient &SystemAbilityManagerClient::GetInstance() -{ - HILOG_ERROR(" SystemAbilityManagerClient::GetInstance()"); - static auto instance = new SystemAbilityManagerClient(); - return *instance; -} - -sptr SystemAbilityManagerClient::GetRegistryRemoteObject() -{ - HILOG_ERROR("SystemAbilityManagerClient::GetRegistryRemoteObject()"); - return nullptr; -} - -void SystemAbilityManagerClient::DestroySystemAbilityManagerObject() -{ - HILOG_ERROR("SystemAbilityManagerClient::DestroySystemAbilityManagerObject()"); -} -} // namespace OHOS diff --git a/services/test/moduletest/common_event_services_module_test/BUILD.gn b/services/test/moduletest/common_event_services_module_test/BUILD.gn index 93ab09d3df65a12d576c64c05fb9b43365999f3e..f57be7dead0da6f1b064e36be79fd9947fa11a5f 100644 --- a/services/test/moduletest/common_event_services_module_test/BUILD.gn +++ b/services/test/moduletest/common_event_services_module_test/BUILD.gn @@ -20,7 +20,6 @@ ohos_moduletest("cesModuleTest") { module_out_path = module_output_path sources = [ - "${services_path}/test/mock/src/iservice_registry.cpp", "${services_path}/test/mock/src/mock_bundle_manager.cpp", "${services_path}/test/mock/src/mock_ipc.cpp", "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_core/src/bundlemgr/bundle_mgr_host.cpp", diff --git a/services/test/moduletest/common_event_services_module_test/common_event_services_module_test.cpp b/services/test/moduletest/common_event_services_module_test/common_event_services_module_test.cpp index 77cefcbaa22a231465a8c5638c0186e39a46f7a7..d12cc688c8a71ada7ba23bd2706e446207784f3a 100755 --- a/services/test/moduletest/common_event_services_module_test/common_event_services_module_test.cpp +++ b/services/test/moduletest/common_event_services_module_test/common_event_services_module_test.cpp @@ -31,7 +31,6 @@ #include "event_log_wrapper.h" #include "event_receive_stub.h" #include "mock_bundle_manager.h" -#include "system_ability_definition.h" using namespace testing::ext; @@ -46,14 +45,14 @@ std::shared_ptr handlerPtr; class CommonEventServicesModuleTest : public CommonEventSubscriber { public: - CommonEventServicesModuleTest(const CommonEventSubscribeInfo &subscriberInfo); - virtual ~CommonEventServicesModuleTest(){}; + explicit CommonEventServicesModuleTest(const CommonEventSubscribeInfo &subscribeInfo); + virtual ~CommonEventServicesModuleTest() {}; virtual void OnReceiveEvent(const CommonEventData &data); public: }; -CommonEventServicesModuleTest::CommonEventServicesModuleTest(const CommonEventSubscribeInfo &subscriberInfo) - : CommonEventSubscriber(subscriberInfo) +CommonEventServicesModuleTest::CommonEventServicesModuleTest(const CommonEventSubscribeInfo &subscribeInfo) + : CommonEventSubscriber(subscribeInfo) {} void CommonEventServicesModuleTest::OnReceiveEvent(const CommonEventData &data) @@ -77,21 +76,8 @@ void cesModuleTest::SetUpTestCase() handlerPtr->PostTask(task); bundleObject = new OHOS::AppExecFwk::MockBundleMgrService(); - OHOS::DelayedSingleton::GetInstance()->sptrBundleMgr_ = - iface_cast(bundleObject); - - OHOS::DelayedSingleton::GetInstance()->bmsDeath_ = new BMSDeathRecipient(); - if (!OHOS::DelayedSingleton::GetInstance()->bmsDeath_) { - EVENT_LOGE("Failed to create death Recipient ptr BMSDeathRecipient"); - return; - } - if (!OHOS::DelayedSingleton::GetInstance()->sptrBundleMgr_->AsObject()->AddDeathRecipient( - OHOS::DelayedSingleton::GetInstance()->bmsDeath_)) { - EVENT_LOGE("Failed to add death recipient"); - return; - } - + OHOS::iface_cast(bundleObject); OHOS::DelayedSingleton::GetInstance()->OnStart(); } diff --git a/services/test/moduletest/common_event_services_publish_ordered_module_test/BUILD.gn b/services/test/moduletest/common_event_services_publish_ordered_module_test/BUILD.gn index c1d0381e8ff91c35e9c9d733f0bb98b35df0fc90..4c9178cd56b118f92e3c51027f27ccab473ac404 100644 --- a/services/test/moduletest/common_event_services_publish_ordered_module_test/BUILD.gn +++ b/services/test/moduletest/common_event_services_publish_ordered_module_test/BUILD.gn @@ -20,7 +20,6 @@ ohos_moduletest("CesPublishOrderedEventModuleTest") { module_out_path = module_output_path sources = [ - "${services_path}/test/mock/src/iservice_registry.cpp", "${services_path}/test/mock/src/mock_bundle_manager.cpp", "${services_path}/test/mock/src/mock_ipc.cpp", "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_core/src/bundlemgr/bundle_mgr_host.cpp", diff --git a/services/test/moduletest/common_event_services_publish_ordered_module_test/common_event_services_publish_ordered_module_test.cpp b/services/test/moduletest/common_event_services_publish_ordered_module_test/common_event_services_publish_ordered_module_test.cpp index d645766d4c9f589d2382f36cdce78c93c31a628a..d8609cc8e4acdd63e68ee63413e8028462a54c16 100644 --- a/services/test/moduletest/common_event_services_publish_ordered_module_test/common_event_services_publish_ordered_module_test.cpp +++ b/services/test/moduletest/common_event_services_publish_ordered_module_test/common_event_services_publish_ordered_module_test.cpp @@ -27,16 +27,9 @@ #undef private #undef protected #include "common_event_manager.h" -#include "event_log_wrapper.h" #include "datetime_ex.h" -#include "iremote_object.h" -#include "message_parcel.h" #include "mock_bundle_manager.h" -#include "sa_mgr_client.h" #include "singleton.h" -#include "system_ability_definition.h" -#include "system_ability_helper.h" -#include "system_ability.h" #include "want.h" #include @@ -98,7 +91,8 @@ public: class Subscriber : public CommonEventSubscriber { public: - explicit Subscriber(const CommonEventSubscribeInfo &subscriberInfo) : CommonEventSubscriber(subscriberInfo){}; + explicit Subscriber(const CommonEventSubscribeInfo &subscribeInfo) : CommonEventSubscriber(subscribeInfo) + {} ~Subscriber() {} @@ -123,7 +117,8 @@ public: class SubscriberTest : public CommonEventSubscriber { public: - explicit SubscriberTest(const CommonEventSubscribeInfo &subscriberInfo) : CommonEventSubscriber(subscriberInfo){}; + explicit SubscriberTest(const CommonEventSubscribeInfo &subscribeInfo) : CommonEventSubscriber(subscribeInfo) + {} ~SubscriberTest() {} @@ -264,8 +259,9 @@ private: class SubscriberAnotherTest : public CommonEventSubscriber { public: - explicit SubscriberAnotherTest(const CommonEventSubscribeInfo &subscriberInfo) - : CommonEventSubscriber(subscriberInfo){}; + explicit SubscriberAnotherTest(const CommonEventSubscribeInfo &subscribeInfo) + : CommonEventSubscriber(subscribeInfo) + {} ~SubscriberAnotherTest() {} @@ -394,18 +390,6 @@ void CesPublishOrderedEventModuleTest::SetUpTestCase(void) p_bundleObject = new OHOS::AppExecFwk::MockBundleMgrService(); OHOS::DelayedSingleton::GetInstance()->sptrBundleMgr_ = OHOS::iface_cast(p_bundleObject); - - OHOS::DelayedSingleton::GetInstance()->bmsDeath_ = new BMSDeathRecipient(); - - if (!OHOS::DelayedSingleton::GetInstance()->bmsDeath_) { - EVENT_LOGE("Failed to create death Recipient ptr BMSDeathRecipient"); - return; - } - if (!OHOS::DelayedSingleton::GetInstance()->sptrBundleMgr_->AsObject()->AddDeathRecipient( - OHOS::DelayedSingleton::GetInstance()->bmsDeath_)) { - EVENT_LOGE("Failed to add death recipient"); - return; - } OHOS::DelayedSingleton::GetInstance()->OnStart(); } @@ -450,10 +434,10 @@ HWTEST_F(CesPublishOrderedEventModuleTest, CommonEventPublishOrderedEventTest_01 matchingSkills.AddEvent(EVENTCASE1); // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // make a subcriber object - std::shared_ptr subscriberTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberTest = std::make_shared(subscribeInfo); // subscribe a common event bool subscribeResult = SubscribeCommonEventTest(subscriberTest); @@ -464,11 +448,11 @@ HWTEST_F(CesPublishOrderedEventModuleTest, CommonEventPublishOrderedEventTest_01 matchingSkillsAnother.AddEvent(EVENTCASE1); // make another subcriber info - CommonEventSubscribeInfo subscriberInfoAnother(matchingSkillsAnother); + CommonEventSubscribeInfo subscribeInfoAnother(matchingSkillsAnother); // make another subcriber object std::shared_ptr subscriberTestAnother = - std::make_shared(subscriberInfoAnother); + std::make_shared(subscribeInfoAnother); // subscribe another event bool subscribeResultAnother = SubscribeCommonEventTest(subscriberTestAnother); @@ -494,7 +478,7 @@ HWTEST_F(CesPublishOrderedEventModuleTest, CommonEventPublishOrderedEventTest_01 g_mtx.lock(); g_mtxAnother.lock(); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); // publish ordered event bool publishResult = PublishOrderedCommonEventTest(data, publishInfo, subscriber); @@ -567,11 +551,11 @@ HWTEST_F(CesPublishOrderedEventModuleTest, CommonEventPublishOrderedEventTest_02 matchingSkills.AddEvent(EVENTCASE2); // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - subscriberInfo.SetPriority(LOWPRIORITY); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + subscribeInfo.SetPriority(LOWPRIORITY); // make a subcriber object - std::shared_ptr subscriberTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberTest = std::make_shared(subscribeInfo); // subscribe a common event bool subscribeResult = SubscribeCommonEventTest(subscriberTest); @@ -582,12 +566,12 @@ HWTEST_F(CesPublishOrderedEventModuleTest, CommonEventPublishOrderedEventTest_02 matchingSkillsAnother.AddEvent(EVENTCASE2); // make another subcriber info - CommonEventSubscribeInfo subscriberInfoAnother(matchingSkillsAnother); - subscriberInfoAnother.SetPriority(HIGHPRIORITY); + CommonEventSubscribeInfo subscribeInfoAnother(matchingSkillsAnother); + subscribeInfoAnother.SetPriority(HIGHPRIORITY); // make another subcriber object std::shared_ptr subscriberTestAnother = - std::make_shared(subscriberInfoAnother); + std::make_shared(subscribeInfoAnother); // subscribe another event bool subscribeResultAnother = SubscribeCommonEventTest(subscriberTestAnother); @@ -612,7 +596,7 @@ HWTEST_F(CesPublishOrderedEventModuleTest, CommonEventPublishOrderedEventTest_02 g_mtx.lock(); g_mtxAnother.lock(); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); // publish ordered event bool publishResult = PublishOrderedCommonEventTest(data, publishInfo, subscriber); @@ -684,10 +668,10 @@ HWTEST_F(CesPublishOrderedEventModuleTest, CommonEventPublishOrderedEventTest_03 matchingSkills.AddEvent(EVENTCASE3); // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // make a subcriber object - std::shared_ptr subscriberTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberTest = std::make_shared(subscribeInfo); // subscribe a common event bool subscribeResult = SubscribeCommonEventTest(subscriberTest); @@ -698,11 +682,11 @@ HWTEST_F(CesPublishOrderedEventModuleTest, CommonEventPublishOrderedEventTest_03 matchingSkillsAnother.AddEvent(EVENTCASE3); // make another subcriber info - CommonEventSubscribeInfo subscriberInfoAnother(matchingSkillsAnother); + CommonEventSubscribeInfo subscribeInfoAnother(matchingSkillsAnother); // make another subcriber object std::shared_ptr subscriberTestAnother = - std::make_shared(subscriberInfoAnother); + std::make_shared(subscribeInfoAnother); // subscribe another event bool subscribeResultAnother = SubscribeCommonEventTest(subscriberTestAnother); @@ -728,7 +712,7 @@ HWTEST_F(CesPublishOrderedEventModuleTest, CommonEventPublishOrderedEventTest_03 g_mtxAnother.lock(); // publish ordered event - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); bool publishResult = PublishOrderedCommonEventTest(data, publishInfo, subscriber); EXPECT_EQ(true, publishResult); @@ -796,10 +780,10 @@ HWTEST_F(CesPublishOrderedEventModuleTest, CommonEventPublishOrderedEventTest_04 matchingSkills.AddEvent(EVENTCASE4); // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // make a subcriber object - std::shared_ptr subscriberTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberTest = std::make_shared(subscribeInfo); // subscribe a common event bool subscribeResult = SubscribeCommonEventTest(subscriberTest); @@ -810,11 +794,11 @@ HWTEST_F(CesPublishOrderedEventModuleTest, CommonEventPublishOrderedEventTest_04 matchingSkillsAnother.AddEvent(EVENTCASE4); // make another subcriber info - CommonEventSubscribeInfo subscriberInfoAnother(matchingSkillsAnother); + CommonEventSubscribeInfo subscribeInfoAnother(matchingSkillsAnother); // make another subcriber object std::shared_ptr subscriberTestAnother = - std::make_shared(subscriberInfoAnother); + std::make_shared(subscribeInfoAnother); // subscribe another event bool subscribeResultAnother = SubscribeCommonEventTest(subscriberTestAnother); @@ -839,7 +823,7 @@ HWTEST_F(CesPublishOrderedEventModuleTest, CommonEventPublishOrderedEventTest_04 g_mtx.lock(); g_mtxAnother.lock(); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); // publish ordered event bool publishResult = PublishOrderedCommonEventTest(data, publishInfo, subscriber); @@ -909,10 +893,10 @@ HWTEST_F(CesPublishOrderedEventModuleTest, CommonEventPublishOrderedEventTest_05 matchingSkills.AddEvent(EVENTCASE5); // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // make a subcriber object - std::shared_ptr subscriberTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberTest = std::make_shared(subscribeInfo); // subscribe a common event bool subscribeResult = SubscribeCommonEventTest(subscriberTest); @@ -923,11 +907,11 @@ HWTEST_F(CesPublishOrderedEventModuleTest, CommonEventPublishOrderedEventTest_05 matchingSkillsAnother.AddEvent(EVENTCASE5); // make another subcriber info - CommonEventSubscribeInfo subscriberInfoAnother(matchingSkillsAnother); + CommonEventSubscribeInfo subscribeInfoAnother(matchingSkillsAnother); // make another subcriber object std::shared_ptr subscriberTestAnother = - std::make_shared(subscriberInfoAnother); + std::make_shared(subscribeInfoAnother); // subscribe another event bool subscribeResultAnother = SubscribeCommonEventTest(subscriberTestAnother); @@ -953,7 +937,7 @@ HWTEST_F(CesPublishOrderedEventModuleTest, CommonEventPublishOrderedEventTest_05 g_mtxAnother.lock(); // publish ordered event - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); bool publishResult = PublishOrderedCommonEventTest(data, publishInfo, subscriber); EXPECT_EQ(true, publishResult); @@ -1023,10 +1007,10 @@ HWTEST_F(CesPublishOrderedEventModuleTest, CommonEventPublishOrderedEventTest_06 matchingSkills.AddEvent(EVENTCASE6); // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // make a subcriber object - std::shared_ptr subscriberTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberTest = std::make_shared(subscribeInfo); // subscribe a common event bool subscribeResult = SubscribeCommonEventTest(subscriberTest); @@ -1037,11 +1021,11 @@ HWTEST_F(CesPublishOrderedEventModuleTest, CommonEventPublishOrderedEventTest_06 matchingSkillsAnother.AddEvent(EVENTCASE6); // make another subcriber info - CommonEventSubscribeInfo subscriberInfoAnother(matchingSkillsAnother); + CommonEventSubscribeInfo subscribeInfoAnother(matchingSkillsAnother); // make another subcriber object std::shared_ptr subscriberTestAnother = - std::make_shared(subscriberInfoAnother); + std::make_shared(subscribeInfoAnother); // subscribe another event bool subscribeResultAnother = SubscribeCommonEventTest(subscriberTestAnother); @@ -1066,7 +1050,7 @@ HWTEST_F(CesPublishOrderedEventModuleTest, CommonEventPublishOrderedEventTest_06 g_mtx.lock(); g_mtxAnother.lock(); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); // publish ordered event bool publishResult = PublishOrderedCommonEventTest(data, publishInfo, subscriber); diff --git a/services/test/unittest/BUILD.gn b/services/test/unittest/BUILD.gn index ef1b7a5929a4496598b459da0f848c5cfb68d54f..91cdaef2ebf0831506327ead747b87f8f80163ec 100644 --- a/services/test/unittest/BUILD.gn +++ b/services/test/unittest/BUILD.gn @@ -56,7 +56,6 @@ ohos_unittest("common_event_publish_system_event_test") { module_out_path = module_output_path sources = [ - "${services_path}/test/unittest/mock/src/iservice_registry.cpp", "${services_path}/test/unittest/mock/src/mock_bundle_manager.cpp", "${services_path}/test/unittest/mock/src/mock_ipc.cpp", "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_core/src/bundlemgr/bundle_mgr_host.cpp", @@ -92,7 +91,6 @@ ohos_unittest("common_event_dump_test") { module_out_path = module_output_path sources = [ - "${services_path}/test/unittest/mock/src/iservice_registry.cpp", "${services_path}/test/unittest/mock/src/mock_bundle_manager.cpp", "${services_path}/test/unittest/mock/src/mock_ipc.cpp", "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_core/src/bundlemgr/bundle_mgr_host.cpp", @@ -129,7 +127,6 @@ ohos_unittest("common_event_freeze_test") { module_out_path = module_output_path sources = [ - "${services_path}/test/unittest/mock/src/iservice_registry.cpp", "${services_path}/test/unittest/mock/src/mock_bundle_manager.cpp", "${services_path}/test/unittest/mock/src/mock_ipc.cpp", "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_core/src/bundlemgr/bundle_mgr_host.cpp", @@ -165,7 +162,6 @@ ohos_unittest("common_event_sticky_test") { module_out_path = module_output_path sources = [ - "${services_path}/test/unittest/mock/src/iservice_registry.cpp", "${services_path}/test/unittest/mock/src/mock_bundle_manager.cpp", "${services_path}/test/unittest/mock/src/mock_ipc.cpp", "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_core/src/bundlemgr/bundle_mgr_host.cpp", @@ -201,7 +197,6 @@ ohos_unittest("common_event_subscribe_unit_test") { module_out_path = module_output_path sources = [ - "${services_path}/test/unittest/mock/src/iservice_registry.cpp", "${services_path}/test/unittest/mock/src/mock_bundle_manager.cpp", "${services_path}/test/unittest/mock/src/mock_ipc.cpp", "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_core/src/bundlemgr/bundle_mgr_host.cpp", @@ -237,7 +232,6 @@ ohos_unittest("common_event_unsubscribe_unit_test") { module_out_path = module_output_path sources = [ - "${services_path}/test/unittest/mock/src/iservice_registry.cpp", "${services_path}/test/unittest/mock/src/mock_bundle_manager.cpp", "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_core/src/bundlemgr/bundle_mgr_host.cpp", "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_core/src/bundlemgr/bundle_mgr_proxy.cpp", @@ -272,7 +266,6 @@ ohos_unittest("common_event_publish_ordered_event_unit_test") { module_out_path = module_output_path sources = [ - "${services_path}/test/unittest/mock/src/iservice_registry.cpp", "${services_path}/test/unittest/mock/src/mock_bundle_manager.cpp", "${services_path}/test/unittest/mock/src/mock_ipc.cpp", "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_core/src/bundlemgr/bundle_mgr_host.cpp", @@ -308,7 +301,6 @@ ohos_unittest("common_event_publish_permission_event_unit_test") { module_out_path = module_output_path sources = [ - "${services_path}/test/unittest/mock/src/iservice_registry.cpp", "${services_path}/test/unittest/mock/src/mock_bundle_manager.cpp", "${services_path}/test/unittest/mock/src/mock_ipc.cpp", "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_core/src/bundlemgr/bundle_mgr_host.cpp", @@ -344,7 +336,6 @@ ohos_unittest("common_event_publish_manager_event_unit_test") { module_out_path = module_output_path sources = [ - "${services_path}/test/unittest/mock/src/iservice_registry.cpp", "${services_path}/test/unittest/mock/src/mock_bundle_manager.cpp", "${services_path}/test/unittest/mock/src/mock_ipc.cpp", "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_core/src/bundlemgr/bundle_mgr_host.cpp", diff --git a/services/test/unittest/common_event_dump_test.cpp b/services/test/unittest/common_event_dump_test.cpp index f4572b4bf3c5c1accd9e0f8380e6d44a6d67ab26..fb590930e9404e500f95e4fa5e3f23f577a28ac3 100644 --- a/services/test/unittest/common_event_dump_test.cpp +++ b/services/test/unittest/common_event_dump_test.cpp @@ -14,6 +14,7 @@ */ #include +#include #define private public #define protected public @@ -24,12 +25,9 @@ #undef private #undef protected +#include "datetime_ex.h" #include "inner_common_event_manager.h" -#include "iservice_registry.h" #include "mock_bundle_manager.h" -#include "system_ability_definition.h" -#include "datetime_ex.h" -#include using namespace testing::ext; using namespace OHOS::EventFwk; @@ -79,7 +77,6 @@ const int STATE_INDEX2 = 2; const int STATE_INDEX3 = 3; const int DUMP_INFO_COUNT = 2; const int PUBLISH_COUNT = 60; -} // namespace static OHOS::sptr bundleObject = nullptr; OHOS::sptr commonEventListener; @@ -288,21 +285,8 @@ std::shared_ptr CommonEventDumpTest::innerCommonEventMa void CommonEventDumpTest::SetUpTestCase(void) { bundleObject = new OHOS::AppExecFwk::MockBundleMgrService(); - OHOS::DelayedSingleton::GetInstance()->sptrBundleMgr_ = OHOS::iface_cast(bundleObject); - - OHOS::DelayedSingleton::GetInstance()->bmsDeath_ = new BMSDeathRecipient(); - if (!OHOS::DelayedSingleton::GetInstance()->bmsDeath_) { - GTEST_LOG_(INFO) << "Failed to create death Recipient ptr BMSDeathRecipient"; - return; - } - if (!OHOS::DelayedSingleton::GetInstance()->sptrBundleMgr_->AsObject()->AddDeathRecipient( - OHOS::DelayedSingleton::GetInstance()->bmsDeath_)) { - GTEST_LOG_(INFO) << "Failed to add death recipient"; - return; - } - OHOS::DelayedSingleton::GetInstance()->OnStart(); } @@ -538,30 +522,30 @@ static void SetMatchingSkills(MatchingSkills &matchingSkills) matchingSkills.AddEntity(ENTITY2); } -static void SetSubscriberInfo1(CommonEventListener *&listener, MatchingSkills &matchingSkills) +static void SetSubscribeInfo1(CommonEventListener *&listener, MatchingSkills &matchingSkills) { - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - subscriberInfo.SetPriority(PRIORITY); - subscriberInfo.SetPermission(PERMISSION); - subscriberInfo.SetDeviceId(DEVICEDID); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + subscribeInfo.SetPriority(PRIORITY); + subscribeInfo.SetPermission(PERMISSION); + subscribeInfo.SetDeviceId(DEVICEDID); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); listener = new CommonEventListener(subscriber); OHOS::DelayedSingleton::GetInstance()->SubscribeCommonEvent( - subscriberInfo, listener->AsObject()); + subscribeInfo, listener->AsObject()); } -static void SetSubscriberInfo2(CommonEventListener *&listener2, MatchingSkills &matchingSkills) +static void SetSubscribeInfo2(CommonEventListener *&listener2, MatchingSkills &matchingSkills) { - CommonEventSubscribeInfo subscriberInfo2(matchingSkills); - subscriberInfo2.SetPriority(PRIORITY2); - subscriberInfo2.SetPermission(PERMISSION2); - subscriberInfo2.SetDeviceId(DEVICEDID2); - std::shared_ptr subscriber2 = std::make_shared(subscriberInfo2); + CommonEventSubscribeInfo subscribeInfo2(matchingSkills); + subscribeInfo2.SetPriority(PRIORITY2); + subscribeInfo2.SetPermission(PERMISSION2); + subscribeInfo2.SetDeviceId(DEVICEDID2); + std::shared_ptr subscriber2 = std::make_shared(subscribeInfo2); listener2 = new CommonEventListener(subscriber2); OHOS::DelayedSingleton::GetInstance()->SubscribeCommonEvent( - subscriberInfo2, listener2->AsObject()); + subscribeInfo2, listener2->AsObject()); } static void Test0100Publish1() @@ -710,9 +694,9 @@ HWTEST_F(CommonEventDumpTest, CommonEventDumpTest_0100, Function | MediumTest | SetMatchingSkills(matchingSkills); - SetSubscriberInfo1(listener, matchingSkills); + SetSubscribeInfo1(listener, matchingSkills); - SetSubscriberInfo2(listener2, matchingSkills); + SetSubscribeInfo2(listener2, matchingSkills); /* Publish */ Test0100Publish1(); @@ -746,9 +730,9 @@ HWTEST_F(CommonEventDumpTest, CommonEventDumpTest_0200, Function | MediumTest | SetMatchingSkills(matchingSkills); - SetSubscriberInfo1(listener, matchingSkills); + SetSubscribeInfo1(listener, matchingSkills); - SetSubscriberInfo2(listener2, matchingSkills); + SetSubscribeInfo2(listener2, matchingSkills); /* Publish */ Test0200Publish1(); @@ -852,15 +836,15 @@ HWTEST_F(CommonEventDumpTest, CommonEventDumpTest_0400, Function | MediumTest | matchingSkills.AddEvent(EVENT); matchingSkills.AddScheme(SCHEME); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - subscriberInfo.SetPriority(PRIORITY); - subscriberInfo.SetPermission(PERMISSION); - subscriberInfo.SetDeviceId(DEVICEDID); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + subscribeInfo.SetPriority(PRIORITY); + subscribeInfo.SetPermission(PERMISSION); + subscribeInfo.SetDeviceId(DEVICEDID); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); CommonEventListener *listener = new CommonEventListener(subscriber); OHOS::DelayedSingleton::GetInstance()->SubscribeCommonEvent( - subscriberInfo, listener->AsObject()); + subscribeInfo, listener->AsObject()); sleep(1); @@ -884,15 +868,15 @@ HWTEST_F(CommonEventDumpTest, CommonEventDumpTest_0500, Function | MediumTest | MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENT); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - subscriberInfo.SetPriority(PRIORITY); - subscriberInfo.SetPermission(PERMISSION); - subscriberInfo.SetDeviceId(DEVICEDID); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + subscribeInfo.SetPriority(PRIORITY); + subscribeInfo.SetPermission(PERMISSION); + subscribeInfo.SetDeviceId(DEVICEDID); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); CommonEventListener *listener = new CommonEventListener(subscriber); OHOS::DelayedSingleton::GetInstance()->SubscribeCommonEvent( - subscriberInfo, listener->AsObject()); + subscribeInfo, listener->AsObject()); sleep(1); @@ -916,14 +900,14 @@ HWTEST_F(CommonEventDumpTest, CommonEventDumpTest_0600, Function | MediumTest | MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENT); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - subscriberInfo.SetPermission(PERMISSION); - subscriberInfo.SetDeviceId(DEVICEDID); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + subscribeInfo.SetPermission(PERMISSION); + subscribeInfo.SetDeviceId(DEVICEDID); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); CommonEventListener *listener = new CommonEventListener(subscriber); OHOS::DelayedSingleton::GetInstance()->SubscribeCommonEvent( - subscriberInfo, listener->AsObject()); + subscribeInfo, listener->AsObject()); sleep(1); @@ -947,13 +931,13 @@ HWTEST_F(CommonEventDumpTest, CommonEventDumpTest_0700, Function | MediumTest | MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENT); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - subscriberInfo.SetDeviceId(DEVICEDID); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + subscribeInfo.SetDeviceId(DEVICEDID); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); CommonEventListener *listener = new CommonEventListener(subscriber); OHOS::DelayedSingleton::GetInstance()->SubscribeCommonEvent( - subscriberInfo, listener->AsObject()); + subscribeInfo, listener->AsObject()); sleep(1); @@ -977,12 +961,12 @@ HWTEST_F(CommonEventDumpTest, CommonEventDumpTest_0800, Function | MediumTest | MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENT); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); CommonEventListener *listener = new CommonEventListener(subscriber); OHOS::DelayedSingleton::GetInstance()->SubscribeCommonEvent( - subscriberInfo, listener->AsObject()); + subscribeInfo, listener->AsObject()); sleep(1); @@ -1006,12 +990,12 @@ HWTEST_F(CommonEventDumpTest, CommonEventDumpTest_0900, Function | MediumTest | MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENT); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); CommonEventListener *listener = new CommonEventListener(subscriber); OHOS::DelayedSingleton::GetInstance()->SubscribeCommonEvent( - subscriberInfo, listener->AsObject()); + subscribeInfo, listener->AsObject()); sleep(1); @@ -1101,9 +1085,9 @@ HWTEST_F(CommonEventDumpTest, CommonEventDumpTest_1000, TestSize.Level1) SetMatchingSkills(matchingSkills); - SetSubscriberInfo1(listener, matchingSkills); + SetSubscribeInfo1(listener, matchingSkills); - SetSubscriberInfo2(listener2, matchingSkills); + SetSubscribeInfo2(listener2, matchingSkills); /* Publish */ // Publish1 @@ -1419,12 +1403,12 @@ HWTEST_F(CommonEventDumpTest, CommonEventDumpTest_1900, TestSize.Level1) matchingSkills.AddEntity(ENTITY); matchingSkills.AddEntity(ENTITY2); // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - subscriberInfo.SetPriority(1); - subscriberInfo.SetDeviceId(DEVICEDID); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + subscribeInfo.SetPriority(1); + subscribeInfo.SetDeviceId(DEVICEDID); // make a subcriber object std::shared_ptr subscriberTest = - std::make_shared(subscriberInfo, getInnerCommonEventManager()); + std::make_shared(subscribeInfo, getInnerCommonEventManager()); // subscribe a common event bool subscribeResult = SubscribeCommonEvent(subscriberTest, UID, commonEventListener); EXPECT_EQ(true, subscribeResult); @@ -1435,12 +1419,12 @@ HWTEST_F(CommonEventDumpTest, CommonEventDumpTest_1900, TestSize.Level1) matchingSkillsAnother.AddEntity(ENTITY); matchingSkillsAnother.AddEntity(ENTITY2); // make another subcriber info - CommonEventSubscribeInfo subscriberInfo2(matchingSkillsAnother); - subscriberInfo2.SetPriority(0); - subscriberInfo2.SetDeviceId(DEVICEDID2); + CommonEventSubscribeInfo subscribeInfo2(matchingSkillsAnother); + subscribeInfo2.SetPriority(0); + subscribeInfo2.SetDeviceId(DEVICEDID2); // make another subcriber object std::shared_ptr subscriberTest2 = - std::make_shared(subscriberInfo2, getInnerCommonEventManager()); + std::make_shared(subscribeInfo2, getInnerCommonEventManager()); // subscribe another event bool subscribeResult2 = SubscribeCommonEvent(subscriberTest2, UID2, commonEventListener2); @@ -1476,12 +1460,12 @@ HWTEST_F(CommonEventDumpTest, CommonEventDumpTest_2000, TestSize.Level1) matchingSkills.AddEntity(ENTITY); matchingSkills.AddEntity(ENTITY2); // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - subscriberInfo.SetPriority(1); - subscriberInfo.SetDeviceId(DEVICEDID); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + subscribeInfo.SetPriority(1); + subscribeInfo.SetDeviceId(DEVICEDID); // make a subcriber object std::shared_ptr subscriberTest = - std::make_shared(subscriberInfo, getInnerCommonEventManager()); + std::make_shared(subscribeInfo, getInnerCommonEventManager()); // subscribe a common event bool subscribeResult = SubscribeCommonEvent(subscriberTest, UID, commonEventListener); EXPECT_EQ(true, subscribeResult); @@ -1492,12 +1476,12 @@ HWTEST_F(CommonEventDumpTest, CommonEventDumpTest_2000, TestSize.Level1) matchingSkillsAnother.AddEntity(ENTITY); matchingSkillsAnother.AddEntity(ENTITY2); // make another subcriber info - CommonEventSubscribeInfo subscriberInfo2(matchingSkillsAnother); - subscriberInfo2.SetPriority(0); - subscriberInfo2.SetDeviceId(DEVICEDID2); + CommonEventSubscribeInfo subscribeInfo2(matchingSkillsAnother); + subscribeInfo2.SetPriority(0); + subscribeInfo2.SetDeviceId(DEVICEDID2); // make another subcriber object std::shared_ptr subscriberTest2 = - std::make_shared(subscriberInfo2, getInnerCommonEventManager()); + std::make_shared(subscribeInfo2, getInnerCommonEventManager()); // subscribe another event bool subscribeResult2 = SubscribeCommonEvent(subscriberTest2, UID2, commonEventListener2); @@ -1527,4 +1511,5 @@ HWTEST_F(CommonEventDumpTest, CommonEventDumpTest_2000, TestSize.Level1) std::vector state; getInnerCommonEventManager()->DumpState("", state); CommonEventDumpTest::dumpInfoCount(state, 4, DUMP_INFO_COUNT, 0, 100); -} \ No newline at end of file +} +} // namespace diff --git a/services/test/unittest/common_event_freeze_test.cpp b/services/test/unittest/common_event_freeze_test.cpp index 9b8f0c432b4c3365863321e3137a20065b0ab955..8994cf7a9530f2e396eef052aa8471357737ad96 100755 --- a/services/test/unittest/common_event_freeze_test.cpp +++ b/services/test/unittest/common_event_freeze_test.cpp @@ -15,9 +15,7 @@ #include #define UNIT_TEST -#include "system_ability_definition.h" #include "mock_bundle_manager.h" -#include "iservice_registry.h" #include "inner_common_event_manager.h" #include "common_event_sticky_manager.h" #include "errors.h" @@ -55,7 +53,6 @@ const int FREEZE_SLEEP2 = 120; bool isFreeze_uid = false; bool isFreeze_uid2 = false; std::mutex mtx; -} // namespace static OHOS::sptr bundleObject = nullptr; OHOS::sptr commonEventListener; @@ -266,20 +263,8 @@ std::shared_ptr CommonEventFreezeTest::innerCommonEvent void CommonEventFreezeTest::SetUpTestCase(void) { bundleObject = new OHOS::AppExecFwk::MockBundleMgrService(); - OHOS::DelayedSingleton::GetInstance()->sptrBundleMgr_ = OHOS::iface_cast(bundleObject); - - OHOS::DelayedSingleton::GetInstance()->bmsDeath_ = new BMSDeathRecipient(); - if (!OHOS::DelayedSingleton::GetInstance()->bmsDeath_) { - GTEST_LOG_(INFO) << "Failed to create death Recipient ptr BMSDeathRecipient"; - return; - } - if (!OHOS::DelayedSingleton::GetInstance()->sptrBundleMgr_->AsObject()->AddDeathRecipient( - OHOS::DelayedSingleton::GetInstance()->bmsDeath_)) { - GTEST_LOG_(INFO) << "Failed to add death recipient"; - return; - } } void CommonEventFreezeTest::TearDownTestCase(void) @@ -411,10 +396,10 @@ HWTEST_F(CommonEventFreezeTest, CommonEventFreezeTest_001, TestSize.Level1) matchingSkills.AddEvent(EVENTCASE1); // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // make a subcriber object - std::shared_ptr subscriberTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberTest = std::make_shared(subscribeInfo); // subscribe a common event bool subscribeResult = SubscribeCommonEvent(subscriberTest, UID, commonEventListener); @@ -425,10 +410,10 @@ HWTEST_F(CommonEventFreezeTest, CommonEventFreezeTest_001, TestSize.Level1) matchingSkillsAnother.AddEvent(EVENTCASE1); // make another subcriber info - CommonEventSubscribeInfo subscriberInfo2(matchingSkillsAnother); + CommonEventSubscribeInfo subscribeInfo2(matchingSkillsAnother); // make another subcriber object - std::shared_ptr subscriberTest2 = std::make_shared(subscriberInfo2); + std::shared_ptr subscriberTest2 = std::make_shared(subscribeInfo2); // subscribe another event bool subscribeResult2 = SubscribeCommonEvent(subscriberTest2, UID2, commonEventListener2); @@ -476,10 +461,10 @@ HWTEST_F(CommonEventFreezeTest, CommonEventFreezeTest_002, TestSize.Level1) matchingSkills.AddEvent(EVENTCASE2); // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // make a subcriber object - std::shared_ptr subscriberTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberTest = std::make_shared(subscribeInfo); // subscribe a common event bool subscribeResult = SubscribeCommonEvent(subscriberTest, UID, commonEventListener); @@ -490,10 +475,10 @@ HWTEST_F(CommonEventFreezeTest, CommonEventFreezeTest_002, TestSize.Level1) matchingSkillsAnother.AddEvent(EVENTCASE2); // make another subcriber info - CommonEventSubscribeInfo subscriberInfo2(matchingSkillsAnother); + CommonEventSubscribeInfo subscribeInfo2(matchingSkillsAnother); // make another subcriber object - std::shared_ptr subscriberTest2 = std::make_shared(subscriberInfo2); + std::shared_ptr subscriberTest2 = std::make_shared(subscribeInfo2); // subscribe another event bool subscribeResult2 = SubscribeCommonEvent(subscriberTest2, UID2, commonEventListener2); @@ -530,3 +515,4 @@ HWTEST_F(CommonEventFreezeTest, CommonEventFreezeTest_002, TestSize.Level1) sleep(PUBLISH_SLEEP); mtx.unlock(); } +} // namespace diff --git a/services/test/unittest/common_event_publish_manager_event_unit_test.cpp b/services/test/unittest/common_event_publish_manager_event_unit_test.cpp index c53e44b21b151878e2e8e50bb9112fff5c11d99a..83e8b4187739973cbb0b2e504895acae3d298137 100644 --- a/services/test/unittest/common_event_publish_manager_event_unit_test.cpp +++ b/services/test/unittest/common_event_publish_manager_event_unit_test.cpp @@ -28,12 +28,7 @@ #include "common_event_record.h" #include "common_event_support.h" #include "mock_bundle_manager.h" -#include "ipc_skeleton.h" -#include "iremote_object.h" -#include "iservice_registry.h" #include "publish_manager.h" -#include "refbase.h" -#include "system_ability_definition.h" #include "system_time.h" #include @@ -61,20 +56,8 @@ public: void CommonEventPublishManagerEventUnitTest::SetUpTestCase(void) { bundleObject = new OHOS::AppExecFwk::MockBundleMgrService(); - OHOS::DelayedSingleton::GetInstance()->sptrBundleMgr_ = - iface_cast(bundleObject); - - OHOS::DelayedSingleton::GetInstance()->bmsDeath_ = new BMSDeathRecipient(); - if (!OHOS::DelayedSingleton::GetInstance()->bmsDeath_) { - GTEST_LOG_(INFO) << "Failed to create death Recipient ptr BMSDeathRecipient"; - return; - } - if (!OHOS::DelayedSingleton::GetInstance()->sptrBundleMgr_->AsObject()->AddDeathRecipient( - OHOS::DelayedSingleton::GetInstance()->bmsDeath_)) { - GTEST_LOG_(INFO) << "Failed to add death recipient"; - return; - } + OHOS::iface_cast(bundleObject); } void CommonEventPublishManagerEventUnitTest::TearDownTestCase(void) diff --git a/services/test/unittest/common_event_publish_ordered_event_unit_test.cpp b/services/test/unittest/common_event_publish_ordered_event_unit_test.cpp index 25ba04ccb2e1e2710aa0cc2cefced23182af000b..df87536c87cc8823236fb3a49e34a7ab74442690 100644 --- a/services/test/unittest/common_event_publish_ordered_event_unit_test.cpp +++ b/services/test/unittest/common_event_publish_ordered_event_unit_test.cpp @@ -24,9 +24,7 @@ #undef private #undef protected -#include "iservice_registry.h" #include "mock_bundle_manager.h" -#include "system_ability_definition.h" #include @@ -97,20 +95,8 @@ void CommonEventPublishOrderedEventUnitTest::SetUpTestCase(void) handler_->PostTask(task); bundleObject = new OHOS::AppExecFwk::MockBundleMgrService(); - OHOS::DelayedSingleton::GetInstance()->sptrBundleMgr_ = OHOS::iface_cast(bundleObject); - - OHOS::DelayedSingleton::GetInstance()->bmsDeath_ = new BMSDeathRecipient(); - if (!OHOS::DelayedSingleton::GetInstance()->bmsDeath_) { - GTEST_LOG_(INFO) << "Failed to create death Recipient ptr BMSDeathRecipient"; - return; - } - if (!OHOS::DelayedSingleton::GetInstance()->sptrBundleMgr_->AsObject()->AddDeathRecipient( - OHOS::DelayedSingleton::GetInstance()->bmsDeath_)) { - GTEST_LOG_(INFO) << "Failed to add death recipient"; - return; - } } void CommonEventPublishOrderedEventUnitTest::TearDownTestCase(void) @@ -188,9 +174,9 @@ HWTEST_F(CommonEventPublishOrderedEventUnitTest, CommonEventPublishOrderedUnitTe MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENT); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); CommonEventListener *proxy = new CommonEventListener(subscriber); bool result = OHOS::DelayedSingleton::GetInstance()->FinishReceiver( proxy, 0, "receiverdata", true); @@ -255,10 +241,10 @@ HWTEST_F(CommonEventPublishOrderedEventUnitTest, CommonEventPublishOrderedUnitTe MatchingSkills matchingSkills; // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // make a subcriber object - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); OHOS::sptr commonEventListener = new CommonEventListener(subscriber); @@ -304,10 +290,10 @@ HWTEST_F(CommonEventPublishOrderedEventUnitTest, CommonEventPublishOrderedUnitTe MatchingSkills matchingSkills; // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // make a subcriber object - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); // make commonEventListener OHOS::sptr commonEventListener = new CommonEventListener(subscriber); @@ -351,10 +337,10 @@ HWTEST_F(CommonEventPublishOrderedEventUnitTest, CommonEventPublishOrderedUnitTe // make subcriber info MatchingSkills matchingSkills; - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // make subcriber - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); // make commone event listener OHOS::sptr commonEventListener = new CommonEventListener(subscriber); @@ -400,10 +386,10 @@ HWTEST_F(CommonEventPublishOrderedEventUnitTest, CommonEventPublishOrderedUnitTe // make subcriber info MatchingSkills matchingSkills; - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // make subcriber - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); // make commone event listener OHOS::sptr commonEventListener = new CommonEventListener(subscriber); @@ -692,11 +678,11 @@ HWTEST_F(CommonEventPublishOrderedEventUnitTest, CommonEventPublishOrderedUnitTe MatchingSkills matchingSkills; // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - subscriberInfo.SetThreadMode(CommonEventSubscribeInfo::ThreadMode::HANDLER); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + subscribeInfo.SetThreadMode(CommonEventSubscribeInfo::ThreadMode::HANDLER); // make a subcriber object - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); OHOS::sptr commonEventListener = new CommonEventListener(subscriber); @@ -748,11 +734,11 @@ HWTEST_F(CommonEventPublishOrderedEventUnitTest, CommonEventPublishOrderedUnitTe MatchingSkills matchingSkills; // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - subscriberInfo.SetThreadMode(CommonEventSubscribeInfo::ThreadMode::POST); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + subscribeInfo.SetThreadMode(CommonEventSubscribeInfo::ThreadMode::POST); // make a subcriber object - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); OHOS::sptr commonEventListener = new CommonEventListener(subscriber); @@ -804,11 +790,11 @@ HWTEST_F(CommonEventPublishOrderedEventUnitTest, CommonEventPublishOrderedUnitTe MatchingSkills matchingSkills; // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - subscriberInfo.SetThreadMode(CommonEventSubscribeInfo::ThreadMode::ASYNC); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + subscribeInfo.SetThreadMode(CommonEventSubscribeInfo::ThreadMode::ASYNC); // make a subcriber object - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); OHOS::sptr commonEventListener = new CommonEventListener(subscriber); @@ -860,11 +846,11 @@ HWTEST_F(CommonEventPublishOrderedEventUnitTest, CommonEventPublishOrderedUnitTe MatchingSkills matchingSkills; // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - subscriberInfo.SetThreadMode(CommonEventSubscribeInfo::ThreadMode::BACKGROUND); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + subscribeInfo.SetThreadMode(CommonEventSubscribeInfo::ThreadMode::BACKGROUND); // make a subcriber object - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); OHOS::sptr commonEventListener = new CommonEventListener(subscriber); diff --git a/services/test/unittest/common_event_publish_permission_event_unit_test.cpp b/services/test/unittest/common_event_publish_permission_event_unit_test.cpp index adc76abd17ef338d494fab02ab95439032798879..f3106658442e06b5366760c91260675070778b57 100644 --- a/services/test/unittest/common_event_publish_permission_event_unit_test.cpp +++ b/services/test/unittest/common_event_publish_permission_event_unit_test.cpp @@ -29,10 +29,6 @@ #include "common_event_record.h" #include "common_event_support.h" #include "mock_bundle_manager.h" -#include "iremote_object.h" -#include "iservice_registry.h" -#include "refbase.h" -#include "system_ability_definition.h" #include @@ -87,20 +83,8 @@ public: void CommonEventPublishPermissionEventUnitTest::SetUpTestCase(void) { bundleObject = new OHOS::AppExecFwk::MockBundleMgrService(); - OHOS::DelayedSingleton::GetInstance()->sptrBundleMgr_ = - iface_cast(bundleObject); - - OHOS::DelayedSingleton::GetInstance()->bmsDeath_ = new BMSDeathRecipient(); - if (!OHOS::DelayedSingleton::GetInstance()->bmsDeath_) { - GTEST_LOG_(INFO) << "Failed to create death Recipient ptr BMSDeathRecipient"; - return; - } - if (!OHOS::DelayedSingleton::GetInstance()->sptrBundleMgr_->AsObject()->AddDeathRecipient( - OHOS::DelayedSingleton::GetInstance()->bmsDeath_)) { - GTEST_LOG_(INFO) << "Failed to add death recipient"; - return; - } + OHOS::iface_cast(bundleObject); } void CommonEventPublishPermissionEventUnitTest::TearDownTestCase(void) @@ -129,11 +113,11 @@ HWTEST_F(CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermission /* subscriber */ MatchingSkills matchingSkillsObj; matchingSkillsObj.AddEvent("1234"); - CommonEventSubscribeInfo subscriberInfo(matchingSkillsObj); - subscriberInfo.SetPermission("123"); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + CommonEventSubscribeInfo subscribeInfo(matchingSkillsObj); + subscribeInfo.SetPermission("123"); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); auto listener = sptr(new CommonEventListener(subscriber)); - inner.SubscribeCommonEvent(subscriberInfo, listener, curTime, 0, 1000, "hello"); + inner.SubscribeCommonEvent(subscribeInfo, listener, curTime, 0, 1000, "hello"); /* Publish */ Want want; @@ -167,12 +151,12 @@ HWTEST_F(CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermission struct tm curTime{0}; MatchingSkills matchingSkillsObj; matchingSkillsObj.AddEvent("1234"); - CommonEventSubscribeInfo subscriberInfo(matchingSkillsObj); - subscriberInfo.SetPermission("123"); - subscriberInfo.SetPriority(1); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + CommonEventSubscribeInfo subscribeInfo(matchingSkillsObj); + subscribeInfo.SetPermission("123"); + subscribeInfo.SetPriority(1); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); auto listener = sptr(new CommonEventListener(subscriber)); - inner.SubscribeCommonEvent(subscriberInfo, listener, curTime, 0, 1000, "hello"); + inner.SubscribeCommonEvent(subscribeInfo, listener, curTime, 0, 1000, "hello"); /* Publish */ Want want; @@ -207,12 +191,12 @@ HWTEST_F(CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermission struct tm curTime{0}; MatchingSkills matchingSkillsObj; matchingSkillsObj.AddEvent("1234"); - CommonEventSubscribeInfo subscriberInfo(matchingSkillsObj); - subscriberInfo.SetPermission(""); - subscriberInfo.SetPriority(1); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + CommonEventSubscribeInfo subscribeInfo(matchingSkillsObj); + subscribeInfo.SetPermission(""); + subscribeInfo.SetPriority(1); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); auto listener = sptr(new CommonEventListener(subscriber)); - inner.SubscribeCommonEvent(subscriberInfo, listener, curTime, 0, 1000, "hello"); + inner.SubscribeCommonEvent(subscribeInfo, listener, curTime, 0, 1000, "hello"); /* Publish */ Want want; @@ -247,12 +231,12 @@ HWTEST_F(CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermission struct tm curTime{0}; MatchingSkills matchingSkillsObj; matchingSkillsObj.AddEvent("1234"); - CommonEventSubscribeInfo subscriberInfo(matchingSkillsObj); - subscriberInfo.SetPermission(""); - subscriberInfo.SetPriority(1); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + CommonEventSubscribeInfo subscribeInfo(matchingSkillsObj); + subscribeInfo.SetPermission(""); + subscribeInfo.SetPriority(1); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); auto listener = sptr(new CommonEventListener(subscriber)); - inner.SubscribeCommonEvent(subscriberInfo, listener, curTime, 0, 1000, "hello"); + inner.SubscribeCommonEvent(subscribeInfo, listener, curTime, 0, 1000, "hello"); /* Publish */ Want want; @@ -283,12 +267,12 @@ HWTEST_F(CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermission GTEST_LOG_(INFO) << "CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermissionEventUnitTest_0500, TestSize.Level1"; - CommonEventSubscribeInfo commonEventSubscriberInfo; - commonEventSubscriberInfo.SetPermission(""); - std::shared_ptr commonEventSubscriberInfoSptr = - std::make_shared(commonEventSubscriberInfo); + CommonEventSubscribeInfo commonEventSubscribeInfo; + commonEventSubscribeInfo.SetPermission(""); + std::shared_ptr commonEventSubscribeInfoSptr = + std::make_shared(commonEventSubscribeInfo); EventSubscriberRecord eventSubRecord; - eventSubRecord.eventSubscriberInfo = commonEventSubscriberInfoSptr; + eventSubRecord.eventSubscribeInfo = commonEventSubscribeInfoSptr; eventSubRecord.bundleName = "hello"; CommonEventPublishInfo commonEventPublishInfo; @@ -324,12 +308,12 @@ HWTEST_F(CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermission GTEST_LOG_(INFO) << "CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermissionEventUnitTest_0600, TestSize.Level1"; - CommonEventSubscribeInfo commonEventSubscriberInfo; - commonEventSubscriberInfo.SetPermission("12345"); - std::shared_ptr commonEventSubscriberInfoSptr = - std::make_shared(commonEventSubscriberInfo); + CommonEventSubscribeInfo commonEventSubscribeInfo; + commonEventSubscribeInfo.SetPermission("12345"); + std::shared_ptr commonEventSubscribeInfoSptr = + std::make_shared(commonEventSubscribeInfo); EventSubscriberRecord eventSubRecord; - eventSubRecord.eventSubscriberInfo = commonEventSubscriberInfoSptr; + eventSubRecord.eventSubscribeInfo = commonEventSubscribeInfoSptr; eventSubRecord.bundleName = "hello"; CommonEventPublishInfo commonEventPublishInfo; @@ -365,12 +349,12 @@ HWTEST_F(CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermission GTEST_LOG_(INFO) << "CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermissionEventUnitTest_0700, TestSize.Level1"; - CommonEventSubscribeInfo commonEventSubscriberInfo; - commonEventSubscriberInfo.SetPermission("12345"); - std::shared_ptr commonEventSubscriberInfoSptr = - std::make_shared(commonEventSubscriberInfo); + CommonEventSubscribeInfo commonEventSubscribeInfo; + commonEventSubscribeInfo.SetPermission("12345"); + std::shared_ptr commonEventSubscribeInfoSptr = + std::make_shared(commonEventSubscribeInfo); EventSubscriberRecord eventSubRecord; - eventSubRecord.eventSubscriberInfo = commonEventSubscriberInfoSptr; + eventSubRecord.eventSubscribeInfo = commonEventSubscribeInfoSptr; CommonEventPublishInfo commonEventPublishInfo; commonEventPublishInfo.SetSubscriberPermissions(std::vector()); @@ -404,12 +388,12 @@ HWTEST_F(CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermission GTEST_LOG_(INFO) << "CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermissionEventUnitTest_0800, TestSize.Level1"; - CommonEventSubscribeInfo commonEventSubscriberInfo; - commonEventSubscriberInfo.SetPermission(""); - std::shared_ptr commonEventSubscriberInfoSptr = - std::make_shared(commonEventSubscriberInfo); + CommonEventSubscribeInfo commonEventSubscribeInfo; + commonEventSubscribeInfo.SetPermission(""); + std::shared_ptr commonEventSubscribeInfoSptr = + std::make_shared(commonEventSubscribeInfo); EventSubscriberRecord eventSubRecord; - eventSubRecord.eventSubscriberInfo = commonEventSubscriberInfoSptr; + eventSubRecord.eventSubscribeInfo = commonEventSubscribeInfoSptr; eventSubRecord.bundleName = "hello"; CommonEventPublishInfo commonEventPublishInfo; @@ -444,12 +428,12 @@ HWTEST_F(CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermission GTEST_LOG_(INFO) << "CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermissionEventUnitTest_0900, TestSize.Level1"; - CommonEventSubscribeInfo commonEventSubscriberInfo; - commonEventSubscriberInfo.SetPermission(""); - std::shared_ptr commonEventSubscriberInfoSptr = - std::make_shared(commonEventSubscriberInfo); + CommonEventSubscribeInfo commonEventSubscribeInfo; + commonEventSubscribeInfo.SetPermission(""); + std::shared_ptr commonEventSubscribeInfoSptr = + std::make_shared(commonEventSubscribeInfo); EventSubscriberRecord eventSubRecord; - eventSubRecord.eventSubscriberInfo = commonEventSubscriberInfoSptr; + eventSubRecord.eventSubscribeInfo = commonEventSubscribeInfoSptr; eventSubRecord.bundleName = "hello world"; CommonEventPublishInfo commonEventPublishInfo; @@ -484,12 +468,12 @@ HWTEST_F(CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermission GTEST_LOG_(INFO) << "CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermissionEventUnitTest_1000, TestSize.Level1"; - CommonEventSubscribeInfo commonEventSubscriberInfo; - commonEventSubscriberInfo.SetPermission("12345"); - std::shared_ptr commonEventSubscriberInfoSptr = - std::make_shared(commonEventSubscriberInfo); + CommonEventSubscribeInfo commonEventSubscribeInfo; + commonEventSubscribeInfo.SetPermission("12345"); + std::shared_ptr commonEventSubscribeInfoSptr = + std::make_shared(commonEventSubscribeInfo); EventSubscriberRecord eventSubRecord; - eventSubRecord.eventSubscriberInfo = commonEventSubscriberInfoSptr; + eventSubRecord.eventSubscribeInfo = commonEventSubscribeInfoSptr; eventSubRecord.bundleName = "hello"; CommonEventPublishInfo commonEventPublishInfo; @@ -526,12 +510,12 @@ HWTEST_F(CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermission GTEST_LOG_(INFO) << "CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermissionEventUnitTest_1100, TestSize.Level1"; - CommonEventSubscribeInfo commonEventSubscriberInfo; - commonEventSubscriberInfo.SetPermission("12345"); - std::shared_ptr commonEventSubscriberInfoSptr = - std::make_shared(commonEventSubscriberInfo); + CommonEventSubscribeInfo commonEventSubscribeInfo; + commonEventSubscribeInfo.SetPermission("12345"); + std::shared_ptr commonEventSubscribeInfoSptr = + std::make_shared(commonEventSubscribeInfo); EventSubscriberRecord eventSubRecord; - eventSubRecord.eventSubscriberInfo = commonEventSubscriberInfoSptr; + eventSubRecord.eventSubscribeInfo = commonEventSubscribeInfoSptr; eventSubRecord.bundleName = "hello world"; CommonEventPublishInfo commonEventPublishInfo; @@ -568,12 +552,12 @@ HWTEST_F(CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermission GTEST_LOG_(INFO) << "CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermissionEventUnitTest_1200, TestSize.Level1"; - CommonEventSubscribeInfo commonEventSubscriberInfo; - commonEventSubscriberInfo.SetPermission("12345"); - std::shared_ptr commonEventSubscriberInfoSptr = - std::make_shared(commonEventSubscriberInfo); + CommonEventSubscribeInfo commonEventSubscribeInfo; + commonEventSubscribeInfo.SetPermission("12345"); + std::shared_ptr commonEventSubscribeInfoSptr = + std::make_shared(commonEventSubscribeInfo); EventSubscriberRecord eventSubRecord; - eventSubRecord.eventSubscriberInfo = commonEventSubscriberInfoSptr; + eventSubRecord.eventSubscribeInfo = commonEventSubscribeInfoSptr; eventSubRecord.bundleName = "hello"; CommonEventPublishInfo commonEventPublishInfo; @@ -610,12 +594,12 @@ HWTEST_F(CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermission GTEST_LOG_(INFO) << "CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermissionEventUnitTest_1300, TestSize.Level1"; - CommonEventSubscribeInfo commonEventSubscriberInfo; - commonEventSubscriberInfo.SetPermission("12345"); - std::shared_ptr commonEventSubscriberInfoSptr = - std::make_shared(commonEventSubscriberInfo); + CommonEventSubscribeInfo commonEventSubscribeInfo; + commonEventSubscribeInfo.SetPermission("12345"); + std::shared_ptr commonEventSubscribeInfoSptr = + std::make_shared(commonEventSubscribeInfo); EventSubscriberRecord eventSubRecord; - eventSubRecord.eventSubscriberInfo = commonEventSubscriberInfoSptr; + eventSubRecord.eventSubscribeInfo = commonEventSubscribeInfoSptr; eventSubRecord.bundleName = "hello world"; CommonEventPublishInfo commonEventPublishInfo; @@ -700,12 +684,12 @@ HWTEST_F(CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermission GTEST_LOG_(INFO) << "CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermissionEventUnitTest_1600, TestSize.Level1"; - CommonEventSubscribeInfo commonEventSubscriberInfo; - commonEventSubscriberInfo.SetPermission("ohos.permission.GET_WIFI_INFO"); - std::shared_ptr commonEventSubscriberInfoSptr = - std::make_shared(commonEventSubscriberInfo); + CommonEventSubscribeInfo commonEventSubscribeInfo; + commonEventSubscribeInfo.SetPermission("ohos.permission.GET_WIFI_INFO"); + std::shared_ptr commonEventSubscribeInfoSptr = + std::make_shared(commonEventSubscribeInfo); EventSubscriberRecord eventSubRecord; - eventSubRecord.eventSubscriberInfo = commonEventSubscriberInfoSptr; + eventSubRecord.eventSubscribeInfo = commonEventSubscribeInfoSptr; eventSubRecord.bundleName = "hello"; CommonEventPublishInfo commonEventPublishInfo; @@ -740,12 +724,12 @@ HWTEST_F(CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermission GTEST_LOG_(INFO) << "CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermissionEventUnitTest_1700, TestSize.Level1"; - CommonEventSubscribeInfo commonEventSubscriberInfo; - commonEventSubscriberInfo.SetPermission("1234"); - std::shared_ptr commonEventSubscriberInfoSptr = - std::make_shared(commonEventSubscriberInfo); + CommonEventSubscribeInfo commonEventSubscribeInfo; + commonEventSubscribeInfo.SetPermission("1234"); + std::shared_ptr commonEventSubscribeInfoSptr = + std::make_shared(commonEventSubscribeInfo); EventSubscriberRecord eventSubRecord; - eventSubRecord.eventSubscriberInfo = commonEventSubscriberInfoSptr; + eventSubRecord.eventSubscribeInfo = commonEventSubscribeInfoSptr; eventSubRecord.bundleName = "hello"; CommonEventPublishInfo commonEventPublishInfo; @@ -780,12 +764,12 @@ HWTEST_F(CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermission GTEST_LOG_(INFO) << "CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermissionEventUnitTest_1800, TestSize.Level1"; - CommonEventSubscribeInfo commonEventSubscriberInfo; - commonEventSubscriberInfo.SetPermission("1234"); - std::shared_ptr commonEventSubscriberInfoSptr = - std::make_shared(commonEventSubscriberInfo); + CommonEventSubscribeInfo commonEventSubscribeInfo; + commonEventSubscribeInfo.SetPermission("1234"); + std::shared_ptr commonEventSubscribeInfoSptr = + std::make_shared(commonEventSubscribeInfo); EventSubscriberRecord eventSubRecord; - eventSubRecord.eventSubscriberInfo = commonEventSubscriberInfoSptr; + eventSubRecord.eventSubscribeInfo = commonEventSubscribeInfoSptr; eventSubRecord.bundleName = "hello"; CommonEventPublishInfo commonEventPublishInfo; @@ -820,12 +804,12 @@ HWTEST_F(CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermission GTEST_LOG_(INFO) << "CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermissionEventUnitTest_1900, TestSize.Level1"; - CommonEventSubscribeInfo commonEventSubscriberInfo; - commonEventSubscriberInfo.SetPermission("1234"); - std::shared_ptr commonEventSubscriberInfoSptr = - std::make_shared(commonEventSubscriberInfo); + CommonEventSubscribeInfo commonEventSubscribeInfo; + commonEventSubscribeInfo.SetPermission("1234"); + std::shared_ptr commonEventSubscribeInfoSptr = + std::make_shared(commonEventSubscribeInfo); EventSubscriberRecord eventSubRecord; - eventSubRecord.eventSubscriberInfo = commonEventSubscriberInfoSptr; + eventSubRecord.eventSubscribeInfo = commonEventSubscribeInfoSptr; eventSubRecord.bundleName = "hello"; CommonEventPublishInfo commonEventPublishInfo; @@ -860,12 +844,12 @@ HWTEST_F(CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermission GTEST_LOG_(INFO) << "CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermissionEventUnitTest_2000, TestSize.Level1"; - CommonEventSubscribeInfo commonEventSubscriberInfo; - commonEventSubscriberInfo.SetPermission("1234"); - std::shared_ptr commonEventSubscriberInfoSptr = - std::make_shared(commonEventSubscriberInfo); + CommonEventSubscribeInfo commonEventSubscribeInfo; + commonEventSubscribeInfo.SetPermission("1234"); + std::shared_ptr commonEventSubscribeInfoSptr = + std::make_shared(commonEventSubscribeInfo); EventSubscriberRecord eventSubRecord; - eventSubRecord.eventSubscriberInfo = commonEventSubscriberInfoSptr; + eventSubRecord.eventSubscribeInfo = commonEventSubscribeInfoSptr; eventSubRecord.bundleName = "hello"; CommonEventPublishInfo commonEventPublishInfo; @@ -900,12 +884,12 @@ HWTEST_F(CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermission GTEST_LOG_(INFO) << "CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermissionEventUnitTest_2100, TestSize.Level1"; - CommonEventSubscribeInfo commonEventSubscriberInfo; - commonEventSubscriberInfo.SetPermission("1234"); - std::shared_ptr commonEventSubscriberInfoSptr = - std::make_shared(commonEventSubscriberInfo); + CommonEventSubscribeInfo commonEventSubscribeInfo; + commonEventSubscribeInfo.SetPermission("1234"); + std::shared_ptr commonEventSubscribeInfoSptr = + std::make_shared(commonEventSubscribeInfo); EventSubscriberRecord eventSubRecord; - eventSubRecord.eventSubscriberInfo = commonEventSubscriberInfoSptr; + eventSubRecord.eventSubscribeInfo = commonEventSubscribeInfoSptr; eventSubRecord.bundleName = "hello"; CommonEventPublishInfo commonEventPublishInfo; @@ -1012,12 +996,12 @@ HWTEST_F(CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermission MatchingSkills matchingSkillsObj; // matchingSkillsObj.AddEvent("usual.event.BOOT_COMPLETED"); matchingSkillsObj.AddEvent("usual.event.nfc.action.RF_FIELD_ON_DETECTED"); - CommonEventSubscribeInfo subscriberInfo(matchingSkillsObj); - subscriberInfo.SetPermission("123"); - subscriberInfo.SetPriority(1); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + CommonEventSubscribeInfo subscribeInfo(matchingSkillsObj); + subscribeInfo.SetPermission("123"); + subscribeInfo.SetPriority(1); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); auto listener = sptr(new CommonEventListener(subscriber)); - inner.SubscribeCommonEvent(subscriberInfo, listener, curTime, 0, 1000, "case1"); + inner.SubscribeCommonEvent(subscribeInfo, listener, curTime, 0, 1000, "case1"); /* Publish */ Want want; @@ -1058,12 +1042,12 @@ HWTEST_F(CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermission MatchingSkills matchingSkillsObj; // matchingSkillsObj.AddEvent("usual.event.USER_SWITCHED"); matchingSkillsObj.AddEvent("usual.event.wifi.mplink.STATE_CHANGE"); - CommonEventSubscribeInfo subscriberInfo(matchingSkillsObj); - subscriberInfo.SetPermission(""); - subscriberInfo.SetPriority(1); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + CommonEventSubscribeInfo subscribeInfo(matchingSkillsObj); + subscribeInfo.SetPermission(""); + subscribeInfo.SetPriority(1); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); auto listener = sptr(new CommonEventListener(subscriber)); - inner.SubscribeCommonEvent(subscriberInfo, listener, curTime, 0, 1000, "case2"); + inner.SubscribeCommonEvent(subscribeInfo, listener, curTime, 0, 1000, "case2"); /* Publish */ Want want; @@ -1104,12 +1088,12 @@ HWTEST_F(CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermission MatchingSkills matchingSkillsObj; // matchingSkillsObj.AddEvent("usual.event.wifi.p2p.CONN_STATE_CHANGE"); matchingSkillsObj.AddEvent("usual.event.bluetooth.remotedevice.DISCOVERED"); - CommonEventSubscribeInfo subscriberInfo(matchingSkillsObj); - subscriberInfo.SetPermission(""); - subscriberInfo.SetPriority(1); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + CommonEventSubscribeInfo subscribeInfo(matchingSkillsObj); + subscribeInfo.SetPermission(""); + subscribeInfo.SetPriority(1); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); auto listener = sptr(new CommonEventListener(subscriber)); - inner.SubscribeCommonEvent(subscriberInfo, listener, curTime, 0, 1000, "case3"); + inner.SubscribeCommonEvent(subscribeInfo, listener, curTime, 0, 1000, "case3"); /* Publish */ Want want; @@ -1150,12 +1134,12 @@ HWTEST_F(CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermission MatchingSkills matchingSkillsObj; // matchingSkillsObj.AddEvent("usual.event.data.DISK_REMOVED"); matchingSkillsObj.AddEvent("usual.event.data.DISK_MOUNTED"); - CommonEventSubscribeInfo subscriberInfo(matchingSkillsObj); - subscriberInfo.SetPermission(""); - subscriberInfo.SetPriority(1); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + CommonEventSubscribeInfo subscribeInfo(matchingSkillsObj); + subscribeInfo.SetPermission(""); + subscribeInfo.SetPriority(1); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); auto listener = sptr(new CommonEventListener(subscriber)); - inner.SubscribeCommonEvent(subscriberInfo, listener, curTime, 0, 1000, "case4"); + inner.SubscribeCommonEvent(subscribeInfo, listener, curTime, 0, 1000, "case4"); /* Publish */ Want want; @@ -1195,12 +1179,12 @@ HWTEST_F(CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermission }; MatchingSkills matchingSkillsObj; matchingSkillsObj.AddEvent("common.event.IVI_TEMPERATURE_RECOVERY"); - CommonEventSubscribeInfo subscriberInfo(matchingSkillsObj); - subscriberInfo.SetPermission(""); - subscriberInfo.SetPriority(1); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + CommonEventSubscribeInfo subscribeInfo(matchingSkillsObj); + subscribeInfo.SetPermission(""); + subscribeInfo.SetPriority(1); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); auto listener = sptr(new CommonEventListener(subscriber)); - inner.SubscribeCommonEvent(subscriberInfo, listener, curTime, 0, 1000, "case6"); + inner.SubscribeCommonEvent(subscribeInfo, listener, curTime, 0, 1000, "case6"); /* Publish */ Want want; @@ -1239,12 +1223,12 @@ HWTEST_F(CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermission }; MatchingSkills matchingSkillsObj; matchingSkillsObj.AddEvent("usual.event.BOOT_COMPLETED"); - CommonEventSubscribeInfo subscriberInfo(matchingSkillsObj); - subscriberInfo.SetPermission("123"); - subscriberInfo.SetPriority(1); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + CommonEventSubscribeInfo subscribeInfo(matchingSkillsObj); + subscribeInfo.SetPermission("123"); + subscribeInfo.SetPriority(1); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); auto listener = sptr(new CommonEventListener(subscriber)); - inner.SubscribeCommonEvent(subscriberInfo, listener, curTime, 0, 1000, "case1"); + inner.SubscribeCommonEvent(subscribeInfo, listener, curTime, 0, 1000, "case1"); /* Publish */ Want want; @@ -1283,12 +1267,12 @@ HWTEST_F(CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermission }; MatchingSkills matchingSkillsObj; matchingSkillsObj.AddEvent("usual.event.USER_SWITCHED"); - CommonEventSubscribeInfo subscriberInfo(matchingSkillsObj); - subscriberInfo.SetPermission(""); - subscriberInfo.SetPriority(1); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + CommonEventSubscribeInfo subscribeInfo(matchingSkillsObj); + subscribeInfo.SetPermission(""); + subscribeInfo.SetPriority(1); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); auto listener = sptr(new CommonEventListener(subscriber)); - inner.SubscribeCommonEvent(subscriberInfo, listener, curTime, 0, 1000, "case2"); + inner.SubscribeCommonEvent(subscribeInfo, listener, curTime, 0, 1000, "case2"); /* Publish */ Want want; @@ -1327,12 +1311,12 @@ HWTEST_F(CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermission }; MatchingSkills matchingSkillsObj; matchingSkillsObj.AddEvent("usual.event.wifi.p2p.CONN_STATE_CHANGE"); - CommonEventSubscribeInfo subscriberInfo(matchingSkillsObj); - subscriberInfo.SetPermission(""); - subscriberInfo.SetPriority(1); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + CommonEventSubscribeInfo subscribeInfo(matchingSkillsObj); + subscribeInfo.SetPermission(""); + subscribeInfo.SetPriority(1); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); auto listener = sptr(new CommonEventListener(subscriber)); - inner.SubscribeCommonEvent(subscriberInfo, listener, curTime, 0, 1000, "case3"); + inner.SubscribeCommonEvent(subscribeInfo, listener, curTime, 0, 1000, "case3"); /* Publish */ Want want; @@ -1371,12 +1355,12 @@ HWTEST_F(CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermission }; MatchingSkills matchingSkillsObj; matchingSkillsObj.AddEvent("usual.event.data.DISK_REMOVED"); - CommonEventSubscribeInfo subscriberInfo(matchingSkillsObj); - subscriberInfo.SetPermission(""); - subscriberInfo.SetPriority(1); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + CommonEventSubscribeInfo subscribeInfo(matchingSkillsObj); + subscribeInfo.SetPermission(""); + subscribeInfo.SetPriority(1); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); auto listener = sptr(new CommonEventListener(subscriber)); - inner.SubscribeCommonEvent(subscriberInfo, listener, curTime, 0, 1000, "case4"); + inner.SubscribeCommonEvent(subscribeInfo, listener, curTime, 0, 1000, "case4"); /* Publish */ Want want; @@ -1415,12 +1399,12 @@ HWTEST_F(CommonEventPublishPermissionEventUnitTest, CommonEventPublishPermission }; MatchingSkills matchingSkillsObj; matchingSkillsObj.AddEvent("common.event.IVI_TEMPERATURE_RECOVERY"); - CommonEventSubscribeInfo subscriberInfo(matchingSkillsObj); - subscriberInfo.SetPermission(""); - subscriberInfo.SetPriority(1); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + CommonEventSubscribeInfo subscribeInfo(matchingSkillsObj); + subscribeInfo.SetPermission(""); + subscribeInfo.SetPriority(1); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); auto listener = sptr(new CommonEventListener(subscriber)); - inner.SubscribeCommonEvent(subscriberInfo, listener, curTime, 0, 1000, "case6"); + inner.SubscribeCommonEvent(subscribeInfo, listener, curTime, 0, 1000, "case6"); /* Publish */ Want want; diff --git a/services/test/unittest/common_event_publish_system_event_test.cpp b/services/test/unittest/common_event_publish_system_event_test.cpp index 3d7f682f50477450aacdd5ae8278e36432fccc1a..f37fe4e2ff71fbaf13def26cfb02914e903a6c97 100644 --- a/services/test/unittest/common_event_publish_system_event_test.cpp +++ b/services/test/unittest/common_event_publish_system_event_test.cpp @@ -18,12 +18,11 @@ #include "bundle_manager_helper.h" #undef private #undef protected + #include "common_event.h" #include "common_event_support.h" #include "inner_common_event_manager.h" -#include "iservice_registry.h" #include "mock_bundle_manager.h" -#include "system_ability_definition.h" #include @@ -55,20 +54,8 @@ public: void CommonEventPublishSystemEventTest::SetUpTestCase(void) { bundleObject = new OHOS::AppExecFwk::MockBundleMgrService(); - OHOS::DelayedSingleton::GetInstance()->sptrBundleMgr_ = - OHOS::iface_cast(bundleObject); - - OHOS::DelayedSingleton::GetInstance()->bmsDeath_ = new BMSDeathRecipient(); - if (!OHOS::DelayedSingleton::GetInstance()->bmsDeath_) { - GTEST_LOG_(INFO) << "Failed to create death Recipient ptr BMSDeathRecipient"; - return; - } - if (!OHOS::DelayedSingleton::GetInstance()->sptrBundleMgr_->AsObject()->AddDeathRecipient( - OHOS::DelayedSingleton::GetInstance()->bmsDeath_)) { - GTEST_LOG_(INFO) << "Failed to add death recipient"; - return; - } + OHOS::iface_cast(bundleObject); } void CommonEventPublishSystemEventTest::TearDownTestCase(void) diff --git a/services/test/unittest/common_event_sticky_test.cpp b/services/test/unittest/common_event_sticky_test.cpp index 20b33a436ce203108cf82fdd45455f3e60a7991f..d679f6e93cfc8ac97666682c510020f4eb80aa0e 100644 --- a/services/test/unittest/common_event_sticky_test.cpp +++ b/services/test/unittest/common_event_sticky_test.cpp @@ -27,9 +27,7 @@ #include "errors.h" #include "inner_common_event_manager.h" -#include "iservice_registry.h" #include "mock_bundle_manager.h" -#include "system_ability_definition.h" #include @@ -79,20 +77,8 @@ public: void CommonEventStickyTest::SetUpTestCase(void) { bundleObject = new OHOS::AppExecFwk::MockBundleMgrService(); - OHOS::DelayedSingleton::GetInstance()->sptrBundleMgr_ = - OHOS::iface_cast(bundleObject); - - OHOS::DelayedSingleton::GetInstance()->bmsDeath_ = new BMSDeathRecipient(); - if (!OHOS::DelayedSingleton::GetInstance()->bmsDeath_) { - GTEST_LOG_(INFO) << "Failed to create death Recipient ptr BMSDeathRecipient"; - return; - } - if (!OHOS::DelayedSingleton::GetInstance()->sptrBundleMgr_->AsObject()->AddDeathRecipient( - OHOS::DelayedSingleton::GetInstance()->bmsDeath_)) { - GTEST_LOG_(INFO) << "Failed to add death recipient"; - return; - } + OHOS::iface_cast(bundleObject); } void CommonEventStickyTest::TearDownTestCase(void) @@ -310,8 +296,8 @@ HWTEST_F(CommonEventStickyTest, FindStickyEvents_0700, TestSize.Level0) matchingSkills.AddEvent(STRING_EVENT); // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - auto subscriberInfoPtr = std::make_shared(subscriberInfo); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + auto subscribeInfoPtr = std::make_shared(subscribeInfo); // make a vector of records std::vector> records; @@ -319,7 +305,7 @@ HWTEST_F(CommonEventStickyTest, FindStickyEvents_0700, TestSize.Level0) // get common event sticky manager auto stickyManagerPtr = OHOS::DelayedSingleton::GetInstance(); // find sticky events - int result = stickyManagerPtr->FindStickyEvents(subscriberInfoPtr, records); + int result = stickyManagerPtr->FindStickyEvents(subscribeInfoPtr, records); // check result of finding sticky events EXPECT_EQ(result, OHOS::ERR_OK); } @@ -336,8 +322,8 @@ HWTEST_F(CommonEventStickyTest, FindStickyEvents_0800, TestSize.Level0) matchingSkills.AddEvent(STRING_EVENT); // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - auto subscriberInfoPtr = std::make_shared(subscriberInfo); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + auto subscribeInfoPtr = std::make_shared(subscribeInfo); // make a vector of records std::vector> records; @@ -367,7 +353,7 @@ HWTEST_F(CommonEventStickyTest, FindStickyEvents_0800, TestSize.Level0) stickyManagerPtr->commonEventRecords_[STRING_EVENT] = recordPtr; // find sticky events - int result = stickyManagerPtr->FindStickyEvents(subscriberInfoPtr, records); + int result = stickyManagerPtr->FindStickyEvents(subscribeInfoPtr, records); // check result of finding sticky events EXPECT_EQ(result, OHOS::ERR_OK); // check size of the records diff --git a/services/test/unittest/common_event_subscribe_unit_test.cpp b/services/test/unittest/common_event_subscribe_unit_test.cpp index 04950a0bfb0444a22fd91959f7abd25a2b92b542..4d0ac46a388ea77c28c8f4af9058646731fa69ab 100644 --- a/services/test/unittest/common_event_subscribe_unit_test.cpp +++ b/services/test/unittest/common_event_subscribe_unit_test.cpp @@ -21,9 +21,7 @@ #undef private #undef protected -#include "iservice_registry.h" #include "mock_bundle_manager.h" -#include "system_ability_definition.h" #include @@ -76,7 +74,7 @@ public: } virtual bool SubscribeCommonEvent( - const CommonEventSubscribeInfo &subscriberInfo, const OHOS::sptr &commonEventListener) + const CommonEventSubscribeInfo &subscribeInfo, const OHOS::sptr &commonEventListener) { return false; } @@ -116,20 +114,8 @@ public: void CommonEventSubscribeUnitTest::SetUpTestCase(void) { bundleObject = new OHOS::AppExecFwk::MockBundleMgrService(); - OHOS::DelayedSingleton::GetInstance()->sptrBundleMgr_ = OHOS::iface_cast(bundleObject); - - OHOS::DelayedSingleton::GetInstance()->bmsDeath_ = new BMSDeathRecipient(); - if (!OHOS::DelayedSingleton::GetInstance()->bmsDeath_) { - GTEST_LOG_(INFO) << "Failed to create death Recipient ptr BMSDeathRecipient"; - return; - } - if (!OHOS::DelayedSingleton::GetInstance()->sptrBundleMgr_->AsObject()->AddDeathRecipient( - OHOS::DelayedSingleton::GetInstance()->bmsDeath_)) { - GTEST_LOG_(INFO) << "Failed to add death recipient"; - return; - } } void CommonEventSubscribeUnitTest::TearDownTestCase(void) @@ -159,20 +145,20 @@ HWTEST_F(CommonEventSubscribeUnitTest, CommonEventSubscribeUnitTest_0100, Functi matchingSkills.AddScheme(SCHEME); // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - subscriberInfo.SetPriority(PRIORITY); - subscriberInfo.SetPermission(PERMISSION); - subscriberInfo.SetDeviceId(DEVICEDID); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + subscribeInfo.SetPriority(PRIORITY); + subscribeInfo.SetPermission(PERMISSION); + subscribeInfo.SetDeviceId(DEVICEDID); // make subscriber - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); // make common event listner CommonEventListener *listener = new CommonEventListener(subscriber); // SubscribeCommonEvent bool result = OHOS::DelayedSingleton::GetInstance()->SubscribeCommonEvent( - subscriberInfo, listener->AsObject()); + subscribeInfo, listener->AsObject()); EXPECT_EQ(true, result); } @@ -193,20 +179,20 @@ HWTEST_F(CommonEventSubscribeUnitTest, CommonEventSubscribeUnitTest_0200, Functi matchingSkills.AddScheme(SCHEME); // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - subscriberInfo.SetPriority(PRIORITY); - subscriberInfo.SetPermission(PERMISSION); - subscriberInfo.SetDeviceId(DEVICEDID); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + subscribeInfo.SetPriority(PRIORITY); + subscribeInfo.SetPermission(PERMISSION); + subscribeInfo.SetDeviceId(DEVICEDID); // make subscriber - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); // make common event listner CommonEventListener *listener = new CommonEventListener(subscriber); // SubscribeCommonEvent bool result = OHOS::DelayedSingleton::GetInstance()->SubscribeCommonEvent( - subscriberInfo, listener->AsObject()); + subscribeInfo, listener->AsObject()); EXPECT_EQ(false, result); } @@ -220,10 +206,10 @@ HWTEST_F(CommonEventSubscribeUnitTest, CommonEventSubscribeUnitTest_0300, Functi // make subcriber info MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENT); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // make subscriber - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); // make common event listner OHOS::sptr commonEventListener = new CommonEventListener(subscriber); @@ -233,22 +219,22 @@ HWTEST_F(CommonEventSubscribeUnitTest, CommonEventSubscribeUnitTest_0300, Functi struct tm curTime{0}; InnerCommonEventManager innerCommonEventManager; EXPECT_EQ( - true, innerCommonEventManager.SubscribeCommonEvent(subscriberInfo, commonEventListenerPtr, curTime, 0, 0, "")); + true, innerCommonEventManager.SubscribeCommonEvent(subscribeInfo, commonEventListenerPtr, curTime, 0, 0, "")); } /* * @tc.number: CommonEventSubscribeUnitTest_0400 * @tc.name: test subscribe event - * @tc.desc: InnerCommonEventManager subscribe common event fail because subscriberInfo has not event + * @tc.desc: InnerCommonEventManager subscribe common event fail because subscribeInfo has not event */ HWTEST_F(CommonEventSubscribeUnitTest, CommonEventSubscribeUnitTest_0400, Function | MediumTest | Level1) { // make subcriber info MatchingSkills matchingSkills; - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // make subscriber - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); // make common event listner OHOS::sptr commonEventListener = new CommonEventListener(subscriber); @@ -258,7 +244,7 @@ HWTEST_F(CommonEventSubscribeUnitTest, CommonEventSubscribeUnitTest_0400, Functi InnerCommonEventManager innerCommonEventManager; struct tm curTime{0}; EXPECT_EQ( - false, innerCommonEventManager.SubscribeCommonEvent(subscriberInfo, commonEventListenerPtr, curTime, 0, 0, "")); + false, innerCommonEventManager.SubscribeCommonEvent(subscribeInfo, commonEventListenerPtr, curTime, 0, 0, "")); } /* @@ -273,13 +259,13 @@ HWTEST_F(CommonEventSubscribeUnitTest, CommonEventSubscribeUnitTest_0500, Functi // make subcriber info MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENT); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // SubscribeCommonEvent InnerCommonEventManager innerCommonEventManager; OHOS::sptr sp(nullptr); struct tm curTime; - EXPECT_EQ(false, innerCommonEventManager.SubscribeCommonEvent(subscriberInfo, sp, curTime, 0, 0, "")); + EXPECT_EQ(false, innerCommonEventManager.SubscribeCommonEvent(subscribeInfo, sp, curTime, 0, 0, "")); } /* @@ -292,12 +278,12 @@ HWTEST_F(CommonEventSubscribeUnitTest, CommonEventSubscribeUnitTest_0600, Functi // make subcriber info MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENT); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); std::shared_ptr subscribeInfoPtr = - std::make_shared(subscriberInfo); + std::make_shared(subscribeInfo); // make subscriber - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); // make common event listner OHOS::sptr commonEventListener = new CommonEventListener(subscriber); @@ -323,10 +309,10 @@ HWTEST_F(CommonEventSubscribeUnitTest, CommonEventSubscribeUnitTest_0700, Functi // make subcriber info MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENT); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // make subscriber - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); // make common event listener OHOS::sptr commonEventListener = new CommonEventListener(subscriber); @@ -352,12 +338,12 @@ HWTEST_F(CommonEventSubscribeUnitTest, CommonEventSubscribeUnitTest_0800, Functi // make subcriber info MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENT); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); std::shared_ptr subscribeInfoPtr = - std::make_shared(subscriberInfo); + std::make_shared(subscribeInfo); // make subcriber - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); // InsertSubscriber struct tm curTime{0}; @@ -377,13 +363,13 @@ HWTEST_F(CommonEventSubscribeUnitTest, CommonEventSubscribeUnitTest_0900, Functi { // make subcriber info MatchingSkills matchingSkills; - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); std::shared_ptr subscribeInfoPtr = - std::make_shared(subscriberInfo); + std::make_shared(subscribeInfo); // make subscriber CommonEventStubTest CommonEventStubTest; - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); // make commone event listener OHOS::sptr commonEventListener = new CommonEventListener(subscriber); @@ -409,22 +395,22 @@ HWTEST_F(CommonEventSubscribeUnitTest, CommonEventSubscribeUnitTest_1000, Functi MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENT); matchingSkills.AddEvent(ENTITY); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // make subcriber - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); // make commone event listener OHOS::sptr commonEventListener = new CommonEventListener(subscriber); OHOS::sptr commonEventListenerPtr(commonEventListener); // make events - std::vector events = subscriberInfo.GetMatchingSkills().GetEvents(); + std::vector events = subscribeInfo.GetMatchingSkills().GetEvents(); // make record struct tm recordTime{0}; auto record = std::make_shared(); - record->eventSubscriberInfo = std::make_shared(subscriberInfo); + record->eventSubscribeInfo = std::make_shared(subscribeInfo); record->commonEventListener = commonEventListenerPtr; record->recordTime = recordTime; record->pid = 0; @@ -446,22 +432,22 @@ HWTEST_F(CommonEventSubscribeUnitTest, CommonEventSubscribeUnitTest_1100, Functi { // make subcriber info MatchingSkills matchingSkills; - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // make subcriber - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); // make commone event listener OHOS::sptr commonEventListener = new CommonEventListener(subscriber); OHOS::sptr commonEventListenerPtr(commonEventListener); // make events - std::vector events = subscriberInfo.GetMatchingSkills().GetEvents(); + std::vector events = subscribeInfo.GetMatchingSkills().GetEvents(); // make record struct tm recordTime{0}; auto record = std::make_shared(); - record->eventSubscriberInfo = std::make_shared(subscriberInfo); + record->eventSubscribeInfo = std::make_shared(subscribeInfo); record->commonEventListener = commonEventListenerPtr; record->recordTime = recordTime; record->pid = 0; @@ -483,10 +469,10 @@ HWTEST_F(CommonEventSubscribeUnitTest, CommonEventSubscribeUnitTest_1200, Functi { // make subcriber info MatchingSkills matchingSkills; - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // make events - std::vector events = subscriberInfo.GetMatchingSkills().GetEvents(); + std::vector events = subscribeInfo.GetMatchingSkills().GetEvents(); CommonEventSubscriberManager commonEventSubscriberManager; // InsertSubscriberRecordLocked diff --git a/services/test/unittest/common_event_unsubscribe_unit_test.cpp b/services/test/unittest/common_event_unsubscribe_unit_test.cpp index 95da9972f3baef055fc0eabfbe094afa9320a82c..8bfb4d998fc7094f1dc5c1381ee9686c08f277fa 100644 --- a/services/test/unittest/common_event_unsubscribe_unit_test.cpp +++ b/services/test/unittest/common_event_unsubscribe_unit_test.cpp @@ -23,9 +23,7 @@ #undef private #undef protected -#include "iservice_registry.h" #include "mock_bundle_manager.h" -#include "system_ability_definition.h" #include @@ -70,20 +68,8 @@ public: void CommonEventUnSubscribeUnitTest::SetUpTestCase(void) { bundleObject = new OHOS::AppExecFwk::MockBundleMgrService(); - OHOS::DelayedSingleton::GetInstance()->sptrBundleMgr_ = OHOS::iface_cast(bundleObject); - - OHOS::DelayedSingleton::GetInstance()->bmsDeath_ = new BMSDeathRecipient(); - if (!OHOS::DelayedSingleton::GetInstance()->bmsDeath_) { - GTEST_LOG_(INFO) << "Failed to create death Recipient ptr BMSDeathRecipient"; - return; - } - if (!OHOS::DelayedSingleton::GetInstance()->sptrBundleMgr_->AsObject()->AddDeathRecipient( - OHOS::DelayedSingleton::GetInstance()->bmsDeath_)) { - GTEST_LOG_(INFO) << "Failed to add death recipient"; - return; - } } void CommonEventUnSubscribeUnitTest::TearDownTestCase(void) @@ -113,13 +99,13 @@ HWTEST_F(CommonEventUnSubscribeUnitTest, CommonEventUnSubscribeUnitTest_0100, Fu matchingSkills.AddScheme(SCHEME); // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - subscriberInfo.SetPriority(PRIORITY); - subscriberInfo.SetPermission(PERMISSION); - subscriberInfo.SetDeviceId(DEVICEDID); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + subscribeInfo.SetPriority(PRIORITY); + subscribeInfo.SetPermission(PERMISSION); + subscribeInfo.SetDeviceId(DEVICEDID); // make subscriber - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); // make common event listner CommonEventListener *listener = new CommonEventListener(subscriber); @@ -147,13 +133,13 @@ HWTEST_F(CommonEventUnSubscribeUnitTest, CommonEventUnSubscribeUnitTest_0200, Fu matchingSkills.AddScheme(SCHEME); // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - subscriberInfo.SetPriority(PRIORITY); - subscriberInfo.SetPermission(PERMISSION); - subscriberInfo.SetDeviceId(DEVICEDID); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + subscribeInfo.SetPriority(PRIORITY); + subscribeInfo.SetPermission(PERMISSION); + subscribeInfo.SetDeviceId(DEVICEDID); // make subscriber - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); // make common event listner CommonEventListener *listener = new CommonEventListener(subscriber); @@ -173,10 +159,10 @@ HWTEST_F(CommonEventUnSubscribeUnitTest, CommonEventUnSubscribeUnitTest_0300, Fu // make subcriber info MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENT); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // make subscriber - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); // make common event listner OHOS::sptr commonEventListener = new CommonEventListener(subscriber); @@ -210,10 +196,10 @@ HWTEST_F(CommonEventUnSubscribeUnitTest, CommonEventUnSubscribeUnitTest_0500, Fu // make subcriber info MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENT); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // make subscriber - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); // make common event listner OHOS::sptr commonEventListener = new CommonEventListener(subscriber); @@ -251,13 +237,13 @@ HWTEST_F(CommonEventUnSubscribeUnitTest, CommonEventUnSubscribeUnitTest_0700, Fu matchingSkills.AddScheme(SCHEME); // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - subscriberInfo.SetPriority(PRIORITY); - subscriberInfo.SetPermission(PERMISSION); - subscriberInfo.SetDeviceId(DEVICEDID); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + subscribeInfo.SetPriority(PRIORITY); + subscribeInfo.SetPermission(PERMISSION); + subscribeInfo.SetDeviceId(DEVICEDID); // make a subcriber - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); // make common event listner OHOS::sptr commonEventListener = new CommonEventListener(subscriber); @@ -277,10 +263,10 @@ HWTEST_F(CommonEventUnSubscribeUnitTest, CommonEventUnSubscribeUnitTest_0800, Fu { // make subcriber info MatchingSkills matchingSkills; - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // make subcriber - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); // make commone event listener OHOS::sptr commonEventListener = new CommonEventListener(subscriber); @@ -300,10 +286,10 @@ HWTEST_F(CommonEventUnSubscribeUnitTest, CommonEventUnSubscribeUnitTest_0900, Fu { // make subcriber info MatchingSkills matchingSkills; - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // make subcriber - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); // make commone event listener OHOS::sptr commonEventListener = new CommonEventListener(subscriber); diff --git a/services/test/unittest/mock/src/iservice_registry.cpp b/services/test/unittest/mock/src/iservice_registry.cpp deleted file mode 100644 index b2bd89696ff8658aaed4ef5387be26962ac6e8b6..0000000000000000000000000000000000000000 --- a/services/test/unittest/mock/src/iservice_registry.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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. - */ - -#include "hilog_wrapper.h" -#include "iservice_registry.h" -#include "system_ability_manager.h" - -namespace OHOS { -SystemAbilityManagerClient &SystemAbilityManagerClient::GetInstance() -{ - HILOG_ERROR(" SystemAbilityManagerClient::GetInstance()"); - static auto instance = new SystemAbilityManagerClient(); - return *instance; -} - -sptr SystemAbilityManagerClient::GetRegistryRemoteObject() -{ - HILOG_ERROR("SystemAbilityManagerClient::GetRegistryRemoteObject()"); - return nullptr; -} - -void SystemAbilityManagerClient::DestroySystemAbilityManagerObject() -{ - HILOG_ERROR("SystemAbilityManagerClient::DestroySystemAbilityManagerObject()"); -} -} // namespace OHOS diff --git a/test/systemtest/common/acts/actsCESCESpublishInfoTest/actsCESCESpublishInfoTest.cpp b/test/systemtest/common/acts/actsCESCESpublishInfoTest/actsCESCESpublishInfoTest.cpp index b600c118c274e92da712018db7190c02df3cd2ec..ce31bd3501675568fc01875d9ed08bbd33fc6ab0 100644 --- a/test/systemtest/common/acts/actsCESCESpublishInfoTest/actsCESCESpublishInfoTest.cpp +++ b/test/systemtest/common/acts/actsCESCESpublishInfoTest/actsCESCESpublishInfoTest.cpp @@ -31,13 +31,13 @@ namespace EventFwk { class ActsCommonEventServicesSystemTest : public CommonEventSubscriber { public: - explicit ActsCommonEventServicesSystemTest(const CommonEventSubscribeInfo &subscriberInfo); + explicit ActsCommonEventServicesSystemTest(const CommonEventSubscribeInfo &subscribeInfo); virtual ~ActsCommonEventServicesSystemTest(){}; virtual void OnReceiveEvent(const CommonEventData &data); }; -ActsCommonEventServicesSystemTest::ActsCommonEventServicesSystemTest(const CommonEventSubscribeInfo &subscriberInfo) - : CommonEventSubscriber(subscriberInfo) +ActsCommonEventServicesSystemTest::ActsCommonEventServicesSystemTest(const CommonEventSubscribeInfo &subscribeInfo) + : CommonEventSubscriber(subscribeInfo) {} void ActsCommonEventServicesSystemTest::OnReceiveEvent(const CommonEventData &data) diff --git a/test/systemtest/common/acts/actsCESDataTest/actsCESDataTest.cpp b/test/systemtest/common/acts/actsCESDataTest/actsCESDataTest.cpp index e61c0714f44ec1568f257c406297347e1c403938..4429fd1dd765f5649d97624fa383c960319b71be 100755 --- a/test/systemtest/common/acts/actsCESDataTest/actsCESDataTest.cpp +++ b/test/systemtest/common/acts/actsCESDataTest/actsCESDataTest.cpp @@ -164,7 +164,7 @@ public: class SubscriberFirstTest : public CommonEventSubscriber { public: - explicit SubscriberFirstTest(const CommonEventSubscribeInfo &subscriberInfo) : CommonEventSubscriber(subscriberInfo) + explicit SubscriberFirstTest(const CommonEventSubscribeInfo &subscribeInfo) : CommonEventSubscriber(subscribeInfo) {} ~SubscriberFirstTest() @@ -375,8 +375,8 @@ private: class SubscriberSecondTest : public CommonEventSubscriber { public: - explicit SubscriberSecondTest(const CommonEventSubscribeInfo &subscriberInfo) - : CommonEventSubscriber(subscriberInfo) + explicit SubscriberSecondTest(const CommonEventSubscribeInfo &subscribeInfo) + : CommonEventSubscriber(subscribeInfo) {} ~SubscriberSecondTest() @@ -535,7 +535,7 @@ private: class SubscriberThirdTest : public CommonEventSubscriber { public: - explicit SubscriberThirdTest(const CommonEventSubscribeInfo &subscriberInfo) : CommonEventSubscriber(subscriberInfo) + explicit SubscriberThirdTest(const CommonEventSubscribeInfo &subscribeInfo) : CommonEventSubscriber(subscribeInfo) {} ~SubscriberThirdTest() @@ -694,8 +694,8 @@ private: class SubscriberPublishTest : public CommonEventSubscriber { public: - explicit SubscriberPublishTest(const CommonEventSubscribeInfo &subscriberInfo) - : CommonEventSubscriber(subscriberInfo) + explicit SubscriberPublishTest(const CommonEventSubscribeInfo &subscribeInfo) + : CommonEventSubscriber(subscribeInfo) {} ~SubscriberPublishTest() @@ -733,9 +733,9 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeData_0100, Function | MediumTe MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE1); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -743,10 +743,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeData_0100, Function | MediumTe MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE1); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -754,10 +754,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeData_0100, Function | MediumTe MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE1); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -777,7 +777,7 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeData_0100, Function | MediumTe publishInfo.SetOrdered(true); std::shared_ptr subscriberPublishTest = - std::make_shared(subscriberInfo); + std::make_shared(subscribeInfo); bool publishResult = CommonEventManager::PublishCommonEvent(data, publishInfo, subscriberPublishTest); Delay(1); EXPECT_TRUE(publishResult); @@ -799,9 +799,9 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeData_0200, Function | MediumTe MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE2); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -809,10 +809,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeData_0200, Function | MediumTe MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE2); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -820,10 +820,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeData_0200, Function | MediumTe MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE2); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -843,7 +843,7 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeData_0200, Function | MediumTe publishInfo.SetOrdered(true); std::shared_ptr subscriberPublishTest = - std::make_shared(subscriberInfo); + std::make_shared(subscribeInfo); bool publishResult = CommonEventManager::PublishCommonEvent(data, publishInfo, subscriberPublishTest); Delay(1); EXPECT_TRUE(publishResult); @@ -865,10 +865,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeData_0300, Function | MediumTe MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE3); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - subscriberInfo.SetPriority(LOWPRIORITY); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + subscribeInfo.SetPriority(LOWPRIORITY); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -876,11 +876,11 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeData_0300, Function | MediumTe MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE3); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); - subscriberInfoSecond.SetPriority(MIDPRIORITY); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); + subscribeInfoSecond.SetPriority(MIDPRIORITY); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -888,11 +888,11 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeData_0300, Function | MediumTe MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE3); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); - subscriberInfoThird.SetPriority(HIGHPRIORITY); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); + subscribeInfoThird.SetPriority(HIGHPRIORITY); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -912,7 +912,7 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeData_0300, Function | MediumTe publishInfo.SetOrdered(true); std::shared_ptr subscriberPublishTest = - std::make_shared(subscriberInfo); + std::make_shared(subscribeInfo); bool publishResult = CommonEventManager::PublishCommonEvent(data, publishInfo, subscriberPublishTest); Delay(1); EXPECT_TRUE(publishResult); @@ -934,10 +934,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeData_0400, Function | MediumTe MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE4); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - subscriberInfo.SetPriority(LOWPRIORITY); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + subscribeInfo.SetPriority(LOWPRIORITY); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -945,11 +945,11 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeData_0400, Function | MediumTe MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE4); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); - subscriberInfoSecond.SetPriority(MIDPRIORITY); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); + subscribeInfoSecond.SetPriority(MIDPRIORITY); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -957,11 +957,11 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeData_0400, Function | MediumTe MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE4); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); - subscriberInfoThird.SetPriority(HIGHPRIORITY); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); + subscribeInfoThird.SetPriority(HIGHPRIORITY); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -981,7 +981,7 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeData_0400, Function | MediumTe publishInfo.SetOrdered(true); std::shared_ptr subscriberPublishTest = - std::make_shared(subscriberInfo); + std::make_shared(subscribeInfo); bool publishResult = CommonEventManager::PublishCommonEvent(data, publishInfo, subscriberPublishTest); Delay(1); EXPECT_TRUE(publishResult); @@ -1003,10 +1003,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeData_0500, Function | MediumTe MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE5); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - subscriberInfo.SetPriority(LOWPRIORITY); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + subscribeInfo.SetPriority(LOWPRIORITY); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -1014,11 +1014,11 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeData_0500, Function | MediumTe MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE5); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); - subscriberInfoSecond.SetPriority(MIDPRIORITY); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); + subscribeInfoSecond.SetPriority(MIDPRIORITY); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -1026,11 +1026,11 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeData_0500, Function | MediumTe MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE5); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); - subscriberInfoThird.SetPriority(HIGHPRIORITY); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); + subscribeInfoThird.SetPriority(HIGHPRIORITY); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -1050,7 +1050,7 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeData_0500, Function | MediumTe publishInfo.SetOrdered(true); std::shared_ptr subscriberPublishTest = - std::make_shared(subscriberInfo); + std::make_shared(subscribeInfo); bool publishResult = CommonEventManager::PublishCommonEvent(data, publishInfo, subscriberPublishTest); Delay(1); EXPECT_TRUE(publishResult); @@ -1072,9 +1072,9 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeData_0600, Function | MediumTe MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE6); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -1082,10 +1082,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeData_0600, Function | MediumTe MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE6); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -1093,10 +1093,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeData_0600, Function | MediumTe MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE6); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -1116,7 +1116,7 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeData_0600, Function | MediumTe publishInfo.SetOrdered(true); std::shared_ptr subscriberPublishTest = - std::make_shared(subscriberInfo); + std::make_shared(subscribeInfo); bool publishResult = CommonEventManager::PublishCommonEvent(data, publishInfo, subscriberPublishTest); Delay(1); EXPECT_TRUE(publishResult); @@ -1138,10 +1138,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeData_0700, Function | MediumTe MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE7); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - subscriberInfo.SetPriority(LOWPRIORITY); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + subscribeInfo.SetPriority(LOWPRIORITY); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -1149,11 +1149,11 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeData_0700, Function | MediumTe MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE7); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); - subscriberInfoSecond.SetPriority(MIDPRIORITY); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); + subscribeInfoSecond.SetPriority(MIDPRIORITY); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -1161,11 +1161,11 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeData_0700, Function | MediumTe MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE7); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); - subscriberInfoThird.SetPriority(HIGHPRIORITY); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); + subscribeInfoThird.SetPriority(HIGHPRIORITY); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -1185,7 +1185,7 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeData_0700, Function | MediumTe publishInfo.SetOrdered(true); std::shared_ptr subscriberPublishTest = - std::make_shared(subscriberInfo); + std::make_shared(subscribeInfo); bool publishResult = CommonEventManager::PublishCommonEvent(data, publishInfo, subscriberPublishTest); Delay(1); EXPECT_TRUE(publishResult); @@ -1398,9 +1398,9 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_0100, Function | MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE8); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -1408,10 +1408,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_0100, Function | MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE8); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -1419,10 +1419,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_0100, Function | MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE8); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -1439,7 +1439,7 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_0100, Function | publishInfo.SetOrdered(true); std::shared_ptr subscriberPublishTest = - std::make_shared(subscriberInfo); + std::make_shared(subscribeInfo); bool publishResult = CommonEventManager::PublishCommonEvent(data, publishInfo, subscriberPublishTest); Delay(1); EXPECT_TRUE(publishResult); @@ -1458,9 +1458,9 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_0200, Function | MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE9); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -1468,10 +1468,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_0200, Function | MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE9); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -1479,10 +1479,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_0200, Function | MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE9); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -1499,7 +1499,7 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_0200, Function | publishInfo.SetOrdered(true); std::shared_ptr subscriberPublishTest = - std::make_shared(subscriberInfo); + std::make_shared(subscribeInfo); bool publishResult = CommonEventManager::PublishCommonEvent(data, publishInfo, subscriberPublishTest); Delay(1); EXPECT_TRUE(publishResult); @@ -1518,9 +1518,9 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_0300, Function | MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE10); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -1528,10 +1528,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_0300, Function | MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE10); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -1539,10 +1539,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_0300, Function | MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE10); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -1559,7 +1559,7 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_0300, Function | publishInfo.SetOrdered(true); std::shared_ptr subscriberPublishTest = - std::make_shared(subscriberInfo); + std::make_shared(subscribeInfo); bool publishResult = CommonEventManager::PublishCommonEvent(data, publishInfo, subscriberPublishTest); Delay(1); EXPECT_TRUE(publishResult); @@ -1578,9 +1578,9 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_0400, Function | MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE11); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -1588,10 +1588,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_0400, Function | MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE11); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -1599,10 +1599,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_0400, Function | MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE11); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -1619,7 +1619,7 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_0400, Function | publishInfo.SetOrdered(true); std::shared_ptr subscriberPublishTest = - std::make_shared(subscriberInfo); + std::make_shared(subscribeInfo); bool publishResult = CommonEventManager::PublishCommonEvent(data, publishInfo, subscriberPublishTest); Delay(1); EXPECT_TRUE(publishResult); @@ -1638,9 +1638,9 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_0500, Function | MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE12); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -1648,10 +1648,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_0500, Function | MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE12); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -1659,10 +1659,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_0500, Function | MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE12); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -1679,7 +1679,7 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_0500, Function | publishInfo.SetOrdered(true); std::shared_ptr subscriberPublishTest = - std::make_shared(subscriberInfo); + std::make_shared(subscribeInfo); bool publishResult = CommonEventManager::PublishCommonEvent(data, publishInfo, subscriberPublishTest); Delay(1); EXPECT_TRUE(publishResult); @@ -1698,9 +1698,9 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_0600, Function | MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE13); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -1708,10 +1708,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_0600, Function | MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE13); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -1719,10 +1719,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_0600, Function | MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE13); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -1759,9 +1759,9 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_0700, Function | MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE14); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -1769,10 +1769,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_0700, Function | MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE14); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -1780,10 +1780,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_0700, Function | MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE14); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -1820,9 +1820,9 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_0800, Function | MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE15); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -1830,10 +1830,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_0800, Function | MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE15); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -1841,10 +1841,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_0800, Function | MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE15); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -1881,9 +1881,9 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_0900, Function | MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE16); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -1891,10 +1891,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_0900, Function | MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE16); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -1902,10 +1902,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_0900, Function | MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE16); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -1942,9 +1942,9 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_1000, Function | MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE17); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -1952,10 +1952,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_1000, Function | MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE17); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -1963,10 +1963,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_1000, Function | MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE17); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -2003,9 +2003,9 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_1100, Function | MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE18); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -2013,10 +2013,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_1100, Function | MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE18); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -2024,10 +2024,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEvent_1100, Function | MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE18); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -2064,9 +2064,9 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsync_0100, Function MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE19); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -2074,10 +2074,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsync_0100, Function MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE19); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -2085,10 +2085,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsync_0100, Function MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE19); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -2105,7 +2105,7 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsync_0100, Function publishInfo.SetOrdered(true); std::shared_ptr subscriberPublishTest = - std::make_shared(subscriberInfo); + std::make_shared(subscribeInfo); bool publishResult = CommonEventManager::PublishCommonEvent(data, publishInfo, subscriberPublishTest); Delay(2); EXPECT_TRUE(publishResult); @@ -2124,9 +2124,9 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsync_0200, Function MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE20); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -2134,10 +2134,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsync_0200, Function MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE20); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -2145,10 +2145,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsync_0200, Function MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE20); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -2165,7 +2165,7 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsync_0200, Function publishInfo.SetOrdered(true); std::shared_ptr subscriberPublishTest = - std::make_shared(subscriberInfo); + std::make_shared(subscribeInfo); bool publishResult = CommonEventManager::PublishCommonEvent(data, publishInfo, subscriberPublishTest); Delay(1); EXPECT_TRUE(publishResult); @@ -2184,9 +2184,9 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsync_0300, Function MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE21); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -2194,10 +2194,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsync_0300, Function MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE21); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -2205,10 +2205,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsync_0300, Function MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE21); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -2225,7 +2225,7 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsync_0300, Function publishInfo.SetOrdered(true); std::shared_ptr subscriberPublishTest = - std::make_shared(subscriberInfo); + std::make_shared(subscribeInfo); bool publishResult = CommonEventManager::PublishCommonEvent(data, publishInfo, subscriberPublishTest); Delay(1); EXPECT_TRUE(publishResult); @@ -2244,9 +2244,9 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsync_0400, Function MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE22); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -2254,10 +2254,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsync_0400, Function MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE22); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -2265,10 +2265,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsync_0400, Function MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE22); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -2285,7 +2285,7 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsync_0400, Function publishInfo.SetOrdered(true); std::shared_ptr subscriberPublishTest = - std::make_shared(subscriberInfo); + std::make_shared(subscribeInfo); bool publishResult = CommonEventManager::PublishCommonEvent(data, publishInfo, subscriberPublishTest); Delay(1); EXPECT_TRUE(publishResult); @@ -2304,9 +2304,9 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsync_0500, Function MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE23); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -2314,10 +2314,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsync_0500, Function MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE23); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -2325,10 +2325,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsync_0500, Function MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE23); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -2345,7 +2345,7 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsync_0500, Function publishInfo.SetOrdered(true); std::shared_ptr subscriberPublishTest = - std::make_shared(subscriberInfo); + std::make_shared(subscribeInfo); bool publishResult = CommonEventManager::PublishCommonEvent(data, publishInfo, subscriberPublishTest); Delay(1); EXPECT_TRUE(publishResult); @@ -2364,9 +2364,9 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeDataInfo_0100, Function | Medi MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE1); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -2374,10 +2374,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeDataInfo_0100, Function | Medi MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE1); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -2385,10 +2385,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeDataInfo_0100, Function | Medi MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE1); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -2428,9 +2428,9 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeDataInfo_0200, Function | Medi MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE2); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -2438,10 +2438,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeDataInfo_0200, Function | Medi MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE2); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -2449,10 +2449,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeDataInfo_0200, Function | Medi MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE2); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -2492,10 +2492,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeDataInfo_0300, Function | Medi MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE3); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - subscriberInfo.SetPriority(LOWPRIORITY); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + subscribeInfo.SetPriority(LOWPRIORITY); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -2503,11 +2503,11 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeDataInfo_0300, Function | Medi MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE3); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); - subscriberInfoSecond.SetPriority(MIDPRIORITY); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); + subscribeInfoSecond.SetPriority(MIDPRIORITY); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -2515,11 +2515,11 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeDataInfo_0300, Function | Medi MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE3); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); - subscriberInfoThird.SetPriority(HIGHPRIORITY); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); + subscribeInfoThird.SetPriority(HIGHPRIORITY); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -2559,10 +2559,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeDataInfo_0400, Function | Medi MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE4); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - subscriberInfo.SetPriority(LOWPRIORITY); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + subscribeInfo.SetPriority(LOWPRIORITY); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -2570,11 +2570,11 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeDataInfo_0400, Function | Medi MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE4); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); - subscriberInfoSecond.SetPriority(MIDPRIORITY); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); + subscribeInfoSecond.SetPriority(MIDPRIORITY); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -2582,11 +2582,11 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeDataInfo_0400, Function | Medi MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE4); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); - subscriberInfoThird.SetPriority(HIGHPRIORITY); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); + subscribeInfoThird.SetPriority(HIGHPRIORITY); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -2626,10 +2626,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeDataInfo_0500, Function | Medi MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE5); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - subscriberInfo.SetPriority(LOWPRIORITY); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + subscribeInfo.SetPriority(LOWPRIORITY); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -2637,11 +2637,11 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeDataInfo_0500, Function | Medi MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE5); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); - subscriberInfoSecond.SetPriority(MIDPRIORITY); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); + subscribeInfoSecond.SetPriority(MIDPRIORITY); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -2649,11 +2649,11 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeDataInfo_0500, Function | Medi MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE5); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); - subscriberInfoThird.SetPriority(HIGHPRIORITY); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); + subscribeInfoThird.SetPriority(HIGHPRIORITY); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -2693,9 +2693,9 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeDataInfo_0600, Function | Medi MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE6); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -2703,10 +2703,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeDataInfo_0600, Function | Medi MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE6); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -2714,10 +2714,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeDataInfo_0600, Function | Medi MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE6); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -2757,10 +2757,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeDataInfo_0700, Function | Medi MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE7); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - subscriberInfo.SetPriority(LOWPRIORITY); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + subscribeInfo.SetPriority(LOWPRIORITY); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -2768,11 +2768,11 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeDataInfo_0700, Function | Medi MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE7); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); - subscriberInfoSecond.SetPriority(MIDPRIORITY); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); + subscribeInfoSecond.SetPriority(MIDPRIORITY); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -2780,11 +2780,11 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventData_CodeDataInfo_0700, Function | Medi MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE7); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); - subscriberInfoThird.SetPriority(HIGHPRIORITY); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); + subscribeInfoThird.SetPriority(HIGHPRIORITY); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -2913,9 +2913,9 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEventInfo_0100, Functi MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE8); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -2923,10 +2923,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEventInfo_0100, Functi MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE8); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -2934,10 +2934,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEventInfo_0100, Functi MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE8); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -2971,9 +2971,9 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEventInfo_0200, Functi MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE9); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -2981,10 +2981,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEventInfo_0200, Functi MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE9); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -2992,10 +2992,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEventInfo_0200, Functi MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE9); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -3029,9 +3029,9 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEventInfo_0300, Functi MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE10); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -3039,10 +3039,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEventInfo_0300, Functi MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE10); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -3050,10 +3050,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEventInfo_0300, Functi MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE10); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -3087,9 +3087,9 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEventInfo_0400, Functi MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE11); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -3097,10 +3097,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEventInfo_0400, Functi MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE11); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -3108,10 +3108,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEventInfo_0400, Functi MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE11); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -3145,9 +3145,9 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEventInfo_0500, Functi MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE12); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -3155,10 +3155,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEventInfo_0500, Functi MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE12); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -3166,10 +3166,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CommonEventInfo_0500, Functi MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE12); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -3203,9 +3203,9 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsyncInfo_0100, Func MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE19); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -3213,10 +3213,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsyncInfo_0100, Func MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE19); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -3224,10 +3224,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsyncInfo_0100, Func MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE19); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -3261,9 +3261,9 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsyncInfo_0200, Func MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE20); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -3271,10 +3271,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsyncInfo_0200, Func MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE20); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -3282,10 +3282,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsyncInfo_0200, Func MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE20); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -3319,9 +3319,9 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsyncInfo_0300, Func MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE21); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -3329,10 +3329,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsyncInfo_0300, Func MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE21); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -3340,10 +3340,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsyncInfo_0300, Func MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE21); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -3377,9 +3377,9 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsyncInfo_0400, Func MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE22); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -3387,10 +3387,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsyncInfo_0400, Func MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE22); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -3398,10 +3398,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsyncInfo_0400, Func MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE22); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); @@ -3435,9 +3435,9 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsyncInfo_0500, Func MatchingSkills matchingSkills; matchingSkills.AddEvent(EVENTCASE23); - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); - std::shared_ptr subscriberFirstTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberFirstTest = std::make_shared(subscribeInfo); bool subscribeFirstResult = CommonEventManager::SubscribeCommonEvent(subscriberFirstTest); EXPECT_TRUE(subscribeFirstResult); @@ -3445,10 +3445,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsyncInfo_0500, Func MatchingSkills matchingSkillsSecond; matchingSkillsSecond.AddEvent(EVENTCASE23); - CommonEventSubscribeInfo subscriberInfoSecond(matchingSkillsSecond); + CommonEventSubscribeInfo subscribeInfoSecond(matchingSkillsSecond); std::shared_ptr subscriberSecondTest = - std::make_shared(subscriberInfoSecond); + std::make_shared(subscribeInfoSecond); bool subscribeResultSecond = CommonEventManager::SubscribeCommonEvent(subscriberSecondTest); EXPECT_TRUE(subscribeResultSecond); @@ -3456,10 +3456,10 @@ HWTEST_F(ActsCESDateTest, CES_CommonEventSubscriber_CodeDataAsyncInfo_0500, Func MatchingSkills matchingSkillsThird; matchingSkillsThird.AddEvent(EVENTCASE23); - CommonEventSubscribeInfo subscriberInfoThird(matchingSkillsThird); + CommonEventSubscribeInfo subscribeInfoThird(matchingSkillsThird); std::shared_ptr subscriberThirdTest = - std::make_shared(subscriberInfoThird); + std::make_shared(subscribeInfoThird); bool subscribeResultThird = CommonEventManager::SubscribeCommonEvent(subscriberThirdTest); EXPECT_TRUE(subscribeResultThird); diff --git a/test/systemtest/common/acts/actsCESManagertest/actsCESManagertest.cpp b/test/systemtest/common/acts/actsCESManagertest/actsCESManagertest.cpp index 29c15cb1917de95f22a8205b2c1014426cc58e95..be5a70761713e92d4a4847e99a5545d4b9b5cead 100755 --- a/test/systemtest/common/acts/actsCESManagertest/actsCESManagertest.cpp +++ b/test/systemtest/common/acts/actsCESManagertest/actsCESManagertest.cpp @@ -53,13 +53,13 @@ int SIGNUMTHIRD = 0; class CommonEventServicesSystemTest : public CommonEventSubscriber { public: - explicit CommonEventServicesSystemTest(const CommonEventSubscribeInfo &subscriberInfo); + explicit CommonEventServicesSystemTest(const CommonEventSubscribeInfo &subscribeInfo); virtual ~CommonEventServicesSystemTest(){}; virtual void OnReceiveEvent(const CommonEventData &data); }; -CommonEventServicesSystemTest::CommonEventServicesSystemTest(const CommonEventSubscribeInfo &subscriberInfo) - : CommonEventSubscriber(subscriberInfo) +CommonEventServicesSystemTest::CommonEventServicesSystemTest(const CommonEventSubscribeInfo &subscribeInfo) + : CommonEventSubscriber(subscribeInfo) {} void CommonEventServicesSystemTest::OnReceiveEvent(const CommonEventData &data) @@ -75,14 +75,14 @@ void CommonEventServicesSystemTest::OnReceiveEvent(const CommonEventData &data) class CommonEventServicesSystemTestSubscriber : public CommonEventSubscriber { public: - explicit CommonEventServicesSystemTestSubscriber(const CommonEventSubscribeInfo &subscriberInfo); + explicit CommonEventServicesSystemTestSubscriber(const CommonEventSubscribeInfo &subscribeInfo); virtual ~CommonEventServicesSystemTestSubscriber(){}; virtual void OnReceiveEvent(const CommonEventData &data); }; CommonEventServicesSystemTestSubscriber::CommonEventServicesSystemTestSubscriber( - const CommonEventSubscribeInfo &subscriberInfo) - : CommonEventSubscriber(subscriberInfo) + const CommonEventSubscribeInfo &subscribeInfo) + : CommonEventSubscriber(subscribeInfo) {} void CommonEventServicesSystemTestSubscriber::OnReceiveEvent(const CommonEventData &data) diff --git a/test/systemtest/common/ces/common_event_services_publish_ordered_system_test/common_event_services_publish_ordered_system_test.cpp b/test/systemtest/common/ces/common_event_services_publish_ordered_system_test/common_event_services_publish_ordered_system_test.cpp index 34d81a88f65165e30ce1453d42404511bd60e40a..65d84b8dd687de58579d815e8d460555b80e13c0 100755 --- a/test/systemtest/common/ces/common_event_services_publish_ordered_system_test/common_event_services_publish_ordered_system_test.cpp +++ b/test/systemtest/common/ces/common_event_services_publish_ordered_system_test/common_event_services_publish_ordered_system_test.cpp @@ -24,13 +24,7 @@ #undef protected #include "common_event_manager.h" #include "datetime_ex.h" -#include "iremote_object.h" -#include "message_parcel.h" -#include "sa_mgr_client.h" #include "singleton.h" -#include "system_ability_definition.h" -#include "system_ability.h" -#include "system_ability_helper.h" #include "want.h" #include @@ -91,7 +85,8 @@ public: class Subscriber : public CommonEventSubscriber { public: - explicit Subscriber(const CommonEventSubscribeInfo &subscriberInfo) : CommonEventSubscriber(subscriberInfo){}; + explicit Subscriber(const CommonEventSubscribeInfo &subscribeInfo) : CommonEventSubscriber(subscribeInfo) + {} ~Subscriber() {} @@ -116,7 +111,8 @@ public: class SubscriberTest : public CommonEventSubscriber { public: - explicit SubscriberTest(const CommonEventSubscribeInfo &subscriberInfo) : CommonEventSubscriber(subscriberInfo){}; + explicit SubscriberTest(const CommonEventSubscribeInfo &subscribeInfo) : CommonEventSubscriber(subscribeInfo) + {} ~SubscriberTest() {} @@ -251,8 +247,9 @@ private: class SubscriberAnotherTest : public CommonEventSubscriber { public: - explicit SubscriberAnotherTest(const CommonEventSubscribeInfo &subscriberInfo) - : CommonEventSubscriber(subscriberInfo){}; + explicit SubscriberAnotherTest(const CommonEventSubscribeInfo &subscribeInfo) + : CommonEventSubscriber(subscribeInfo) + {} ~SubscriberAnotherTest() {} @@ -420,10 +417,10 @@ HWTEST_F(CESPublishOrderedEventSystmTest, CommonEventPublishOrderedEventTest_010 matchingSkills.AddEvent(EVENTCASE1); // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // make a subcriber object - std::shared_ptr subscriberTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberTest = std::make_shared(subscribeInfo); // subscribe a common event bool subscribeResult = SubscribeCommonEventTest(subscriberTest); @@ -434,11 +431,11 @@ HWTEST_F(CESPublishOrderedEventSystmTest, CommonEventPublishOrderedEventTest_010 matchingSkillsAnother.AddEvent(EVENTCASE1); // make another subcriber info - CommonEventSubscribeInfo subscriberInfoAnother(matchingSkillsAnother); + CommonEventSubscribeInfo subscribeInfoAnother(matchingSkillsAnother); // make another subcriber object std::shared_ptr subscriberTestAnother = - std::make_shared(subscriberInfoAnother); + std::make_shared(subscribeInfoAnother); // subscribe another event bool subscribeResultAnother = SubscribeCommonEventTest(subscriberTestAnother); @@ -464,7 +461,7 @@ HWTEST_F(CESPublishOrderedEventSystmTest, CommonEventPublishOrderedEventTest_010 g_mtx.lock(); g_mtxAnother.lock(); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); // publish ordered event bool publishResult = PublishOrderedCommonEventTest(data, publishInfo, subscriber); @@ -537,11 +534,11 @@ HWTEST_F(CESPublishOrderedEventSystmTest, CommonEventPublishOrderedEventTest_020 matchingSkills.AddEvent(EVENTCASE2); // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); - subscriberInfo.SetPriority(LOWPRIORITY); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); + subscribeInfo.SetPriority(LOWPRIORITY); // make a subcriber object - std::shared_ptr subscriberTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberTest = std::make_shared(subscribeInfo); // subscribe a common event bool subscribeResult = SubscribeCommonEventTest(subscriberTest); @@ -552,12 +549,12 @@ HWTEST_F(CESPublishOrderedEventSystmTest, CommonEventPublishOrderedEventTest_020 matchingSkillsAnother.AddEvent(EVENTCASE2); // make another subcriber info - CommonEventSubscribeInfo subscriberInfoAnother(matchingSkillsAnother); - subscriberInfoAnother.SetPriority(HIGHPRIORITY); + CommonEventSubscribeInfo subscribeInfoAnother(matchingSkillsAnother); + subscribeInfoAnother.SetPriority(HIGHPRIORITY); // make another subcriber object std::shared_ptr subscriberTestAnother = - std::make_shared(subscriberInfoAnother); + std::make_shared(subscribeInfoAnother); // subscribe another event bool subscribeResultAnother = SubscribeCommonEventTest(subscriberTestAnother); @@ -583,7 +580,7 @@ HWTEST_F(CESPublishOrderedEventSystmTest, CommonEventPublishOrderedEventTest_020 g_mtx.lock(); g_mtxAnother.lock(); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); // publish ordered event bool publishResult = PublishOrderedCommonEventTest(data, publishInfo, subscriber); @@ -657,10 +654,10 @@ HWTEST_F(CESPublishOrderedEventSystmTest, CommonEventPublishOrderedEventTest_030 matchingSkills.AddEvent(EVENTCASE3); // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // make a subcriber object - std::shared_ptr subscriberTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberTest = std::make_shared(subscribeInfo); // subscribe a common event bool subscribeResult = SubscribeCommonEventTest(subscriberTest); @@ -671,11 +668,11 @@ HWTEST_F(CESPublishOrderedEventSystmTest, CommonEventPublishOrderedEventTest_030 matchingSkillsAnother.AddEvent(EVENTCASE3); // make another subcriber info - CommonEventSubscribeInfo subscriberInfoAnother(matchingSkillsAnother); + CommonEventSubscribeInfo subscribeInfoAnother(matchingSkillsAnother); // make another subcriber object std::shared_ptr subscriberTestAnother = - std::make_shared(subscriberInfoAnother); + std::make_shared(subscribeInfoAnother); // subscribe another event bool subscribeResultAnother = SubscribeCommonEventTest(subscriberTestAnother); @@ -702,7 +699,7 @@ HWTEST_F(CESPublishOrderedEventSystmTest, CommonEventPublishOrderedEventTest_030 g_mtxAnother.lock(); // publish ordered event - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); bool publishResult = PublishOrderedCommonEventTest(data, publishInfo, subscriber); EXPECT_EQ(true, publishResult); @@ -769,10 +766,10 @@ HWTEST_F(CESPublishOrderedEventSystmTest, CommonEventPublishOrderedEventTest_040 matchingSkills.AddEvent(EVENTCASE4); // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // make a subcriber object - std::shared_ptr subscriberTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberTest = std::make_shared(subscribeInfo); // subscribe a common event bool subscribeResult = SubscribeCommonEventTest(subscriberTest); @@ -783,11 +780,11 @@ HWTEST_F(CESPublishOrderedEventSystmTest, CommonEventPublishOrderedEventTest_040 matchingSkillsAnother.AddEvent(EVENTCASE4); // make another subcriber info - CommonEventSubscribeInfo subscriberInfoAnother(matchingSkillsAnother); + CommonEventSubscribeInfo subscribeInfoAnother(matchingSkillsAnother); // make another subcriber object std::shared_ptr subscriberTestAnother = - std::make_shared(subscriberInfoAnother); + std::make_shared(subscribeInfoAnother); // subscribe another event bool subscribeResultAnother = SubscribeCommonEventTest(subscriberTestAnother); @@ -813,7 +810,7 @@ HWTEST_F(CESPublishOrderedEventSystmTest, CommonEventPublishOrderedEventTest_040 g_mtx.lock(); g_mtxAnother.lock(); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); // publish ordered event bool publishResult = PublishOrderedCommonEventTest(data, publishInfo, subscriber); @@ -883,10 +880,10 @@ HWTEST_F(CESPublishOrderedEventSystmTest, CommonEventPublishOrderedEventTest_050 matchingSkills.AddEvent(EVENTCASE5); // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // make a subcriber object - std::shared_ptr subscriberTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberTest = std::make_shared(subscribeInfo); // subscribe a common event bool subscribeResult = SubscribeCommonEventTest(subscriberTest); @@ -897,11 +894,11 @@ HWTEST_F(CESPublishOrderedEventSystmTest, CommonEventPublishOrderedEventTest_050 matchingSkillsAnother.AddEvent(EVENTCASE5); // make another subcriber info - CommonEventSubscribeInfo subscriberInfoAnother(matchingSkillsAnother); + CommonEventSubscribeInfo subscribeInfoAnother(matchingSkillsAnother); // make another subcriber object std::shared_ptr subscriberTestAnother = - std::make_shared(subscriberInfoAnother); + std::make_shared(subscribeInfoAnother); // subscribe another event bool subscribeResultAnother = SubscribeCommonEventTest(subscriberTestAnother); @@ -928,7 +925,7 @@ HWTEST_F(CESPublishOrderedEventSystmTest, CommonEventPublishOrderedEventTest_050 g_mtxAnother.lock(); // publish ordered event - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); bool publishResult = PublishOrderedCommonEventTest(data, publishInfo, subscriber); EXPECT_EQ(true, publishResult); @@ -998,10 +995,10 @@ HWTEST_F(CESPublishOrderedEventSystmTest, CommonEventPublishOrderedEventTest_060 matchingSkills.AddEvent(EVENTCASE6); // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // make a subcriber object - std::shared_ptr subscriberTest = std::make_shared(subscriberInfo); + std::shared_ptr subscriberTest = std::make_shared(subscribeInfo); // subscribe a common event bool subscribeResult = SubscribeCommonEventTest(subscriberTest); @@ -1012,11 +1009,11 @@ HWTEST_F(CESPublishOrderedEventSystmTest, CommonEventPublishOrderedEventTest_060 matchingSkillsAnother.AddEvent(EVENTCASE6); // make another subcriber info - CommonEventSubscribeInfo subscriberInfoAnother(matchingSkillsAnother); + CommonEventSubscribeInfo subscribeInfoAnother(matchingSkillsAnother); // make another subcriber object std::shared_ptr subscriberTestAnother = - std::make_shared(subscriberInfoAnother); + std::make_shared(subscribeInfoAnother); // subscribe another event bool subscribeResultAnother = SubscribeCommonEventTest(subscriberTestAnother); @@ -1042,7 +1039,7 @@ HWTEST_F(CESPublishOrderedEventSystmTest, CommonEventPublishOrderedEventTest_060 g_mtx.lock(); g_mtxAnother.lock(); - std::shared_ptr subscriber = std::make_shared(subscriberInfo); + std::shared_ptr subscriber = std::make_shared(subscribeInfo); // publish ordered event bool publishResult = PublishOrderedCommonEventTest(data, publishInfo, subscriber); diff --git a/test/systemtest/common/ces/common_event_services_system_test/common_event_services_system_test.cpp b/test/systemtest/common/ces/common_event_services_system_test/common_event_services_system_test.cpp index 214943becaa7e42639d86f29516fb8958e79b4a9..e34eccbf4a3e02d3932605249899c3a50671394c 100755 --- a/test/systemtest/common/ces/common_event_services_system_test/common_event_services_system_test.cpp +++ b/test/systemtest/common/ces/common_event_services_system_test/common_event_services_system_test.cpp @@ -57,13 +57,13 @@ const int32_t PRIORITY_LOW = 20; class CommonEventServicesSystemTest : public CommonEventSubscriber { public: - CommonEventServicesSystemTest(const CommonEventSubscribeInfo &subscriberInfo); - virtual ~CommonEventServicesSystemTest(){}; + explicit CommonEventServicesSystemTest(const CommonEventSubscribeInfo &subscribeInfo); + virtual ~CommonEventServicesSystemTest() {}; virtual void OnReceiveEvent(const CommonEventData &data); }; -CommonEventServicesSystemTest::CommonEventServicesSystemTest(const CommonEventSubscribeInfo &subscriberInfo) - : CommonEventSubscriber(subscriberInfo) +CommonEventServicesSystemTest::CommonEventServicesSystemTest(const CommonEventSubscribeInfo &subscribeInfo) + : CommonEventSubscriber(subscribeInfo) {} void CommonEventServicesSystemTest::OnReceiveEvent(const CommonEventData &data) @@ -77,14 +77,14 @@ void CommonEventServicesSystemTest::OnReceiveEvent(const CommonEventData &data) class CommonEventServicesSystemTestSubscriber : public CommonEventSubscriber { public: - CommonEventServicesSystemTestSubscriber(const CommonEventSubscribeInfo &subscriberInfo); - virtual ~CommonEventServicesSystemTestSubscriber(){}; + explicit CommonEventServicesSystemTestSubscriber(const CommonEventSubscribeInfo &subscribeInfo); + virtual ~CommonEventServicesSystemTestSubscriber() {}; virtual void OnReceiveEvent(const CommonEventData &data); }; CommonEventServicesSystemTestSubscriber::CommonEventServicesSystemTestSubscriber( - const CommonEventSubscribeInfo &subscriberInfo) - : CommonEventSubscriber(subscriberInfo) + const CommonEventSubscribeInfo &subscribeInfo) + : CommonEventSubscriber(subscribeInfo) {} void CommonEventServicesSystemTestSubscriber::OnReceiveEvent(const CommonEventData &data) @@ -100,13 +100,13 @@ void CommonEventServicesSystemTestSubscriber::OnReceiveEvent(const CommonEventDa class CESPublishOrderTimeOutOne : public CommonEventSubscriber { public: - CESPublishOrderTimeOutOne(const CommonEventSubscribeInfo &subscriberInfo); - virtual ~CESPublishOrderTimeOutOne(){}; + explicit CESPublishOrderTimeOutOne(const CommonEventSubscribeInfo &subscribeInfo); + virtual ~CESPublishOrderTimeOutOne() {}; virtual void OnReceiveEvent(const CommonEventData &data); }; -CESPublishOrderTimeOutOne::CESPublishOrderTimeOutOne(const CommonEventSubscribeInfo &subscriberInfo) - : CommonEventSubscriber(subscriberInfo) +CESPublishOrderTimeOutOne::CESPublishOrderTimeOutOne(const CommonEventSubscribeInfo &subscribeInfo) + : CommonEventSubscriber(subscribeInfo) {} void CESPublishOrderTimeOutOne::OnReceiveEvent(const CommonEventData &data) @@ -116,13 +116,13 @@ void CESPublishOrderTimeOutOne::OnReceiveEvent(const CommonEventData &data) class CESPublishOrderTimeOutTwo : public CommonEventSubscriber { public: - CESPublishOrderTimeOutTwo(const CommonEventSubscribeInfo &subscriberInfo); - virtual ~CESPublishOrderTimeOutTwo(){}; + explicit CESPublishOrderTimeOutTwo(const CommonEventSubscribeInfo &subscribeInfo); + virtual ~CESPublishOrderTimeOutTwo() {}; virtual void OnReceiveEvent(const CommonEventData &data); }; -CESPublishOrderTimeOutTwo::CESPublishOrderTimeOutTwo(const CommonEventSubscribeInfo &subscriberInfo) - : CommonEventSubscriber(subscriberInfo) +CESPublishOrderTimeOutTwo::CESPublishOrderTimeOutTwo(const CommonEventSubscribeInfo &subscribeInfo) + : CommonEventSubscriber(subscribeInfo) {} void CESPublishOrderTimeOutTwo::OnReceiveEvent(const CommonEventData &data) diff --git a/test/systemtest/common/resource/cesSTPermissionAndAB/include/ces_st_permission_and_AB.h b/test/systemtest/common/resource/cesSTPermissionAndAB/include/ces_st_permission_and_AB.h index 4ab4ca94d78836dc8dbcc289d99d5d04c9f59aaf..ae813859322bd0ec489a70dcc86e08ef0172afc0 100644 --- a/test/systemtest/common/resource/cesSTPermissionAndAB/include/ces_st_permission_and_AB.h +++ b/test/systemtest/common/resource/cesSTPermissionAndAB/include/ces_st_permission_and_AB.h @@ -28,13 +28,13 @@ namespace OHOS { namespace AppExecFwk { class CommonEventServicesSystemTest : public EventFwk::CommonEventSubscriber { public: - CommonEventServicesSystemTest(const EventFwk::CommonEventSubscribeInfo &subscriberInfo); + CommonEventServicesSystemTest(const EventFwk::CommonEventSubscribeInfo &subscribeInfo); virtual ~CommonEventServicesSystemTest(){}; virtual void OnReceiveEvent(const EventFwk::CommonEventData &data); }; -CommonEventServicesSystemTest::CommonEventServicesSystemTest(const EventFwk::CommonEventSubscribeInfo &subscriberInfo) - : EventFwk::CommonEventSubscriber(subscriberInfo) +CommonEventServicesSystemTest::CommonEventServicesSystemTest(const EventFwk::CommonEventSubscribeInfo &subscribeInfo) + : EventFwk::CommonEventSubscriber(subscribeInfo) {} void CommonEventServicesSystemTest::OnReceiveEvent(const EventFwk::CommonEventData &data) diff --git a/test/systemtest/common/resource/cesSTPermissionDefaultA/include/ces_st_permission_default_A.h b/test/systemtest/common/resource/cesSTPermissionDefaultA/include/ces_st_permission_default_A.h index 00b5dd9b70f87e5f6decd867d3d6531cf9140302..1d2a5ccf666980fb27005c64ba9bd35e0ee585e2 100644 --- a/test/systemtest/common/resource/cesSTPermissionDefaultA/include/ces_st_permission_default_A.h +++ b/test/systemtest/common/resource/cesSTPermissionDefaultA/include/ces_st_permission_default_A.h @@ -26,13 +26,13 @@ namespace OHOS { namespace AppExecFwk { class CommonEventServicesSystemTest : public EventFwk::CommonEventSubscriber { public: - CommonEventServicesSystemTest(const EventFwk::CommonEventSubscribeInfo &subscriberInfo); + CommonEventServicesSystemTest(const EventFwk::CommonEventSubscribeInfo &subscribeInfo); virtual ~CommonEventServicesSystemTest(){}; virtual void OnReceiveEvent(const EventFwk::CommonEventData &data); }; -CommonEventServicesSystemTest::CommonEventServicesSystemTest(const EventFwk::CommonEventSubscribeInfo &subscriberInfo) - : EventFwk::CommonEventSubscriber(subscriberInfo) +CommonEventServicesSystemTest::CommonEventServicesSystemTest(const EventFwk::CommonEventSubscribeInfo &subscribeInfo) + : EventFwk::CommonEventSubscriber(subscribeInfo) {} void CommonEventServicesSystemTest::OnReceiveEvent(const EventFwk::CommonEventData &data) diff --git a/test/systemtest/common/resource/cesSTPermissionOrAB/include/ces_st_permission_or_AB.h b/test/systemtest/common/resource/cesSTPermissionOrAB/include/ces_st_permission_or_AB.h index bf00f4df327c64e1e161cc694537526ae5c8ade7..b792eb7244c0949f60008b3cd19ab134ae2c9378 100644 --- a/test/systemtest/common/resource/cesSTPermissionOrAB/include/ces_st_permission_or_AB.h +++ b/test/systemtest/common/resource/cesSTPermissionOrAB/include/ces_st_permission_or_AB.h @@ -26,13 +26,13 @@ namespace OHOS { namespace AppExecFwk { class CommonEventServicesSystemTest : public EventFwk::CommonEventSubscriber { public: - CommonEventServicesSystemTest(const EventFwk::CommonEventSubscribeInfo &subscriberInfo); + CommonEventServicesSystemTest(const EventFwk::CommonEventSubscribeInfo &subscribeInfo); virtual ~CommonEventServicesSystemTest(){}; virtual void OnReceiveEvent(const EventFwk::CommonEventData &data); }; -CommonEventServicesSystemTest::CommonEventServicesSystemTest(const EventFwk::CommonEventSubscribeInfo &subscriberInfo) - : EventFwk::CommonEventSubscriber(subscriberInfo) +CommonEventServicesSystemTest::CommonEventServicesSystemTest(const EventFwk::CommonEventSubscribeInfo &subscribeInfo) + : EventFwk::CommonEventSubscriber(subscribeInfo) {} void CommonEventServicesSystemTest::OnReceiveEvent(const EventFwk::CommonEventData &data) diff --git a/test/systemtest/common/resource/cesSTPermissionOrAX/include/ces_st_permission_or_AX.h b/test/systemtest/common/resource/cesSTPermissionOrAX/include/ces_st_permission_or_AX.h index 9a36d48608d4632581c00238e5ecb36489113fcc..e728ad833c9f7ed59a9659623f76c30f7e065b8b 100644 --- a/test/systemtest/common/resource/cesSTPermissionOrAX/include/ces_st_permission_or_AX.h +++ b/test/systemtest/common/resource/cesSTPermissionOrAX/include/ces_st_permission_or_AX.h @@ -26,13 +26,13 @@ namespace OHOS { namespace AppExecFwk { class CommonEventServicesSystemTest : public EventFwk::CommonEventSubscriber { public: - CommonEventServicesSystemTest(const EventFwk::CommonEventSubscribeInfo &subscriberInfo); + CommonEventServicesSystemTest(const EventFwk::CommonEventSubscribeInfo &subscribeInfo); virtual ~CommonEventServicesSystemTest(){}; virtual void OnReceiveEvent(const EventFwk::CommonEventData &data); }; -CommonEventServicesSystemTest::CommonEventServicesSystemTest(const EventFwk::CommonEventSubscribeInfo &subscriberInfo) - : EventFwk::CommonEventSubscriber(subscriberInfo) +CommonEventServicesSystemTest::CommonEventServicesSystemTest(const EventFwk::CommonEventSubscribeInfo &subscribeInfo) + : EventFwk::CommonEventSubscriber(subscribeInfo) {} void CommonEventServicesSystemTest::OnReceiveEvent(const EventFwk::CommonEventData &data) diff --git a/tools/test/mock/mock_common_event_stub.cpp b/tools/test/mock/mock_common_event_stub.cpp index 0c5d07d09d125328e550d758215ba9758e0d90f7..6edadc692a1b654f763111ff172e179930059f2b 100644 --- a/tools/test/mock/mock_common_event_stub.cpp +++ b/tools/test/mock/mock_common_event_stub.cpp @@ -26,11 +26,11 @@ bool MockCommonEventStub::PublishCommonEvent(const CommonEventData &event, const } bool MockCommonEventStub::SubscribeCommonEvent( - const CommonEventSubscribeInfo &subscriberInfo, const sptr &commonEventListener) + const CommonEventSubscribeInfo &subscribeInfo, const sptr &commonEventListener) { EVENT_LOGI("enter"); - subscribeInfoPtr = std::make_shared(subscriberInfo); + subscribeInfoPtr = std::make_shared(subscribeInfo); return true; } diff --git a/tools/test/mock/mock_common_event_stub.h b/tools/test/mock/mock_common_event_stub.h index 85dec6e432882290b744341811e88af89086ec9c..aa5de153f000f41cc8944d03e0c7435e06505e11 100755 --- a/tools/test/mock/mock_common_event_stub.h +++ b/tools/test/mock/mock_common_event_stub.h @@ -32,7 +32,7 @@ public: const sptr &commonEventListener) override; bool SubscribeCommonEvent( - const CommonEventSubscribeInfo &subscriberInfo, const sptr &commonEventListener) override; + const CommonEventSubscribeInfo &subscribeInfo, const sptr &commonEventListener) override; bool DumpState(const std::string &event, std::vector &state) override; diff --git a/tools/test/moduletest/cem/common_event_command_dump_module_test.cpp b/tools/test/moduletest/cem/common_event_command_dump_module_test.cpp index e11de043601e4224435d029e40f7dc0b93b2c500..c3000a4449dec8ef4f3baaf304246edbfde450a9 100644 --- a/tools/test/moduletest/cem/common_event_command_dump_module_test.cpp +++ b/tools/test/moduletest/cem/common_event_command_dump_module_test.cpp @@ -131,10 +131,10 @@ HWTEST_F(CemCommandDumpModuleTest, Cem_Command_Dump_ModuleTest_0200, Function | matchingSkills.AddEvent(STRING_EVENT); // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // make a subcriber object - auto subscriberTestPtr = std::make_shared(subscriberInfo); + auto subscriberTestPtr = std::make_shared(subscribeInfo); // subscribe a common event CommonEventManager::SubscribeCommonEvent(subscriberTestPtr); diff --git a/tools/test/systemtest/cem/common_event_command_dump_system_test.cpp b/tools/test/systemtest/cem/common_event_command_dump_system_test.cpp index c80ed9b8d28359caa35b44915e0e71a99ac7f5da..8e30b50a89c478e8f711a9a4cacd0a8077bb3c76 100644 --- a/tools/test/systemtest/cem/common_event_command_dump_system_test.cpp +++ b/tools/test/systemtest/cem/common_event_command_dump_system_test.cpp @@ -80,10 +80,10 @@ HWTEST_F(CemCommandDumpSystemTest, Cem_Command_Dump_SystemTest_0100, Function | matchingSkills.AddEvent(STRING_EVENT); // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // make a subcriber object - auto subscriberTestPtr = std::make_shared(subscriberInfo); + auto subscriberTestPtr = std::make_shared(subscribeInfo); // subscribe a common event CommonEventManager::SubscribeCommonEvent(subscriberTestPtr); @@ -125,10 +125,10 @@ HWTEST_F(CemCommandDumpSystemTest, Cem_Command_Dump_SystemTest_0300, Function | matchingSkills.AddEvent(STRING_EVENT); // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // make a subcriber object - auto subscriberTestPtr = std::make_shared(subscriberInfo); + auto subscriberTestPtr = std::make_shared(subscribeInfo); // subscribe a common event CommonEventManager::SubscribeCommonEvent(subscriberTestPtr); diff --git a/tools/test/systemtest/cem/common_event_command_publish_system_test.cpp b/tools/test/systemtest/cem/common_event_command_publish_system_test.cpp index 85c55d17fdecc46f3e7989df397ce4a0124eff17..21235098e3607d99d042c91473a3c9bcfdf18cb1 100644 --- a/tools/test/systemtest/cem/common_event_command_publish_system_test.cpp +++ b/tools/test/systemtest/cem/common_event_command_publish_system_test.cpp @@ -113,10 +113,10 @@ HWTEST_F(CemCommandPublishSystemTest, Cem_Command_Publish_SystemTest_0100, Funct matchingSkills.AddEvent(STRING_EVENT); // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // make a subcriber object - auto subscriberTestPtr = std::make_shared(subscriberInfo); + auto subscriberTestPtr = std::make_shared(subscribeInfo); // subscribe a common event CommonEventManager::SubscribeCommonEvent(subscriberTestPtr); @@ -170,13 +170,13 @@ HWTEST_F(CemCommandPublishSystemTest, Cem_Command_Publish_SystemTest_0200, Funct matchingSkills.AddEvent(STRING_EVENT); // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // set device id - subscriberInfo.SetDeviceId(STRING_DEVICE_ID_001); + subscribeInfo.SetDeviceId(STRING_DEVICE_ID_001); // make a subcriber object - auto subscriberTestPtr = std::make_shared(subscriberInfo); + auto subscriberTestPtr = std::make_shared(subscribeInfo); // subscribe a common event CommonEventManager::SubscribeCommonEvent(subscriberTestPtr); @@ -230,13 +230,13 @@ HWTEST_F(CemCommandPublishSystemTest, Cem_Command_Publish_SystemTest_0300, Funct matchingSkills.AddEvent(STRING_EVENT); // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // set device id - subscriberInfo.SetDeviceId(STRING_DEVICE_ID_002); + subscribeInfo.SetDeviceId(STRING_DEVICE_ID_002); // make a subcriber object - auto subscriberTestPtr = std::make_shared(subscriberInfo); + auto subscriberTestPtr = std::make_shared(subscribeInfo); // subscribe a common event CommonEventManager::SubscribeCommonEvent(subscriberTestPtr); diff --git a/tools/test/unittest/cem/common_event_command_dump_test.cpp b/tools/test/unittest/cem/common_event_command_dump_test.cpp index 291b486a7acaded45ca6ceac1f6ecb1253a925f5..bbc2d0ce08ae8c5f4c569ef5daf47fe56fa6959f 100644 --- a/tools/test/unittest/cem/common_event_command_dump_test.cpp +++ b/tools/test/unittest/cem/common_event_command_dump_test.cpp @@ -335,10 +335,10 @@ HWTEST_F(CemCommandDumpTest, Cem_Command_Dump_1100, Function | MediumTest | Leve matchingSkills.AddEvent(STRING_EVENT); // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // make a subcriber object - auto subscriberTestPtr = std::make_shared(subscriberInfo); + auto subscriberTestPtr = std::make_shared(subscribeInfo); // subscribe a common event CommonEventManager::SubscribeCommonEvent(subscriberTestPtr); @@ -418,10 +418,10 @@ HWTEST_F(CemCommandDumpTest, Cem_Command_Dump_1400, Function | MediumTest | Leve matchingSkills.AddEvent(STRING_EVENT); // make subcriber info - CommonEventSubscribeInfo subscriberInfo(matchingSkills); + CommonEventSubscribeInfo subscribeInfo(matchingSkills); // make a subcriber object - auto subscriberTestPtr = std::make_shared(subscriberInfo); + auto subscriberTestPtr = std::make_shared(subscribeInfo); // subscribe a common event CommonEventManager::SubscribeCommonEvent(subscriberTestPtr);