!10 测试静态编译

* test code check 0913
This commit is contained in:
blackleon
2021-09-13 13:22:32 +00:00
committed by openharmony_ci
parent 2e8ac8d95c
commit b9a30c11c8
50 changed files with 2955 additions and 1349 deletions
+1 -1
View File
@@ -9,6 +9,6 @@
# 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.
# limitations under the License.
import("//build/ohos.gni")
@@ -55,9 +55,10 @@ private:
#define PRINT_LOG(LEVEL, Level, fmt, ...) \
if (EventLogWrapper::JudgeLevel(EventLogLevel::LEVEL)) \
OHOS::HiviewDFX::HiLog::Level(Event_LABEL, \
"[%{public}s(%{public}s)] " fmt, \
"[%{public}s:(%{public}s):%{public}d] " fmt, \
EventLogWrapper::GetBriefFileName(__FILE__).c_str(), \
__FUNCTION__, \
__LINE__, \
##__VA_ARGS__)
#define EVENT_LOGD(fmt, ...) PRINT_LOG(DEBUG, Debug, fmt, ##__VA_ARGS__)
+1 -1
View File
@@ -142,7 +142,7 @@ private:
std::mutex mutex_;
std::mutex eventListenersMutex_;
sptr<ICommonEvent> commonEventProxy_;
std::map<std::shared_ptr<CommonEventSubscriber>, sptr<IRemoteObject>> eventListeners_;
std::map<std::shared_ptr<CommonEventSubscriber>, sptr<CommonEventListener>> eventListeners_;
sptr<IRemoteObject::DeathRecipient> recipient_;
const unsigned int SUBSCRIBER_MAX_SIZE = 200;
};
@@ -33,6 +33,8 @@ public:
virtual void NotifyEvent(const CommonEventData &CommonEventData, const bool &ordered, const bool &sticky) override;
void Stop();
private:
ErrCode Init();
+5 -4
View File
@@ -118,7 +118,8 @@ bool CommonEvent::UnSubscribeCommonEvent(const std::shared_ptr<CommonEventSubscr
std::lock_guard<std::mutex> lock(eventListenersMutex_);
auto eventListener = eventListeners_.find(subscriber);
if (eventListener != eventListeners_.end()) {
if (commonEventProxy_->UnsubscribeCommonEvent(eventListener->second)) {
if (commonEventProxy_->UnsubscribeCommonEvent(eventListener->second->AsObject())) {
eventListener->second->Stop();
eventListeners_.erase(eventListener);
return true;
}
@@ -262,7 +263,7 @@ int CommonEvent::CreateCommonEventListener(
auto eventListener = eventListeners_.find(subscriber);
if (eventListener != eventListeners_.end()) {
commonEventListener = eventListener->second;
commonEventListener = eventListener->second->AsObject();
EVENT_LOGW("subscriber has common event listener");
return ALREADY_SUBSCRIBED;
} else {
@@ -272,13 +273,13 @@ int CommonEvent::CreateCommonEventListener(
return SUBSCRIBE_FAILD;
}
sptr<IEventReceive> listener = new CommonEventListener(subscriber);
sptr<CommonEventListener> listener = new CommonEventListener(subscriber);
if (!listener) {
EVENT_LOGE("the common event listener is null");
return SUBSCRIBE_FAILD;
}
commonEventListener = listener->AsObject();
eventListeners_[subscriber] = commonEventListener;
eventListeners_[subscriber] = listener;
}
return INITIAL_SUBSCRIPTION;
@@ -114,5 +114,20 @@ void CommonEventListener::OnReceiveEvent(
commonEventSubscriber_->GetAsyncCommonEventResult()->FinishCommonEvent();
}
}
void CommonEventListener::Stop()
{
if (handler_) {
handler_.reset();
}
if (CommonEventSubscribeInfo::HANDLER == commonEventSubscriber_->GetSubscribeInfo().GetThreadMode()) {
return;
}
if (runner_) {
runner_.reset();
}
}
} // namespace EventFwk
} // namespace OHOS
+950
View File
@@ -0,0 +1,950 @@
/*
* 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.
*/
import { AsyncCallback } from './basic';
import { CommonEventData } from './commonEvent/commonEventData';
import { CommonEventSubscriber } from './commonEvent/commonEventSubscriber'
import { CommonEventSubscribeInfo } from './commonEvent/commonEventSubscribeInfo';
import { CommonEventPublishData } from './commonEvent/commonEventPublishData';
/**
* the defination for commonevent
* @name commonEvent
* @since 7
* @permission N/A
*/
declare namespace commonEvent {
/**
* Publishes an ordered, sticky, or standard common event.
*
* @since 7
* @param data Indicate the CommonEventPublishData containing the common event content and attributes.
* @param callback Specified callback method.
* @return -
*/
function publish(event: string, callback: AsyncCallback<void>): void;
/**
* Publishes an ordered, sticky, or standard common event.
*
* @since 7
* @param data Indicate the CommonEventPublishData containing the common event content and attributes.
* @param callback Specified callback method.
* @return -
*/
function publish(event: string, options: CommonEventPublishData, callback: AsyncCallback<void>): void;
/**
* create the CommonEventSubscriber for the SubscriberInfo.
*
* @since 7
* @param subscribeInfo Indicate the information of the subscriber.
* @param callback Specified callback method.
* @return -
*/
function createSubscriber(subscribeInfo: CommonEventSubscribeInfo, callback: AsyncCallback<CommonEventSubscriber>): void;
/**
* create the CommonEventSubscriber for the SubscriberInfo.
*
* @since 7
* @param subscribeInfo Indicate the information of the subscriber.
* @param callback Specified callback method.
* @return -
*/
function createSubscriber(subscribeInfo: CommonEventSubscribeInfo): Promise<CommonEventSubscriber>;
/**
* subscribe an ordered, sticky, or standard common event.
*
* @since 7
* @param subscriber Indicate the subscriber of the common event.
* @param callback Specified callback method.
* @return -
*/
function subscribe(subscriber: CommonEventSubscriber, callback: AsyncCallback<CommonEventData>): void;
/**
* unsubscribe an ordered, sticky, or standard common event.
*
* @since 7
* @param subscriber Indicate the subscriber of the common event.
* @param callback Specified callback method.
* @return -
*/
function unsubscribe(subscriber: CommonEventSubscriber, callback?: AsyncCallback<void>): void;
/**
* the event type that the commonEvent supported
* @name Support
* @since 7
* @permission N/A
*/
export enum Support {
/**
* this commonEvent means when the device is booted or system upgrade completed, and only be sent by system.
*/
COMMON_EVENT_BOOT_COMPLETED = "usual.event.BOOT_COMPLETED",
/**
* this commonEvent means when the device finnish booting, but still in the locked state.
*/
COMMON_EVENT_LOCKED_BOOT_COMPLETED = "usual.event.LOCKED_BOOT_COMPLETED",
/**
* this commonEvent means when the device is shutting down, note: turn off, not sleeping.
*/
COMMON_EVENT_SHUTDOWN = "usual.event.SHUTDOWN",
/**
* this commonEvent means when the charging state, level and so on about the battery.
*/
COMMON_EVENT_BATTERY_CHANGED = "usual.event.BATTERY_CHANGED",
/**
* this commonEvent means when the device in low battery state..
*/
COMMON_EVENT_BATTERY_LOW = "usual.event.BATTERY_LOW",
/**
* this commonEvent means when the battery level is an ok state.
*/
COMMON_EVENT_BATTERY_OKAY = "usual.event.BATTERY_OKAY",
/**
* this commonEvent means when the other power is connected to the device.
*/
COMMON_EVENT_POWER_CONNECTED = "usual.event.POWER_CONNECTED",
/**
* this commonEvent means when the other power is removed from the device.
*/
COMMON_EVENT_POWER_DISCONNECTED = "usual.event.POWER_DISCONNECTED",
/**
* this commonEvent means when the screen is turned off.
*/
COMMON_EVENT_SCREEN_OFF = "usual.event.SCREEN_OFF",
/**
* this commonEvent means when the device is waked up and interactive.
*/
COMMON_EVENT_SCREEN_ON = "usual.event.SCREEN_ON",
/**
* this commonEvent means when the user is present after the device waked up.
*/
COMMON_EVENT_USER_PRESENT = "usual.event.USER_PRESENT",
/**
* this commonEvent means when the current time is changed.
*/
COMMON_EVENT_TIME_TICK = "usual.event.TIME_TICK",
/**
* this commonEvent means when the time is set.
*/
COMMON_EVENT_TIME_CHANGED = "usual.event.TIME_CHANGED",
/**
* this commonEvent means when the current date is changed.
*/
COMMON_EVENT_DATE_CHANGED = "usual.event.DATE_CHANGED",
/**
* this commonEvent means when the time zone is changed.
*/
COMMON_EVENT_TIMEZONE_CHANGED = "usual.event.TIMEZONE_CHANGED",
/**
* this commonEvent means when the dialog to dismiss.
*/
COMMON_EVENT_CLOSE_SYSTEM_DIALOGS = "usual.event.CLOSE_SYSTEM_DIALOGS",
/**
* this commonEvent means when a new application package is installed on the device.
*/
COMMON_EVENT_PACKAGE_ADDED = "usual.event.PACKAGE_ADDED",
/**
* this commonEvent means when a new version application package is installed on the device and
* replace the old version.the data contains the name of the package.
*/
COMMON_EVENT_PACKAGE_REPLACED = "usual.event.PACKAGE_REPLACED",
/**
* this commonEvent means when a new version application package is installed on the device and
* replace the old version, it does not contain additional data and only be sent to the replaced application.
*/
COMMON_EVENT_MY_PACKAGE_REPLACED = "usual.event.MY_PACKAGE_REPLACED",
/**
* this commonEvent means when an existing application package is removed from the device.
*/
COMMON_EVENT_PACKAGE_REMOVED = "usual.event.PACKAGE_REMOVED",
/**
* this commonEvent means when an existing application package is removed from the device.
*/
COMMON_EVENT_BUNDLE_REMOVED = "usual.event.BUNDLE_REMOVED",
/**
* this commonEvent means when an existing application package is completely removed from the device.
*/
COMMON_EVENT_PACKAGE_FULLY_REMOVED = "usual.event.PACKAGE_FULLY_REMOVED",
/**
* this commonEvent means when an existing application package has been changed.
*/
COMMON_EVENT_PACKAGE_CHANGED = "usual.event.PACKAGE_CHANGED",
/**
* this commonEvent means the user has restarted a package, and all of its processes have been killed.
*/
COMMON_EVENT_PACKAGE_RESTARTED = "usual.event.PACKAGE_RESTARTED",
/**
* this commonEvent means the user has cleared the package data.
*/
COMMON_EVENT_PACKAGE_DATA_CLEARED = "usual.event.PACKAGE_DATA_CLEARED",
/**
* this commonEvent means the packages have been suspended.
*/
COMMON_EVENT_PACKAGES_SUSPENDED = "usual.event.PACKAGES_SUSPENDED",
/**
* this commonEvent means the packages have been un-suspended.
*/
COMMON_EVENT_PACKAGES_UNSUSPENDED = "usual.event.PACKAGES_UNSUSPENDED",
/**
* this commonEvent Sent to a package that has been suspended by the system.
*/
COMMON_EVENT_MY_PACKAGE_SUSPENDED = "usual.event.MY_PACKAGE_SUSPENDED",
/**
* Sent to a package that has been un-suspended.
*/
COMMON_EVENT_MY_PACKAGE_UNSUSPENDED = "usual.event.MY_PACKAGE_UNSUSPENDED",
/**
* a user id has been removed from the system.
*/
COMMON_EVENT_UID_REMOVED = "usual.event.UID_REMOVED",
/**
* the application is first launched after installed.
*/
COMMON_EVENT_PACKAGE_FIRST_LAUNCH = "usual.event.PACKAGE_FIRST_LAUNCH",
/**
* sent by system package verifier when a package need to be verified.
*/
COMMON_EVENT_PACKAGE_NEEDS_VERIFICATION =
"usual.event.PACKAGE_NEEDS_VERIFICATION",
/**
* sent by system package verifier when a package is verified.
*/
COMMON_EVENT_PACKAGE_VERIFIED = "usual.event.PACKAGE_VERIFIED",
/**
* Resources for a set of packages (which were previously unavailable) are currently
* available since the media on which they exist is available.
*/
COMMON_EVENT_EXTERNAL_APPLICATIONS_AVAILABLE =
"usual.event.EXTERNAL_APPLICATIONS_AVAILABLE",
/**
* Resources for a set of packages are currently unavailable since the media on which they exist is unavailable.
*/
COMMON_EVENT_EXTERNAL_APPLICATIONS_UNAVAILABLE =
"usual.event.EXTERNAL_APPLICATIONS_UNAVAILABLE",
/**
* the device configuration such as orientation,locale have been changed.
*/
COMMON_EVENT_CONFIGURATION_CHANGED = "usual.event.CONFIGURATION_CHANGED",
/**
* The current device's locale has changed.
*/
COMMON_EVENT_LOCALE_CHANGED = "usual.event.LOCALE_CHANGED",
/**
* Indicates low memory condition notification acknowledged by user and package management should be started.
*/
COMMON_EVENT_MANAGE_PACKAGE_STORAGE = "usual.event.MANAGE_PACKAGE_STORAGE",
/**
* sent by the smart function when the system in drive mode.
*/
COMMON_EVENT_DRIVE_MODE = "common.event.DRIVE_MODE",
/**
* sent by the smart function when the system in home mode.
*/
COMMON_EVENT_HOME_MODE = "common.event.HOME_MODE",
/**
* sent by the smart function when the system in office mode.
*/
COMMON_EVENT_OFFICE_MODE = "common.event.OFFICE_MODE",
/**
* remind new user of preparing to start.
*/
COMMON_EVENT_USER_STARTED = "usual.event.USER_STARTED",
/**
* remind previous user of that the service has been the background.
*/
COMMON_EVENT_USER_BACKGROUND = "usual.event.USER_BACKGROUND",
/**
* remind new user of that the service has been the foreground.
*/
COMMON_EVENT_USER_FOREGROUND = "usual.event.USER_FOREGROUND",
/**
* remind new user of that the service has been switched to new user.
*/
COMMON_EVENT_USER_SWITCHED = "usual.event.USER_SWITCHED",
/**
* remind new user of that the service has been starting.
*/
COMMON_EVENT_USER_STARTING = "usual.event.USER_STARTING",
/**
* remind new user of that the service has been unlocked.
*/
COMMON_EVENT_USER_UNLOCKED = "usual.event.USER_UNLOCKED",
/**
* remind new user of that the service has been stopping.
*/
COMMON_EVENT_USER_STOPPING = "usual.event.USER_STOPPING",
/**
* remind new user of that the service has stopped.
*/
COMMON_EVENT_USER_STOPPED = "usual.event.USER_STOPPED",
/**
* HW id login successfully.
*/
COMMON_EVENT_HWID_LOGIN = "common.event.HWID_LOGIN",
/**
* HW id logout successfully.
*/
COMMON_EVENT_HWID_LOGOUT = "common.event.HWID_LOGOUT",
/**
* HW id is invalid.
*/
COMMON_EVENT_HWID_TOKEN_INVALID = "common.event.HWID_TOKEN_INVALID",
/**
* HW id logs off.
*/
COMMON_EVENT_HWID_LOGOFF = "common.event.HWID_LOGOFF",
/**
* WIFI state.
*/
COMMON_EVENT_WIFI_POWER_STATE = "usual.event.wifi.POWER_STATE",
/**
* WIFI scan results.
*/
COMMON_EVENT_WIFI_SCAN_FINISHED = "usual.event.wifi.SCAN_FINISHED",
/**
* WIFI RSSI change.
*/
COMMON_EVENT_WIFI_RSSI_VALUE = "usual.event.wifi.RSSI_VALUE",
/**
* WIFI connect state.
*/
COMMON_EVENT_WIFI_CONN_STATE = "usual.event.wifi.CONN_STATE",
/**
* WIFI hotspot state.
*/
COMMON_EVENT_WIFI_HOTSPOT_STATE = "usual.event.wifi.HOTSPOT_STATE",
/**
* WIFI ap sta join.
*/
COMMON_EVENT_WIFI_AP_STA_JOIN = "usual.event.wifi.WIFI_HS_STA_JOIN",
/**
* WIFI ap sta join.
*/
COMMON_EVENT_WIFI_AP_STA_LEAVE = "usual.event.wifi.WIFI_HS_STA_LEAVE",
/**
* Indicates Wi-Fi MpLink state notification acknowledged by binding or unbinding MpLink.
*/
COMMON_EVENT_WIFI_MPLINK_STATE = "usual.event.wifi.mplink.STATE_CHANGE",
/**
* Indicates Wi-Fi P2P connection state notification acknowledged by connecting or disconnecting P2P.
*/
COMMON_EVENT_WIFI_P2P_CONN_STATE = "usual.event.wifi.p2p.CONN_STATE_CHANGE",
/**
* Indicates that the Wi-Fi P2P state change.
*/
COMMON_EVENT_WIFI_P2P_STATE_CHANGED = "usual.event.wifi.p2p.STATE_CHANGE",
/**
* Indicates that the Wi-Fi P2P peers state change.
*/
COMMON_EVENT_WIFI_P2P_PEERS_STATE_CHANGED =
"usual.event.wifi.p2p.DEVICES_CHANGE",
/**
* Indicates that the Wi-Fi P2P discovery state change.
*/
COMMON_EVENT_WIFI_P2P_PEERS_DISCOVERY_STATE_CHANGED =
"usual.event.wifi.p2p.PEER_DISCOVERY_STATE_CHANGE",
/**
* Indicates that the Wi-Fi P2P current device state change.
*/
COMMON_EVENT_WIFI_P2P_CURRENT_DEVICE_STATE_CHANGED =
"usual.event.wifi.p2p.CURRENT_DEVICE_CHANGE",
/**
* Indicates that the Wi-Fi P2P group info is changed.
*/
COMMON_EVENT_WIFI_P2P_GROUP_STATE_CHANGED =
"usual.event.wifi.p2p.GROUP_STATE_CHANGED",
/**
* bluetooth.handsfree.ag.connect.state.update.
*/
COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_CONNECT_STATE_UPDATE =
"usual.event.bluetooth.handsfree.ag.CONNECT_STATE_UPDATE",
/**
* bluetooth.handsfree.ag.current.device.update.
*/
COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_CURRENT_DEVICE_UPDATE =
"usual.event.bluetooth.handsfree.ag.CURRENT_DEVICE_UPDATE",
/**
* bluetooth.handsfree.ag.audio.state.update.
*/
COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_AUDIO_STATE_UPDATE =
"usual.event.bluetooth.handsfree.ag.AUDIO_STATE_UPDATE",
/**
* bluetooth.a2dpsource.connect.state.update.
*/
COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CONNECT_STATE_UPDATE =
"usual.event.bluetooth.a2dpsource.CONNECT_STATE_UPDATE",
/**
* bluetooth.a2dpsource.current.device.update.
*/
COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CURRENT_DEVICE_UPDATE =
"usual.event.bluetooth.a2dpsource.CURRENT_DEVICE_UPDATE",
/**
* bluetooth.a2dpsource.playing.state.update.
*/
COMMON_EVENT_BLUETOOTH_A2DPSOURCE_PLAYING_STATE_UPDATE =
"usual.event.bluetooth.a2dpsource.PLAYING_STATE_UPDATE",
/**
* bluetooth.a2dpsource.avrcp.connect.state.update.
*/
COMMON_EVENT_BLUETOOTH_A2DPSOURCE_AVRCP_CONNECT_STATE_UPDATE =
"usual.event.bluetooth.a2dpsource.AVRCP_CONNECT_STATE_UPDATE",
/**
* bluetooth.a2dpsource.codec.value.update.
*/
COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CODEC_VALUE_UPDATE =
"usual.event.bluetooth.a2dpsource.CODEC_VALUE_UPDATE",
/**
* bluetooth.remotedevice.discovered.
*/
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_DISCOVERED =
"usual.event.bluetooth.remotedevice.DISCOVERED",
/**
* bluetooth.remotedevice.class.value.update.
*/
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CLASS_VALUE_UPDATE =
"usual.event.bluetooth.remotedevice.CLASS_VALUE_UPDATE",
/**
* bluetooth.remotedevice.acl.connected.
*/
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_ACL_CONNECTED =
"usual.event.bluetooth.remotedevice.ACL_CONNECTED",
/**
* bluetooth.remotedevice.acl.disconnected.
*/
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_ACL_DISCONNECTED =
"usual.event.bluetooth.remotedevice.ACL_DISCONNECTED",
/**
* bluetooth.remotedevice.name.update.
*/
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_NAME_UPDATE =
"usual.event.bluetooth.remotedevice.NAME_UPDATE",
/**
* bluetooth.remotedevice.pair.state.
*/
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIR_STATE =
"usual.event.bluetooth.remotedevice.PAIR_STATE",
/**
* bluetooth.remotedevice.battery.value.update.
*/
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_BATTERY_VALUE_UPDATE =
"usual.event.bluetooth.remotedevice.BATTERY_VALUE_UPDATE",
/**
* bluetooth.remotedevice.sdp.result.
*/
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_SDP_RESULT =
"usual.event.bluetooth.remotedevice.SDP_RESULT",
/**
* bluetooth.remotedevice.uuid.value.
*/
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_UUID_VALUE =
"usual.event.bluetooth.remotedevice.UUID_VALUE",
/**
* bluetooth.remotedevice.pairing.req.
*/
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIRING_REQ =
"usual.event.bluetooth.remotedevice.PAIRING_REQ",
/**
* bluetooth.remotedevice.pairing.cancel.
*/
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIRING_CANCEL =
"usual.event.bluetooth.remotedevice.PAIRING_CANCEL",
/**
* bluetooth.remotedevice.connect.req.
*/
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_REQ =
"usual.event.bluetooth.remotedevice.CONNECT_REQ",
/**
* bluetooth.remotedevice.connect.reply.
*/
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_REPLY =
"usual.event.bluetooth.remotedevice.CONNECT_REPLY",
/**
* bluetooth.remotedevice.connect.cancel.
*/
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_CANCEL =
"usual.event.bluetooth.remotedevice.CONNECT_CANCEL",
/**
* bluetooth.handsfreeunit.connect.state.update.
*/
COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_CONNECT_STATE_UPDATE =
"usual.event.bluetooth.handsfreeunit.CONNECT_STATE_UPDATE",
/**
* bluetooth.handsfreeunit.audio.state.update.
*/
COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AUDIO_STATE_UPDATE =
"usual.event.bluetooth.handsfreeunit.AUDIO_STATE_UPDATE",
/**
* bluetooth.handsfreeunit.ag.common.event.
*/
COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AG_COMMON_EVENT =
"usual.event.bluetooth.handsfreeunit.AG_COMMON_EVENT",
/**
* bluetooth.handsfreeunit.ag.call.state.update.
*/
COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AG_CALL_STATE_UPDATE =
"usual.event.bluetooth.handsfreeunit.AG_CALL_STATE_UPDATE",
/**
* bluetooth.host.state.update.
*/
COMMON_EVENT_BLUETOOTH_HOST_STATE_UPDATE =
"usual.event.bluetooth.host.STATE_UPDATE",
/**
* bluetooth.host.req.discoverable.
*/
COMMON_EVENT_BLUETOOTH_HOST_REQ_DISCOVERABLE =
"usual.event.bluetooth.host.REQ_DISCOVERABLE",
/**
* bluetooth.host.req.enable.
*/
COMMON_EVENT_BLUETOOTH_HOST_REQ_ENABLE = "usual.event.bluetooth.host.REQ_ENABLE",
/**
* bluetooth.host.req.disable.
*/
COMMON_EVENT_BLUETOOTH_HOST_REQ_DISABLE =
"usual.event.bluetooth.host.REQ_DISABLE",
/**
* bluetooth.host.scan.mode.update.
*/
COMMON_EVENT_BLUETOOTH_HOST_SCAN_MODE_UPDATE =
"usual.event.bluetooth.host.SCAN_MODE_UPDATE",
/**
* bluetooth.host.discovery.stated.
*/
COMMON_EVENT_BLUETOOTH_HOST_DISCOVERY_STARTED =
"usual.event.bluetooth.host.DISCOVERY_STARTED",
/**
* bluetooth.host.discovery.finished.
*/
COMMON_EVENT_BLUETOOTH_HOST_DISCOVERY_FINISHED =
"usual.event.bluetooth.host.DISCOVERY_FINISHED",
/**
* bluetooth.host.name.update.
*/
COMMON_EVENT_BLUETOOTH_HOST_NAME_UPDATE =
"usual.event.bluetooth.host.NAME_UPDATE",
/**
* bluetooth.a2dp.connect.state.update.
*/
COMMON_EVENT_BLUETOOTH_A2DPSINK_CONNECT_STATE_UPDATE =
"usual.event.bluetooth.a2dpsink.CONNECT_STATE_UPDATE",
/**
* bluetooth.a2dp.playing.state.update.
*/
COMMON_EVENT_BLUETOOTH_A2DPSINK_PLAYING_STATE_UPDATE =
"usual.event.bluetooth.a2dpsink.PLAYING_STATE_UPDATE",
/**
* bluetooth.a2dp.audio.state.update.
*/
COMMON_EVENT_BLUETOOTH_A2DPSINK_AUDIO_STATE_UPDATE =
"usual.event.bluetooth.a2dpsink.AUDIO_STATE_UPDATE",
/**
* nfc state change.
*/
COMMON_EVENT_NFC_ACTION_ADAPTER_STATE_CHANGED =
"usual.event.nfc.action.ADAPTER_STATE_CHANGED",
/**
* nfc field on detected.
*/
COMMON_EVENT_NFC_ACTION_RF_FIELD_ON_DETECTED =
"usual.event.nfc.action.RF_FIELD_ON_DETECTED",
/**
* nfc field off detected.
*/
COMMON_EVENT_NFC_ACTION_RF_FIELD_OFF_DETECTED =
"usual.event.nfc.action.RF_FIELD_OFF_DETECTED",
/**
* Sent when stop charging battery.
*/
COMMON_EVENT_DISCHARGING = "usual.event.DISCHARGING",
/**
* Sent when start charging battery.
*/
COMMON_EVENT_CHARGING = "usual.event.CHARGING",
/**
* Sent when device's idle mode changed
*/
COMMON_EVENT_DEVICE_IDLE_MODE_CHANGED = "usual.event.DEVICE_IDLE_MODE_CHANGED",
/**
* Sent when device's power save mode changed
*/
COMMON_EVENT_POWER_SAVE_MODE_CHANGED = "usual.event.POWER_SAVE_MODE_CHANGED",
/**
* user added.
*/
COMMON_EVENT_USER_ADDED = "usual.event.USER_ADDED",
/**
* user removed.
*/
COMMON_EVENT_USER_REMOVED = "usual.event.USER_REMOVED",
/**
* Sent when ability is added.
*/
COMMON_EVENT_ABILITY_ADDED = "common.event.ABILITY_ADDED",
/**
* Sent when ability is removed.
*/
COMMON_EVENT_ABILITY_REMOVED = "common.event.ABILITY_REMOVED",
/**
* Sent when ability is updated.
*/
COMMON_EVENT_ABILITY_UPDATED = "common.event.ABILITY_UPDATED",
/**
* gps mode state changed.
*/
COMMON_EVENT_LOCATION_MODE_STATE_CHANGED =
"usual.event.location.MODE_STATE_CHANGED",
/**
* The ivi is about to go into sleep state when the ivi is turned off power.
* This is a protected common event that can only be sent by system.
*/
COMMON_EVENT_IVI_SLEEP = "common.event.IVI_SLEEP",
/**
* The ivi is slept and notify the app stop playing.
* This is a protected common event that can only be sent by system.
*/
COMMON_EVENT_IVI_PAUSE = "common.event.IVI_PAUSE",
/**
* The ivi is standby and notify the app stop playing.
* This is a protected common event that can only be sent by system.
*/
COMMON_EVENT_IVI_STANDBY = "common.event.IVI_STANDBY",
/**
* The app stop playing and save state.
* This is a protected common event that can only be sent by system.
*/
COMMON_EVENT_IVI_LASTMODE_SAVE = "common.event.IVI_LASTMODE_SAVE",
/**
* The ivi is voltage abnormal.
* This is a protected common event that can only be sent by system.
*/
COMMON_EVENT_IVI_VOLTAGE_ABNORMAL = "common.event.IVI_VOLTAGE_ABNORMAL",
/**
* The ivi temperature is too high.
* This is a protected common event that can only be sent by system.this common event will be delete later,
* please use COMMON_EVENT_IVI_TEMPERATURE_ABNORMAL.
*/
COMMON_EVENT_IVI_HIGH_TEMPERATURE = "common.event.IVI_HIGH_TEMPERATURE",
/**
* The ivi temperature is extreme high.
* This is a protected common event that can only be sent by system.this common event will be delete later,
* please use COMMON_EVENT_IVI_TEMPERATURE_ABNORMAL.
*/
COMMON_EVENT_IVI_EXTREME_TEMPERATURE = "common.event.IVI_EXTREME_TEMPERATURE",
/**
* The ivi temperature is abnormal.
* This is a protected common event that can only be sent by system.
*/
COMMON_EVENT_IVI_TEMPERATURE_ABNORMAL = "common.event.IVI_TEMPERATURE_ABNORMAL",
/**
* The ivi voltage is recovery.
* This is a protected common event that can only be sent by system.
*/
COMMON_EVENT_IVI_VOLTAGE_RECOVERY = "common.event.IVI_VOLTAGE_RECOVERY",
/**
* The ivi temperature is recovery.
* This is a protected common event that can only be sent by system.
*/
COMMON_EVENT_IVI_TEMPERATURE_RECOVERY = "common.event.IVI_TEMPERATURE_RECOVERY",
/**
* The battery service is active.
* This is a protected common event that can only be sent by system.
*/
COMMON_EVENT_IVI_ACTIVE = "common.event.IVI_ACTIVE",
/**
* The usb state changed.
* This is a protected common event that can only be sent by system.
*/
COMMON_EVENT_USB_STATE = "usual.event.hardware.usb.action.USB_STATE",
/**
* The usb port changed.
* This is a protected common event that can only be sent by system.
*/
COMMON_EVENT_USB_PORT_CHANGED =
"usual.event.hardware.usb.action.USB_PORT_CHANGED",
/**
* The usb device attached.
* This is a protected common event that can only be sent by system.
*/
COMMON_EVENT_USB_DEVICE_ATTACHED =
"usual.event.hardware.usb.action.USB_DEVICE_ATTACHED",
/**
* The usb device detached.
* This is a protected common event that can only be sent by system.
*/
COMMON_EVENT_USB_DEVICE_DETACHED =
"usual.event.hardware.usb.action.USB_DEVICE_DETACHED",
/**
* The usb accessory attached.
* This is a protected common event that can only be sent by system.
*/
COMMON_EVENT_USB_ACCESSORY_ATTACHED =
"usual.event.hardware.usb.action.USB_ACCESSORY_ATTACHED",
/**
* The usb accessory detached.
* This is a protected common event that can only be sent by system.
*/
COMMON_EVENT_USB_ACCESSORY_DETACHED =
"usual.event.hardware.usb.action.USB_ACCESSORY_DETACHED",
/**
* The storage space is low.
* This is a protected common event that can only be sent by system.
*/
COMMON_EVENT_DEVICE_STORAGE_LOW = "usual.event.DEVICE_STORAGE_LOW",
/**
* The storage space is normal.
* This is a protected common event that can only be sent by system.
*/
COMMON_EVENT_DEVICE_STORAGE_OK = "usual.event.DEVICE_STORAGE_OK",
/**
* The storage space is full.
* This is a protected common event that can only be sent by system.
*/
COMMON_EVENT_DEVICE_STORAGE_FULL = "usual.event.DEVICE_STORAGE_FULL",
/**
* The network connection was changed.
* This is a protected common event that can only be sent by system.
*/
COMMON_EVENT_CONNECTIVITY_CHANGE = "usual.event.CONNECTIVITY_CHANGE",
/**
* The external storage was removed.
* This is a protected common event that can only be sent by system.
*/
COMMON_EVENT_DISK_REMOVED = "usual.event.data.DISK_REMOVED",
/**
* The external storage was unmounted.
* This is a protected common event that can only be sent by system.
*/
COMMON_EVENT_DISK_UNMOUNTED = "usual.event.data.DISK_UNMOUNTED",
/**
* The external storage was mounted.
* This is a protected common event that can only be sent by system.
*/
COMMON_EVENT_DISK_MOUNTED = "usual.event.data.DISK_MOUNTED",
/**
* The external storage was bad removal.
* This is a protected common event that can only be sent by system.
*/
COMMON_EVENT_DISK_BAD_REMOVAL = "usual.event.data.DISK_BAD_REMOVAL",
/**
* The external storage was unmountable.
* This is a protected common event that can only be sent by system.
*/
COMMON_EVENT_DISK_UNMOUNTABLE = "usual.event.data.DISK_UNMOUNTABLE",
/**
* The external storage was eject.
* This is a protected common event that can only be sent by system.
*/
COMMON_EVENT_DISK_EJECT = "usual.event.data.DISK_EJECT",
/**
* The visible of account was updated.
* This is a protected common event that can only be sent by system.
*/
COMMON_EVENT_VISIBLE_ACCOUNTS_UPDATED =
"usual.event.data.VISIBLE_ACCOUNTS_UPDATED",
/**
* Account was deleted.
* This is a protected common event that can only be sent by system.
*/
COMMON_EVENT_ACCOUNT_DELETED = "usual.event.data.ACCOUNT_DELETED",
/**
* Foundation was ready.
* This is a protected common event that can only be sent by system.
*/
COMMON_EVENT_FOUNDATION_READY = "common.event.FOUNDATION_READY",
/**
* Indicates the action of a common event that the phone SIM card state has changed.
* This is a protected common event that can only be sent by system.
*/
COMMON_EVENT_SIM_CARD_DEFAULT_VOICE_SUBSCRIPTION_CHANGED =
"usual.event.SIM.DEFAULT_VOICE_SUBSCRIPTION_CHANGED",
/**
* Indicates the action of a common event that the phone SIM card state has changed.
* This is a protected common event that can only be sent by system.
*/
COMMON_EVENT_SIM_STATE_CHANGED = "usual.event.SIM.CARD_STATE_CHANGED",
/**
* Indicates the common event Action indicating that the airplane mode status of the device changes.
* Users can register this event to listen to the change of the airplane mode status of the device.
*/
COMMON_EVENT_AIRPLANE_MODE_CHANGED = "usual.event.AIRPLANE_MODE",
/**
* Only for test case.
*/
COMMON_EVENT_TEST_ACTION1 = "usual.event.test1",
/**
* Only for test case.
*/
COMMON_EVENT_TEST_ACTION2 = "usual.event.test2"
}
}
export default commonEvent;
+52
View File
@@ -0,0 +1,52 @@
/*
* 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.
*/
/**
* the data of the commonEvent
* @name CommonEventData
* @since 7
* @permission N/A
*/
export interface CommonEventData {
/**
* event type
* @default -
* @since 7
*/
event: string
/**
* bundle name
* @default -
* @since 7
*/
bundleName?: string;
/**
* The custom result code of the common event.
*
* @default 0
* @since 7
*/
code?: number;
/**
* The custom result data of the common event.
*
* @default ""
* @since 7
*/
data?: string;
}
@@ -0,0 +1,69 @@
/*
* 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.
*/
/**
* containing the common event content and attributes
* @name CommonEventPublishData
* @since 7
* @permission N/A
*/
export interface CommonEventPublishData {
/**
* bundle name
* @default -
* @since 7
*/
bundleName?: string;
/**
* The custom result code of the common event.
*
* @default 0
* @since 7
*/
code?: number;
/**
* The custom result data of the common event.
*
* @default ""
* @since 7
*/
data?: string;
/**
* The permissions for subscribers. Only subscribers with required permissions can receive published common events.
*
* @default -
* @since 7
*/
subscriberPermissions?: Array<string>;
/**
* Whether the type of a common event is ordered or not.
*
* @default false
* @since 7
*/
isOrdered?: boolean;
/**
* Whether the type of a common event is sticky or not.
*
* @default false
* @since 7
*/
isSticky?: boolean;
}
@@ -0,0 +1,65 @@
/*
* 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.
*/
/**
* the information of the subscriber
* @name CommonEventSubscribeInfo
* @since 7
* @permission N/A
*/
export interface CommonEventSubscribeInfo {
/**
* The permission that the publisher must have in order to send a common event to this subscriber.
* This subscriber receives only common events sent by publishers granted with this permission.
*
* @default ""
* @since 7
*/
events: Array<string>
/**
* The permission that the publisher must have in order to send a common event to this subscriber.
* This subscriber receives only common events sent by publishers granted with this permission.
*
* @default ""
* @since 7
*/
publisherPermission?: string;
/**
* deviceId Indicates the device ID. The value must be an existing device ID on the same ohos network.
*
* @default ""
* @since 7
*/
publisherDeviceId?: string;
/**
* Indicates the user ID. This parameter is optional, and the default value is the ID of the
* current user. If this parameter is specified, the value must be an existing user ID in the system.
*
* @default ""
* @since 7
*/
userId?: number;
/**
* Indicates the subscriber priority. The value ranges from -100 to 1000.
*
* @default ""
* @since 7
*/
priority?: number;
}
@@ -0,0 +1,230 @@
/*
* 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.
*/
import { AsyncCallback } from './../basic';
import { CommonEventSubscribeInfo } from './commonEventSubscribeInfo';
/**
* the subscriber of common event
* @name CommonEventSubscriber
* @since 7
* @permission N/A
*/
export interface CommonEventSubscriber {
/**
* Obtains the result code of the current ordered common event.
*
* @since 7
* @param callback Indicate the callback funtion to receive the common event.
* @return -
*/
getCode(callback: AsyncCallback<number>): void;
/**
* Obtains the result code of the current ordered common event.
*
* @since 7
* @param callback Indicate the callback funtion to receive the common event.
* @return -
*/
getCode(): Promise<number>;
/**
* Sets the result code of the current ordered common event.
*
* @since 7
* @param code Indicates the custom result code to set. You can set it to any value.
* @param callback Indicate the callback funtion to receive the common event.
* @return -
*/
setCode(code: number, callback: AsyncCallback<void>): void;
/**
* Sets the result code of the current ordered common event.
*
* @since 7
* @param code Indicates the custom result code to set. You can set it to any value.
* @param callback Indicate the callback funtion to receive the common event.
* @return -
*/
setCode(code: number): Promise<void>;
/**
* Obtains the result data of the current ordered common event.
*
* @since 7
* @param callback Indicate the callback funtion to receive the common event.
* @return -
*/
getData(callback: AsyncCallback<string>): void;
/**
* Obtains the result data of the current ordered common event.
*
* @since 7
* @param callback Indicate the callback funtion to receive the common event.
* @return -
*/
getData(): Promise<string>;
/**
* Sets the result data of the current ordered common event.
*
* @since 7
* @param data Indicates the custom result data to set. You can set it to any character string.
* @param callback Indicate the callback funtion to receive the common event.
* @return -
*/
setData(data: string, callback: AsyncCallback<void>): void;
/**
* Sets the result data of the current ordered common event.
*
* @since 7
* @param data Indicates the custom result data to set. You can set it to any character string.
* @param callback Indicate the callback funtion to receive the common event.
* @return -
*/
setData(data: string): Promise<void>;
/**
* Sets the result of the current ordered common event.
*
* @since 7
* @param code Indicates the custom result code to set. You can set it to any value.
* @param data Indicates the custom result data to set. You can set it to any character string.
* @param callback Indicate the callback funtion to receive the common event.
* @return -
*/
setCodeAndData(code: number, data: string, callback: AsyncCallback<void>): void;
/**
* Sets the result of the current ordered common event.
*
* @since 7
* @param code Indicates the custom result code to set. You can set it to any value.
* @param data Indicates the custom result data to set. You can set it to any character string.
* @param callback Indicate the callback funtion to receive the common event.
* @return -
*/
setCodeAndData(code: number, data: string): Promise<void>;
/**
* Checks whether the current common event is an ordered common event.
*
* @since 7
* @param callback Indicate the callback funtion to receive the common event.
* @return -
*/
isOrderedCommonEvent(callback: AsyncCallback<boolean>): void;
/**
* Checks whether the current common event is an ordered common event.
*
* @since 7
* @param callback Indicate the callback funtion to receive the common event.
* @return -
*/
isOrderedCommonEvent(): Promise<boolean>;
/**
* Checks whether the current common event is a sticky common event.
*
* @since 7
* @param callback Indicate the callback funtion to receive the common event.
* @return -
*/
isStickyCommonEvent(callback: AsyncCallback<boolean>): void;
/**
* Checks whether the current common event is a sticky common event.
*
* @since 7
* @param callback Indicate the callback funtion to receive the common event.
* @return -
*/
isStickyCommonEvent(): Promise<boolean>;
/**
* Aborts the current ordered common event.
*
* @since 7
* @param callback Indicate the callback funtion to receive the common event.
* @return -
*/
abortCommonEvent(callback: AsyncCallback<void>): void;
/**
* Aborts the current ordered common event.
*
* @since 7
* @param callback Indicate the callback funtion to receive the common event.
* @return -
*/
abortCommonEvent(): Promise<void>;
/**
* Clears the abort state of the current ordered common event
*
* @since 7
* @param callback Indicate the callback funtion to receive the common event.
* @return -
*/
clearAbortCommonEvent(callback: AsyncCallback<void>): void;
/**
* Clears the abort state of the current ordered common event
*
* @since 7
* @param callback Indicate the callback funtion to receive the common event.
* @return -
*/
clearAbortCommonEvent(): Promise<void>;
/**
* Checks whether the current ordered common event should be aborted.
*
* @since 7
* @param callback Indicate the callback funtion to receive the common event.
* @return -
*/
getAbortCommonEvent(callback: AsyncCallback<boolean>): void;
/**
* Checks whether the current ordered common event should be aborted.
*
* @since 7
* @param callback Indicate the callback funtion to receive the common event.
* @return -
*/
getAbortCommonEvent(): Promise<boolean>;
/**
* get the CommonEventSubscribeInfo of this CommonEventSubscriber.
*
* @since 7
* @param callback Indicate the callback funtion to receive the common event.
* @return -
*/
getSubscribeInfo(callback: AsyncCallback<CommonEventSubscribeInfo>): void;
/**
* get the CommonEventSubscribeInfo of this CommonEventSubscriber.
*
* @since 7
* @param callback Indicate the callback funtion to receive the common event.
* @return -
*/
getSubscribeInfo(): Promise<CommonEventSubscribeInfo>;
}
@@ -1,6 +1,6 @@
/*
* Copyright (c); 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");;
* 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
*
@@ -50,26 +50,26 @@ static napi_value g_CommonEventSubscriber;
static std::map<std::shared_ptr<SubscriberInstance>, subscriberInstanceInfo> subscriberInstances;
struct AsyncCallbackInfoSubscribe {
napi_env env;
napi_env env = nullptr;
napi_async_work asyncWork;
napi_ref callback = 0;
std::shared_ptr<SubscriberInstance> subscriber;
napi_ref callback = nullptr;
std::shared_ptr<SubscriberInstance> subscriber = nullptr;
};
struct AsyncCallbackInfoUnsubscribe {
napi_env env;
napi_env env = nullptr;
napi_async_work asyncWork;
napi_ref callback = 0;
size_t argc;
std::shared_ptr<SubscriberInstance> subscriber;
napi_ref callback = nullptr;
size_t argc = 0;
std::shared_ptr<SubscriberInstance> subscriber = nullptr;
};
struct AsyncCallbackInfoSubscribeInfo {
napi_env env;
napi_env env = nullptr;
napi_async_work asyncWork;
napi_ref callback = 0;
napi_deferred deferred;
SubscriberInstance *objectInfo;
napi_ref callback = nullptr;
napi_deferred deferred = nullptr;
SubscriberInstance *objectInfo = nullptr;
std::vector<std::string> events;
std::string permission;
std::string deviceId;
@@ -78,139 +78,131 @@ struct AsyncCallbackInfoSubscribeInfo {
};
struct AsyncCallbackInfoOrderedCommonEvent {
napi_env env;
napi_env env = nullptr;
napi_async_work asyncWork;
napi_ref callback = 0;
napi_deferred deferred;
SubscriberInstance *objectInfo;
napi_ref callback = nullptr;
napi_deferred deferred = nullptr;
SubscriberInstance *objectInfo = nullptr;
bool isCallback = false;
bool isOrdered = false;
};
struct AsyncCallbackInfoStickyCommonEvent {
napi_env env;
napi_env env = nullptr;
napi_async_work asyncWork;
napi_ref callback = 0;
napi_deferred deferred;
SubscriberInstance *objectInfo;
napi_ref callback = nullptr;
napi_deferred deferred = nullptr;
SubscriberInstance *objectInfo = nullptr;
bool isSticky = false;
bool isCallback = false;
};
struct AsyncCallbackInfoGetCode {
napi_env env;
napi_env env = nullptr;
napi_async_work asyncWork;
napi_ref callback = 0;
napi_deferred deferred;
SubscriberInstance *objectInfo;
napi_ref callback = nullptr;
napi_deferred deferred = nullptr;
SubscriberInstance *objectInfo = nullptr;
int code = 0;
bool isCallback = false;
};
struct AsyncCallbackInfoSetCode {
napi_env env;
napi_env env = nullptr;
napi_async_work asyncWork;
napi_ref callback = 0;
napi_deferred deferred;
SubscriberInstance *objectInfo;
napi_ref callback = nullptr;
napi_deferred deferred = nullptr;
SubscriberInstance *objectInfo = nullptr;
int code = 0;
bool isCallback = false;
};
struct AsyncCallbackInfoGetData {
napi_env env;
napi_env env = nullptr;
napi_async_work asyncWork;
napi_ref callback = 0;
napi_deferred deferred;
SubscriberInstance *objectInfo;
napi_ref callback = nullptr;
napi_deferred deferred = nullptr;
SubscriberInstance *objectInfo = nullptr;
std::string data;
bool isCallback = false;
};
struct AsyncCallbackInfoSetData {
napi_env env;
napi_env env = nullptr;
napi_async_work asyncWork;
napi_ref callback = 0;
napi_deferred deferred;
SubscriberInstance *objectInfo;
napi_ref callback = nullptr;
napi_deferred deferred = nullptr;
SubscriberInstance *objectInfo = nullptr;
std::string data;
bool isCallback = false;
};
struct AsyncCallbackInfoSetCodeAndData {
napi_env env;
napi_env env = nullptr;
napi_async_work asyncWork;
napi_ref callback = 0;
napi_deferred deferred;
SubscriberInstance *objectInfo;
napi_ref callback = nullptr;
napi_deferred deferred = nullptr;
SubscriberInstance *objectInfo = nullptr;
int code = 0;
std::string data;
bool isCallback = false;
};
struct AsyncCallbackInfoAbort {
napi_env env;
napi_env env = nullptr;
napi_async_work asyncWork;
napi_ref callback = 0;
napi_deferred deferred;
SubscriberInstance *objectInfo;
napi_ref callback = nullptr;
napi_deferred deferred = nullptr;
SubscriberInstance *objectInfo = nullptr;
bool isCallback = false;
};
struct AsyncCallbackInfoClearAbort {
napi_env env;
napi_env env = nullptr;
napi_async_work asyncWork;
napi_ref callback = 0;
napi_deferred deferred;
SubscriberInstance *objectInfo;
napi_ref callback = nullptr;
napi_deferred deferred = nullptr;
SubscriberInstance *objectInfo = nullptr;
bool isCallback = false;
};
struct AsyncCallbackInfoGetAbort {
napi_env env;
napi_env env = nullptr;
napi_async_work asyncWork;
napi_ref callback = 0;
napi_deferred deferred;
SubscriberInstance *objectInfo;
napi_ref callback = nullptr;
napi_deferred deferred = nullptr;
SubscriberInstance *objectInfo = nullptr;
bool abortEvent = false;
bool isCallback = false;
};
struct AsyncCallbackInfoFinish {
napi_env env;
napi_env env = nullptr;
napi_async_work asyncWork;
napi_ref callback = 0;
napi_deferred deferred;
SubscriberInstance *objectInfo;
napi_ref callback = nullptr;
napi_deferred deferred = nullptr;
SubscriberInstance *objectInfo = nullptr;
bool isCallback = false;
};
struct AsyncCallbackInfoCreate {
napi_env env;
napi_env env = nullptr;
napi_async_work asyncWork;
napi_ref callback = 0;
napi_deferred deferred;
napi_ref subscriberInfo = 0;
napi_ref callback = nullptr;
napi_deferred deferred = nullptr;
napi_ref subscriberInfo = nullptr;
bool isCallback = false;
napi_value result = 0;
napi_value result = nullptr;
};
struct AsyncCallbackInfoPublish {
napi_env env;
napi_env env = nullptr;
napi_async_work asyncWork;
napi_ref callback = 0;
napi_ref callback = nullptr;
CommonEventData commonEventData;
CommonEventPublishInfo commonEventPublishInfo;
};
struct CommonEventSubscribeInfoByjs {
std::vector<std::string> events;
std::string publisherPermission;
std::string publisherDeviceId;
int userId = 0;
int priority = 0;
};
struct CommonEventPublishDataByjs {
std::string bundleName;
std::string data;
@@ -221,8 +213,8 @@ struct CommonEventPublishDataByjs {
};
struct CommonEventDataWorker {
napi_env env;
napi_ref ref = 0;
napi_env env = nullptr;
napi_ref ref = nullptr;
Want want;
int code = 0;
std::string data;
@@ -239,16 +231,16 @@ public:
void SetCallbackRef(const napi_ref &ref);
private:
napi_env env_;
napi_ref ref_;
napi_env env_ = nullptr;
napi_ref ref_ = nullptr;
};
napi_value NapiGetNull(napi_env env);
napi_value GetCallbackErrorValue(napi_env env, int errCode);
napi_value ParseParametersByCreateSubscriber(const napi_env &env, const napi_value (&argv)[CREATE_MAX_PARA],
const size_t &argc, CommonEventSubscribeInfoByjs &subscribeInfo, napi_ref &callback);
napi_value ParseParametersByCreateSubscriber(
const napi_env &env, const napi_value (&argv)[CREATE_MAX_PARA], const size_t &argc, napi_ref &callback);
void SetCallback(const napi_env &env, const napi_ref &callbackIn, const napi_value &result);
@@ -405,7 +397,7 @@ napi_value ParseParametersByUnsubscribe(const napi_env &env, const size_t &argc,
const napi_value (&argv)[UNSUBSCRIBE_MAX_PARA], std::shared_ptr<SubscriberInstance> &subscriber,
napi_ref &callback);
void NapiDeleteSubscribe(std::shared_ptr<SubscriberInstance> &subscriber);
void NapiDeleteSubscribe(const napi_env &env, std::shared_ptr<SubscriberInstance> &subscriber);
napi_value Unsubscribe(napi_env env, napi_callback_info info);
@@ -1,6 +1,6 @@
/*
* Copyright (c); 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");;
* 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
*
File diff suppressed because it is too large Load Diff
@@ -1,6 +1,6 @@
/*
* Copyright (c); 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");;
* 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
*
+1 -1
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2021 Huawei Device Co., Ltd.
<!-- 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.
+2 -2
View File
@@ -23,7 +23,7 @@ namespace OHOS {
namespace EventFwk {
struct HistorySubscriberRecord {
struct tm recordTime;
struct tm recordTime {};
std::string bundleName;
int32_t priority;
std::string permission;
@@ -55,7 +55,7 @@ struct History_event_record {
bool ordered;
std::vector<std::string> subscriberPermissions;
struct tm recordTime;
struct tm recordTime {};
pid_t pid;
uid_t uid;
std::string bundleName;
@@ -1149,4 +1149,4 @@ void CommonEventControlManager::DumpHistoryState(const std::string &event, std::
}
} // namespace EventFwk
} // namespace OHOS
} // namespace OHOS
@@ -151,6 +151,16 @@ public:
{
return true;
}
/**
* @brief Query the AbilityInfo of list by the given Want.
* @param want Indicates the information of the ability.
* @param abilityInfos Indicates the obtained AbilityInfos object.
* @return Returns true if the AbilityInfos is successfully obtained; returns false otherwise.
*/
virtual bool QueryAbilityInfos(const Want &want, std::vector<AbilityInfo> &abilityInfos) override
{
return true;
}
/**
* @brief Query the AbilityInfo by ability.uri in config.json.
* @param abilityUri Indicates the uri of the ability.
@@ -532,6 +542,29 @@ public:
{
return true;
}
/**
* @brief Get module usage record list in descending order of lastLaunchTime.
* @param maxNum the return size of the records, must be in range of 1 to 1000.
* @param moduleUsageRecords List of ModuleUsageRecord objects if obtained.
* @return Returns true if this function is successfully called; returns false otherwise.
*/
virtual bool GetModuleUsageRecords(
const int32_t number, std::vector<ModuleUsageRecord> &moduleUsageRecords) override
{
return true;
}
/**
* @brief Notify a specified ability for activity.
* @param bundleName Indicates the bundle name of the ability to activity.
* @param abilityName Indicates the name of the ability to activity.
* @param launchTime Indicates the ability launchTime.
* @return Returns true if this function is successfully called; returns false otherwise.
*/
virtual bool NotifyActivityLifeStatus(
const std::string &bundleName, const std::string &abilityName, const int64_t launchTime) override
{
return true;
}
void MockSetIsSystemApp(bool isSystemApp);
private:
bool isSystemApp_ = false;
+7 -9
View File
@@ -1,17 +1,15 @@
#
# 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
# 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.
# 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.
import("//base/notification/ces_standard/event.gni")
cflags = []
@@ -1,17 +1,15 @@
#
# 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
# 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.
# 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.
import("//base/notification/ces_standard/event.gni")
import("//build/test.gni")
@@ -1,17 +1,15 @@
#
# 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
# 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.
# 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.
import("//base/notification/ces_standard/event.gni")
import("//build/test.gni")
@@ -87,7 +87,7 @@ HWTEST_F(CommonEventPublishManagerEventUnitTest, CommonEventPublishManagerEventU
GTEST_LOG_(INFO)
<< "CommonEventPublishManagerEventUnitTest, CommonEventPublishManagerEventUnitTestt_0100, TestSize.Level1";
int i = 0;
bool result;
bool result = false;
int64_t startTime = SystemTime::GetNowSysTime();
int64_t lastTime = 0;
int64_t innternal = 0;
@@ -253,7 +253,9 @@ HWTEST_F(CommonEventPublishOrderedEventUnitTest, CommonEventPublishOrderedUnitTe
mtx.lock();
struct tm curTime{0};
struct tm curTime {
0
};
// publish ordered event
bool result =
innerCommonEventManager.PublishCommonEvent(data, publishInfo, commonEventListener, curTime, 0, 0, "bundlename");
@@ -299,7 +301,9 @@ HWTEST_F(CommonEventPublishOrderedEventUnitTest, CommonEventPublishOrderedUnitTe
// make commonEventListener
OHOS::sptr<CommonEventListener> commonEventListener = new CommonEventListener(subscriber);
struct tm curTime{0};
struct tm curTime {
0
};
// publish ordered event
bool result =
innerCommonEventManager.PublishCommonEvent(data, publishInfo, commonEventListener, curTime, 0, 0, "bundlename");
@@ -346,7 +350,8 @@ HWTEST_F(CommonEventPublishOrderedEventUnitTest, CommonEventPublishOrderedUnitTe
mtx.lock();
bool result = commonEventControlManager->PublishCommonEvent(commonEventRecord, commonEventListenerPtr);
bool result = false;
result = commonEventControlManager->PublishCommonEvent(commonEventRecord, commonEventListenerPtr);
EXPECT_EQ(true, result);
int count = 0;
@@ -685,7 +690,9 @@ HWTEST_F(CommonEventPublishOrderedEventUnitTest, CommonEventPublishOrderedUnitTe
mtx.lock();
struct tm curTime{0};
struct tm curTime {
0
};
// publish ordered event
bool result =
innerCommonEventManager.PublishCommonEvent(data, publishInfo, commonEventListener, curTime, 0, 0, "bundlename");
@@ -739,7 +746,9 @@ HWTEST_F(CommonEventPublishOrderedEventUnitTest, CommonEventPublishOrderedUnitTe
mtx.lock();
struct tm curTime{0};
struct tm curTime {
0
};
// publish ordered event
bool result =
innerCommonEventManager.PublishCommonEvent(data, publishInfo, commonEventListener, curTime, 0, 0, "bundlename");
@@ -793,7 +802,9 @@ HWTEST_F(CommonEventPublishOrderedEventUnitTest, CommonEventPublishOrderedUnitTe
mtx.lock();
struct tm curTime{0};
struct tm curTime {
0
};
// publish ordered event
bool result =
innerCommonEventManager.PublishCommonEvent(data, publishInfo, commonEventListener, curTime, 0, 0, "bundlename");
@@ -847,7 +858,9 @@ HWTEST_F(CommonEventPublishOrderedEventUnitTest, CommonEventPublishOrderedUnitTe
mtx.lock();
struct tm curTime{0};
struct tm curTime {
0
};
// publish ordered event
bool result =
innerCommonEventManager.PublishCommonEvent(data, publishInfo, commonEventListener, curTime, 0, 0, "bundlename");
@@ -154,6 +154,16 @@ public:
{
return true;
}
/**
* @brief Query the AbilityInfo of list by the given Want.
* @param want Indicates the information of the ability.
* @param abilityInfos Indicates the obtained AbilityInfos object.
* @return Returns true if the AbilityInfos is successfully obtained; returns false otherwise.
*/
virtual bool QueryAbilityInfos(const Want &want, std::vector<AbilityInfo> &abilityInfos) override
{
return true;
}
/**
* @brief Query the AbilityInfo by ability.uri in config.json.
* @param abilityUri Indicates the uri of the ability.
@@ -536,7 +546,29 @@ public:
return true;
}
void MockSetIsSystemApp(bool isSystemApp);
/**
* @brief Get module usage record list in descending order of lastLaunchTime.
* @param maxNum the return size of the records, must be in range of 1 to 1000.
* @param moduleUsageRecords List of ModuleUsageRecord objects if obtained.
* @return Returns true if this function is successfully called; returns false otherwise.
*/
virtual bool GetModuleUsageRecords(
const int32_t number, std::vector<ModuleUsageRecord> &moduleUsageRecords) override
{
return true;
}
/**
* @brief Notify a specified ability for activity.
* @param bundleName Indicates the bundle name of the ability to activity.
* @param abilityName Indicates the name of the ability to activity.
* @param launchTime Indicates the ability launchTime.
* @return Returns true if this function is successfully called; returns false otherwise.
*/
virtual bool NotifyActivityLifeStatus(
const std::string &bundleName, const std::string &abilityName, const int64_t launchTime) override
{
return true;
}
private:
bool isSystemApp_ = false;
bool isSystemAppMock_ = false;
@@ -81,7 +81,7 @@ int MockBundleMgrService::CheckPermission(const std::string &bundleName, const s
}
}
if (!bundleName.compare("case4")) { // ¡°ohos.permission.WRITE_USER_STORAGE¡± or ¡°ohos.permission.READ_USER_STORAGE¡±
if (!bundleName.compare("case4")) { // ohos.permission.WRITE_USER_STORAGE or ohos.permission.READ_USER_STORAGE
if (num2 == 0) {
if (!permission.compare("ohos.permission.WRITE_USER_STORAGE")) {
num2++;
+7 -9
View File
@@ -1,17 +1,15 @@
#
# 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
# 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.
# 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.
import("//base/notification/ces_standard/event.gni")
+7 -9
View File
@@ -1,17 +1,15 @@
#
# 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
# 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.
# 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.
import("//base/notification/ces_standard/event.gni")
import("//build/ohos.gni")
@@ -1,17 +1,15 @@
#
# 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
# 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.
# 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.
import("//base/notification/ces_standard/event.gni")
import("//build/test.gni")
@@ -50,8 +50,6 @@ public:
void SetUp();
void TearDown();
bool SubscribeCommonEventTest(const CommonEventSubscribeInfo &subscriberInfo);
bool UnsubscribeCommonEventTest(const CommonEventSubscribeInfo &subscriberInfo);
static StressTestLevel stLevel_;
};
StressTestLevel ActsCESCESpublishInfoTest::stLevel_{};
@@ -70,32 +68,10 @@ void ActsCESCESpublishInfoTest::TearDownTestCase()
{}
void ActsCESCESpublishInfoTest::SetUp()
{
OHOS::DelayedSingleton<CommonEventManagerService>::GetInstance()->OnStart();
}
{}
void ActsCESCESpublishInfoTest::TearDown()
{
OHOS::DelayedSingleton<CommonEventManagerService>::GetInstance()->OnStop();
}
bool ActsCESCESpublishInfoTest::SubscribeCommonEventTest(const CommonEventSubscribeInfo &subscriberInfo)
{
bool result = false;
auto subscriberPtr = std::make_shared<ActsCommonEventServicesSystemTest>(subscriberInfo);
result = CommonEventManager::SubscribeCommonEvent(subscriberPtr);
return result;
}
bool ActsCESCESpublishInfoTest::UnsubscribeCommonEventTest(const CommonEventSubscribeInfo &subscriberInfo)
{
bool result = false;
auto subscriberPtr = std::make_shared<ActsCommonEventServicesSystemTest>(subscriberInfo);
if (CommonEventManager::SubscribeCommonEvent(subscriberPtr)) {
result = CommonEventManager::UnSubscribeCommonEvent(subscriberPtr);
}
return result;
}
{}
/*
* @tc.number: CES_PublishInfo_Sticky_0100
@@ -112,11 +88,10 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Sticky_0100, Function | Medi
for (int i = 1; i <= stLevel_.CESLevel; i++) {
matchingSkills.AddEvent(eventName);
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
SubscribeCommonEventTest(subscribeInfo);
CommonEventPublishInfo publishInfo;
publishInfo.SetSticky(sticky);
if (publishInfo.IsSticky()) {
printf("CES_PublishInfo_Sticky_0100 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0100 faild, frequency: " << i;
result = false;
break;
} else {
@@ -125,7 +100,8 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Sticky_0100, Function | Medi
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_PublishInfo_Sticky_0100 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0100 stress level: " << stLevel_.CESLevel;
GTEST_LOG_(INFO) << "CES_SetEventAuthority_0100 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -145,11 +121,10 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Sticky_0200, Function | Medi
for (int i = 1; i <= stLevel_.CESLevel; i++) {
matchingSkills.AddEvent(eventName);
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
SubscribeCommonEventTest(subscribeInfo);
CommonEventPublishInfo publishInfo;
publishInfo.SetSticky(sticky);
if (!publishInfo.IsSticky()) {
printf("CES_PublishInfo_Sticky_0200 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0200 faild, frequency: " << i;
result = false;
break;
} else {
@@ -158,7 +133,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Sticky_0200, Function | Medi
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_PublishInfo_Sticky_0200 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0200 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -181,7 +156,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Sticky_0300, Function | Medi
CommonEventPublishInfo publishInfo;
publishInfo.SetSticky(sticky);
if (publishInfo.IsSticky()) {
printf("CES_PublishInfo_Sticky_0300 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0300 faild, frequency: " << i;
result = false;
break;
} else {
@@ -190,7 +165,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Sticky_0300, Function | Medi
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_PublishInfo_Sticky_0300 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0300 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -213,7 +188,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Sticky_0400, Function | Medi
CommonEventPublishInfo publishInfo;
publishInfo.SetSticky(sticky);
if (!publishInfo.IsSticky()) {
printf("CES_PublishInfo_Sticky_0400 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0400 faild, frequency: " << i;
result = false;
break;
} else {
@@ -222,7 +197,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Sticky_0400, Function | Medi
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_PublishInfo_Sticky_0400 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0400 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -243,7 +218,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Sticky_0500, Function | Medi
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
CommonEventPublishInfo publishInfo;
if (publishInfo.IsSticky()) {
printf("CES_PublishInfo_Sticky_0500 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0500 faild, frequency: " << i;
result = false;
break;
} else {
@@ -252,7 +227,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Sticky_0500, Function | Medi
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_PublishInfo_Sticky_0500 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0500 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -278,7 +253,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Sticky_0600, Function | Medi
sticky = false;
publishInfo.SetSticky(sticky);
if (publishInfo.IsSticky()) {
printf("CES_PublishInfo_Sticky_0600 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0600 faild, frequency: " << i;
result = false;
break;
} else {
@@ -288,7 +263,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Sticky_0600, Function | Medi
sticky = true;
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_PublishInfo_Sticky_0600 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0600 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -314,7 +289,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Sticky_0700, Function | Medi
sticky = true;
publishInfo.SetSticky(sticky);
if (!publishInfo.IsSticky()) {
printf("CES_PublishInfo_Sticky_0700 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0700 faild, frequency: " << i;
result = false;
break;
} else {
@@ -324,7 +299,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Sticky_0700, Function | Medi
sticky = false;
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_PublishInfo_Sticky_0700 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0700 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -344,14 +319,13 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Sticky_0800, Function | Medi
for (int i = 1; i <= stLevel_.CESLevel; i++) {
matchingSkills.AddEvent(eventName);
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
SubscribeCommonEventTest(subscribeInfo);
CommonEventPublishInfo publishInfo;
publishInfo.SetSticky(sticky);
EXPECT_FALSE(publishInfo.IsSticky());
sticky = true;
publishInfo.SetSticky(sticky);
if (!publishInfo.IsSticky()) {
printf("CES_PublishInfo_Sticky_0800 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0800 faild, frequency: " << i;
result = false;
break;
} else {
@@ -361,7 +335,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Sticky_0800, Function | Medi
sticky = false;
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_PublishInfo_Sticky_0800 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0800 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -381,14 +355,13 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Sticky_0900, Function | Medi
for (int i = 1; i <= stLevel_.CESLevel; i++) {
matchingSkills.AddEvent(eventName);
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
SubscribeCommonEventTest(subscribeInfo);
CommonEventPublishInfo publishInfo;
publishInfo.SetSticky(sticky);
EXPECT_TRUE(publishInfo.IsSticky());
sticky = false;
publishInfo.SetSticky(sticky);
if (publishInfo.IsSticky()) {
printf("CES_PublishInfo_Sticky_0900 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0900 faild, frequency: " << i;
result = false;
break;
} else {
@@ -398,7 +371,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Sticky_0900, Function | Medi
sticky = true;
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_PublishInfo_Sticky_0900 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0900 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -422,7 +395,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Sticky_1000, Function | Medi
bool sticky = true;
publishInfo.SetSticky(sticky);
if (!publishInfo.IsSticky()) {
printf("CES_PublishInfo_Sticky_1000 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_1000 faild, frequency: " << i;
result = false;
break;
} else {
@@ -431,7 +404,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Sticky_1000, Function | Medi
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_PublishInfo_Sticky_1000 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_1000 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -456,10 +429,9 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Permissions_0100, Function |
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
CommonEventPublishInfo publishInfo;
publishInfo.SetSubscriberPermissions(permissins);
SubscribeCommonEventTest(subscribeInfo);
std::vector<std::string> testPermissions = publishInfo.GetSubscriberPermissions();
if (!(permissin == testPermissions[0])) {
printf("CES_PublishInfo_Permissions_0100 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0100 faild, frequency: " << i;
result = false;
break;
} else {
@@ -468,7 +440,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Permissions_0100, Function |
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_PublishInfo_Permissions_0100 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0100 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -495,10 +467,9 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Permissions_0200, Function |
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
CommonEventPublishInfo publishInfo;
publishInfo.SetSubscriberPermissions(permissins);
SubscribeCommonEventTest(subscribeInfo);
std::vector<std::string> testPermissions = publishInfo.GetSubscriberPermissions();
if (!(permissin2 == testPermissions[1])) {
printf("CES_PublishInfo_Permissions_0200 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0200 faild, frequency: " << i;
result = false;
break;
} else {
@@ -507,7 +478,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Permissions_0200, Function |
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_PublishInfo_Permissions_0200 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0200 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -536,10 +507,9 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Permissions_0300, Function |
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
CommonEventPublishInfo publishInfo;
publishInfo.SetSubscriberPermissions(permissins);
SubscribeCommonEventTest(subscribeInfo);
std::vector<std::string> testPermissions = publishInfo.GetSubscriberPermissions();
if (!(permissin3 == testPermissions[2])) {
printf("CES_PublishInfo_Permissions_0300 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0300 faild, frequency: " << i;
result = false;
break;
} else {
@@ -548,7 +518,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Permissions_0300, Function |
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_PublishInfo_Permissions_0300 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0300 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -574,10 +544,9 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Permissions_0400, Function |
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
CommonEventPublishInfo publishInfo;
publishInfo.SetSubscriberPermissions(permissins);
SubscribeCommonEventTest(subscribeInfo);
std::vector<std::string> testPermissions = publishInfo.GetSubscriberPermissions();
if (teststr == testPermissions[0]) {
printf("CES_PublishInfo_Permissions_0400 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0400 faild, frequency: " << i;
result = false;
break;
} else {
@@ -586,7 +555,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Permissions_0400, Function |
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_PublishInfo_Permissions_0400 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0400 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -613,10 +582,9 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Permissions_0500, Function |
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
CommonEventPublishInfo publishInfo;
publishInfo.SetSubscriberPermissions(permissins);
SubscribeCommonEventTest(subscribeInfo);
std::vector<std::string> testPermissions = publishInfo.GetSubscriberPermissions();
if (permissin1 == testPermissions[1]) {
printf("CES_PublishInfo_Permissions_0500 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0500 faild, frequency: " << i;
result = false;
break;
} else {
@@ -625,7 +593,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Permissions_0500, Function |
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_PublishInfo_Permissions_0500 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0500 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -654,10 +622,9 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Permissions_0600, Function |
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
CommonEventPublishInfo publishInfo;
publishInfo.SetSubscriberPermissions(permissins);
SubscribeCommonEventTest(subscribeInfo);
std::vector<std::string> testPermissions = publishInfo.GetSubscriberPermissions();
if (permissin1 == testPermissions[2]) {
printf("CES_PublishInfo_Permissions_0600 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0600 faild, frequency: " << i;
result = false;
break;
} else {
@@ -666,7 +633,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Permissions_0600, Function |
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_PublishInfo_Permissions_0600 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0600 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -691,10 +658,9 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Permissions_0700, Function |
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
CommonEventPublishInfo publishInfo;
publishInfo.SetSubscriberPermissions(permissins);
SubscribeCommonEventTest(subscribeInfo);
std::vector<std::string> testPermissions = publishInfo.GetSubscriberPermissions();
if (!(1 == testPermissions.size())) {
printf("CES_PublishInfo_Permissions_0700 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0700 faild, frequency: " << i;
result = false;
break;
} else {
@@ -703,7 +669,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Permissions_0700, Function |
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_PublishInfo_Permissions_0700 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0700 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -730,10 +696,9 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Permissions_0800, Function |
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
CommonEventPublishInfo publishInfo;
publishInfo.SetSubscriberPermissions(permissins);
SubscribeCommonEventTest(subscribeInfo);
std::vector<std::string> testPermissions = publishInfo.GetSubscriberPermissions();
if (!(2 == testPermissions.size())) {
printf("CES_PublishInfo_Permissions_0800 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0800 faild, frequency: " << i;
result = false;
break;
} else {
@@ -742,7 +707,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Permissions_0800, Function |
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_PublishInfo_Permissions_0800 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0800 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -771,10 +736,9 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Permissions_0900, Function |
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
CommonEventPublishInfo publishInfo;
publishInfo.SetSubscriberPermissions(permissins);
SubscribeCommonEventTest(subscribeInfo);
std::vector<std::string> testPermissions = publishInfo.GetSubscriberPermissions();
if (!(3 == testPermissions.size())) {
printf("CES_PublishInfo_Permissions_0900 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0900 faild, frequency: " << i;
result = false;
break;
} else {
@@ -783,7 +747,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Permissions_0900, Function |
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_PublishInfo_Permissions_0900 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0900 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -806,10 +770,9 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Permissions_1000, Function |
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
CommonEventPublishInfo publishInfo;
publishInfo.SetSubscriberPermissions(permissins);
SubscribeCommonEventTest(subscribeInfo);
std::vector<std::string> testPermissions = publishInfo.GetSubscriberPermissions();
if (!(0 == testPermissions.size())) {
printf("CES_PublishInfo_Permissions_1000 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_1000 faild, frequency: " << i;
result = false;
break;
} else {
@@ -818,7 +781,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Permissions_1000, Function |
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_PublishInfo_Permissions_1000 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_1000 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -840,9 +803,8 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Ordered_0100, Function | Med
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
CommonEventPublishInfo publishInfo;
publishInfo.SetOrdered(order);
SubscribeCommonEventTest(subscribeInfo);
if (publishInfo.IsOrdered()) {
printf("CES_PublishInfo_Ordered_0100 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0100 faild, frequency: " << i;
result = false;
break;
} else {
@@ -851,7 +813,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Ordered_0100, Function | Med
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_PublishInfo_Ordered_0100 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0100 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -873,9 +835,8 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Ordered_0200, Function | Med
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
CommonEventPublishInfo publishInfo;
publishInfo.SetOrdered(order);
SubscribeCommonEventTest(subscribeInfo);
if (!publishInfo.IsOrdered()) {
printf("CES_PublishInfo_Ordered_0200 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0200 faild, frequency: " << i;
result = false;
break;
} else {
@@ -884,7 +845,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Ordered_0200, Function | Med
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_PublishInfo_Ordered_0200 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0200 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -904,9 +865,8 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Ordered_0300, Function | Med
matchingSkills.AddEvent(eventName);
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
CommonEventPublishInfo publishInfo;
SubscribeCommonEventTest(subscribeInfo);
if (publishInfo.IsOrdered()) {
printf("CES_PublishInfo_Ordered_0300 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0300 faild, frequency: " << i;
result = false;
break;
} else {
@@ -915,7 +875,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Ordered_0300, Function | Med
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_PublishInfo_Ordered_0300 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0300 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -938,7 +898,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Ordered_0400, Function | Med
CommonEventPublishInfo publishInfo;
publishInfo.SetOrdered(order);
if (publishInfo.IsOrdered()) {
printf("CES_PublishInfo_Ordered_0400 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0400 faild, frequency: " << i;
result = false;
break;
} else {
@@ -947,7 +907,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Ordered_0400, Function | Med
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_PublishInfo_Ordered_0400 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0400 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -970,7 +930,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Ordered_0500, Function | Med
CommonEventPublishInfo publishInfo;
publishInfo.SetOrdered(order);
if (!publishInfo.IsOrdered()) {
printf("CES_PublishInfo_Ordered_0500 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0500 faild, frequency: " << i;
result = false;
break;
} else {
@@ -979,7 +939,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Ordered_0500, Function | Med
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_PublishInfo_Ordered_0500 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0500 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -999,9 +959,8 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Ordered_0600, Function | Med
matchingSkills.AddEvent(eventName);
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
CommonEventPublishInfo publishInfo;
SubscribeCommonEventTest(subscribeInfo);
if (publishInfo.IsOrdered()) {
printf("CES_PublishInfo_Ordered_0600 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0600 faild, frequency: " << i;
result = false;
break;
} else {
@@ -1010,7 +969,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Ordered_0600, Function | Med
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_PublishInfo_Ordered_0600 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0600 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -1035,7 +994,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Ordered_0700, Function | Med
publishInfo.SetOrdered(order);
publishInfo.SetSticky(sticky);
if (!publishInfo.IsOrdered()) {
printf("CES_PublishInfo_Ordered_0700 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0700 faild, frequency: " << i;
result = false;
break;
} else {
@@ -1044,7 +1003,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Ordered_0700, Function | Med
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_PublishInfo_Ordered_0700 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0700 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -1069,7 +1028,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Ordered_0800, Function | Med
publishInfo.SetOrdered(order);
publishInfo.SetSticky(sticky);
if (!publishInfo.IsOrdered()) {
printf("CES_PublishInfo_Ordered_0800 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0800 faild, frequency: " << i;
result = false;
break;
} else {
@@ -1078,7 +1037,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Ordered_0800, Function | Med
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_PublishInfo_Ordered_0800 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0800 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -1103,7 +1062,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Ordered_0900, Function | Med
publishInfo.SetOrdered(order);
publishInfo.SetSticky(sticky);
if (publishInfo.IsOrdered()) {
printf("CES_PublishInfo_Ordered_0900 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0900 faild, frequency: " << i;
result = false;
break;
} else {
@@ -1112,7 +1071,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Ordered_0900, Function | Med
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_PublishInfo_Ordered_0900 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0900 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -1137,7 +1096,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Ordered_1000, Function | Med
publishInfo.SetOrdered(order);
publishInfo.SetSticky(sticky);
if (publishInfo.IsOrdered()) {
printf("CES_PublishInfo_Ordered_1000 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_1000 faild, frequency: " << i;
result = false;
break;
} else {
@@ -1146,7 +1105,7 @@ HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Ordered_1000, Function | Med
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_PublishInfo_Ordered_1000 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_1000 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -1,17 +1,15 @@
#
# 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
# 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.
# 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.
import("//base/notification/ces_standard/event.gni")
import("//build/test.gni")
@@ -722,7 +722,7 @@ void ActsCESDateTest::TearDown(void)
/*
* @tc.number: CES_CommonEventData_CodeData_0100
* @tc.name: CommonEventData : SetCode SetData etCode and GetData
* @tc.name: CommonEventData : SetCode SetData GetCode and GetData
* @tc.desc: 1.Set three Subscriber
* 2.Verify the function of CommonEventData when publish order event: SetCode SetData GetCode and
* GetData
@@ -1,17 +1,15 @@
#
# 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
# 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.
# 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.
import("//base/notification/ces_standard/event.gni")
import("//build/test.gni")
File diff suppressed because it is too large Load Diff
@@ -1,17 +1,15 @@
#
# 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
# 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.
# 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.
import("//base/notification/ces_standard/event.gni")
import("//build/test.gni")
@@ -87,7 +87,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_Entity_0100, Function | M
matchingSkills.RemoveEntity(entityRemove);
if (matchingSkills.CountEntities() != 0) {
result = false;
printf("CES_MatchingSkills_Entity_0100 : %d \n", i);
GTEST_LOG_(INFO) << "CES_MatchingSkills_Entity_0100 faild, frequency: " << i;
break;
} else {
result = true;
@@ -95,7 +95,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_Entity_0100, Function | M
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_MatchingSkills_Entity_0100 : %d \n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_MatchingSkills_Entity_0100 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -130,7 +130,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_Entity_0200, Function | M
matchingSkills.RemoveEntity(entityRemove);
if (matchingSkills.CountEntities() != 0) {
result = false;
printf("CES_MatchingSkills_Entity_0200 : %d \n", i);
GTEST_LOG_(INFO) << "CES_MatchingSkills_Entity_0200 faild, frequency: " << i;
break;
} else {
result = true;
@@ -138,7 +138,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_Entity_0200, Function | M
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_MatchingSkills_Entity_0200 : %d \n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_MatchingSkills_Entity_0200 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -174,7 +174,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_Entity_0300, Function | M
matchingSkills.RemoveEntity(entityRemove);
if (matchingSkills.CountEntities() != 0) {
result = false;
printf("CES_MatchingSkills_Entity_0300 : %d \n", i);
GTEST_LOG_(INFO) << "CES_MatchingSkills_Entity_0300 faild, frequency: " << i;
break;
} else {
result = true;
@@ -182,7 +182,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_Entity_0300, Function | M
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_MatchingSkills_Entity_0300 : %d \n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_MatchingSkills_Entity_0300 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -230,7 +230,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_Entity_0400, Function | M
matchingSkills.RemoveEntity(entityRemove);
if (matchingSkills.CountEntities() != 0) {
result = false;
printf("CES_MatchingSkills_Entity_0400 : %d \n", i);
GTEST_LOG_(INFO) << "CES_MatchingSkills_Entity_0400 faild, frequency: " << i;
break;
} else {
result = true;
@@ -242,7 +242,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_Entity_0400, Function | M
matchingSkills.RemoveEvent(eventName5);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_MatchingSkills_Entity_0400 : %d \n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_MatchingSkills_Entity_0400 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -299,7 +299,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_Entity_0500, Function | M
matchingSkills.RemoveEntity(entityRemove);
if (matchingSkills.CountEntities() != 0) {
result = false;
printf("CES_MatchingSkills_Entity_0500 : %d \n", i);
GTEST_LOG_(INFO) << "CES_MatchingSkills_Entity_0500 faild, frequency: " << i;
break;
} else {
result = true;
@@ -316,7 +316,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_Entity_0500, Function | M
matchingSkills.RemoveEvent(eventName10);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_MatchingSkills_Entity_0500 : %d \n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_MatchingSkills_Entity_0500 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -341,14 +341,14 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_Scheme_0100, Function | M
matchingSkills.RemoveScheme(shceme);
if (matchingSkills.CountSchemes() != 0) {
result = false;
printf("CES_MatchingSkills_Scheme_0100 : %d \n", i);
GTEST_LOG_(INFO) << "CES_MatchingSkills_Scheme_0100 faild, frequency: " << i;
break;
} else {
result = true;
}
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_MatchingSkills_Scheme_0100 : %d \n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_MatchingSkills_Scheme_0100 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -373,14 +373,14 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_Scheme_0200, Function | M
matchingSkills.RemoveScheme(shceme);
if (matchingSkills.CountSchemes() != 0) {
result = false;
printf("CES_MatchingSkills_Scheme_0200 : %d \n", i);
GTEST_LOG_(INFO) << "CES_MatchingSkills_Scheme_0200 faild, frequency: " << i;
break;
} else {
result = true;
}
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_MatchingSkills_Scheme_0200 : %d \n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_MatchingSkills_Scheme_0200 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -405,14 +405,14 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_Scheme_0300, Function | M
matchingSkills.RemoveScheme(shceme);
if (matchingSkills.CountSchemes() != 0) {
result = false;
printf("CES_MatchingSkills_Scheme_0300 : %d \n", i);
GTEST_LOG_(INFO) << "CES_MatchingSkills_Scheme_0300 faild, frequency: " << i;
break;
} else {
result = true;
}
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_MatchingSkills_Scheme_0300 : %d \n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_MatchingSkills_Scheme_0300 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -448,7 +448,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_Scheme_0400, Function | M
if (matchingSkills.CountSchemes() != 4) {
result = false;
printf("CES_MatchingSkills_Scheme_0400 : %d \n", i);
GTEST_LOG_(INFO) << "CES_MatchingSkills_Scheme_0400 faild, frequency: " << i;
break;
} else {
result = true;
@@ -459,7 +459,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_Scheme_0400, Function | M
matchingSkills.RemoveScheme(shceme5);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_MatchingSkills_Scheme_0400 : %d \n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_MatchingSkills_Scheme_0400 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -506,7 +506,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_Scheme_0500, Function | M
if (matchingSkills.CountSchemes() != 9) {
result = false;
printf("CES_MatchingSkills_Scheme_0500 : %d \n", i);
GTEST_LOG_(INFO) << "CES_MatchingSkills_Scheme_0500 faild, frequency: " << i;
break;
} else {
result = true;
@@ -522,7 +522,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_Scheme_0500, Function | M
matchingSkills.RemoveScheme(shceme10);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_MatchingSkills_Scheme_0500 : %d \n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_MatchingSkills_Scheme_0500 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -542,7 +542,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_MatchEvent_0100, Function
matchingSkills.AddEvent(eventName);
if (!matchingSkills.MatchEvent(eventName)) {
result = false;
printf("CES_MatchingSkills_MatchEvent_0100 : %d \n", i);
GTEST_LOG_(INFO) << "CES_MatchingSkills_MatchEvent_0100 faild, frequency: " << i;
break;
} else {
result = true;
@@ -550,7 +550,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_MatchEvent_0100, Function
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_MatchingSkills_MatchEvent_0100 : %d \n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_MatchingSkills_MatchEvent_0100 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -570,7 +570,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_MatchEvent_0200, Function
matchingSkills.AddEvent(eventName);
if (!matchingSkills.MatchEvent(eventName)) {
result = false;
printf("CES_MatchingSkills_MatchEvent_0200 : %d \n", i);
GTEST_LOG_(INFO) << "CES_MatchingSkills_MatchEvent_0200 faild, frequency: " << i;
break;
} else {
result = true;
@@ -578,7 +578,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_MatchEvent_0200, Function
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_MatchingSkills_MatchEvent_0200 : %d \n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_MatchingSkills_MatchEvent_0200 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -598,7 +598,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_MatchEvent_0300, Function
matchingSkills.AddEvent(eventName);
if (!matchingSkills.MatchEvent(eventName)) {
result = false;
printf("CES_MatchingSkills_MatchEvent_0300 : %d \n", i);
GTEST_LOG_(INFO) << "CES_MatchingSkills_MatchEvent_0300 faild, frequency: " << i;
break;
} else {
result = true;
@@ -606,7 +606,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_MatchEvent_0300, Function
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_MatchingSkills_MatchEvent_0300 : %d \n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_MatchingSkills_MatchEvent_0300 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -626,7 +626,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_MatchEvent_0400, Function
matchingSkills.AddEvent(eventName);
if (!matchingSkills.MatchEvent(eventName)) {
result = false;
printf("CES_MatchingSkills_MatchEvent_0400 : %d \n", i);
GTEST_LOG_(INFO) << "CES_MatchingSkills_MatchEvent_0400 faild, frequency: " << i;
break;
} else {
result = true;
@@ -634,7 +634,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_MatchEvent_0400, Function
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_MatchingSkills_MatchEvent_0400 : %d \n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_MatchingSkills_MatchEvent_0400 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -654,7 +654,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_MatchEvent_0500, Function
matchingSkills.AddEvent(eventName);
if (!matchingSkills.MatchEvent(eventName)) {
result = false;
printf("CES_MatchingSkills_MatchEvent_0500 : %d \n", i);
GTEST_LOG_(INFO) << "CES_MatchingSkills_MatchEvent_0500 faild, frequency: " << i;
break;
} else {
result = true;
@@ -662,7 +662,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_MatchEvent_0500, Function
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_MatchingSkills_MatchEvent_0500 : %d \n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_MatchingSkills_MatchEvent_0500 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -686,7 +686,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_MatchEntity_0100, Functio
entityVector.emplace_back("entityTestMatchEntity");
if (matchingSkills.MatchEntity(entityVector)) {
result = false;
printf("CES_MatchingSkills_MatchEntity_0100 : %d \n", i);
GTEST_LOG_(INFO) << "CES_MatchingSkills_MatchEntity_0100 faild, frequency: " << i;
break;
} else {
result = true;
@@ -695,7 +695,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_MatchEntity_0100, Functio
matchingSkills.RemoveEntity(entity);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_MatchingSkills_MatchEntity_0100 : %d \n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_MatchingSkills_MatchEntity_0100 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -720,7 +720,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_MatchEntity_0200, Functio
entityVector.emplace_back("entityTestMatchEntity2");
if (matchingSkills.MatchEntity(entityVector)) {
result = false;
printf("CES_MatchingSkills_MatchEntity_0200 : %d \n", i);
GTEST_LOG_(INFO) << "CES_MatchingSkills_MatchEntity_0200 faild, frequency: " << i;
break;
} else {
result = true;
@@ -729,7 +729,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_MatchEntity_0200, Functio
entityVector.clear();
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_MatchingSkills_MatchEntity_0200 : %d \n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_MatchingSkills_MatchEntity_0200 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -754,7 +754,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_MatchEntity_0300, Functio
entityVector.emplace_back("entityTestMatchEntity3");
if (matchingSkills.MatchEntity(entityVector)) {
result = false;
printf("CES_MatchingSkills_MatchEntity_0300 : %d \n", i);
GTEST_LOG_(INFO) << "CES_MatchingSkills_MatchEntity_0300 faild, frequency: " << i;
break;
} else {
result = true;
@@ -763,7 +763,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_MatchEntity_0300, Functio
entityVector.clear();
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_MatchingSkills_MatchEntity_0300 : %d \n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_MatchingSkills_MatchEntity_0300 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -788,7 +788,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_MatchEntity_0400, Functio
entityVector.emplace_back("entityTestMatchEntity4");
if (matchingSkills.MatchEntity(entityVector)) {
result = false;
printf("CES_MatchingSkills_MatchEntity_0400 : %d \n", i);
GTEST_LOG_(INFO) << "CES_MatchingSkills_MatchEntity_0400 faild, frequency: " << i;
break;
} else {
result = true;
@@ -797,7 +797,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_MatchEntity_0400, Functio
entityVector.clear();
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_MatchingSkills_MatchEntity_0400 : %d \n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_MatchingSkills_MatchEntity_0400 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -822,7 +822,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_MatchEntity_0500, Functio
entityVector.emplace_back("entityTestMatchEntity5");
if (matchingSkills.MatchEntity(entityVector)) {
result = false;
printf("CES_MatchingSkills_MatchEntity_0500 : %d \n", i);
GTEST_LOG_(INFO) << "CES_MatchingSkills_MatchEntity_0500 faild, frequency: " << i;
break;
} else {
result = true;
@@ -831,7 +831,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_MatchEntity_0500, Functio
entityVector.clear();
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_MatchingSkills_MatchEntity_0500 : %d \n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_MatchingSkills_MatchEntity_0500 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -853,7 +853,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_MatchScheme_0100, Functio
if (matchingSkills.MatchScheme("schemeMatchScheme")) {
result = false;
printf("CES_MatchingSkills_MatchScheme_0100 : %d \n", i);
GTEST_LOG_(INFO) << "CES_MatchingSkills_MatchScheme_0100 faild, frequency: " << i;
break;
} else {
result = true;
@@ -861,7 +861,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_MatchScheme_0100, Functio
matchingSkills.RemoveScheme(scheme);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_MatchingSkills_MatchScheme_0100 : %d \n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_MatchingSkills_MatchScheme_0100 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -883,7 +883,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_MatchScheme_0200, Functio
if (!matchingSkills.MatchScheme("schemeMatchScheme")) {
result = false;
printf("CES_MatchingSkills_MatchScheme_0200 : %d \n", i);
GTEST_LOG_(INFO) << "CES_MatchingSkills_MatchScheme_0200 faild, frequency: " << i;
break;
} else {
result = true;
@@ -891,7 +891,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_MatchScheme_0200, Functio
matchingSkills.RemoveScheme(scheme);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_MatchingSkills_MatchScheme_0200 : %d \n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_MatchingSkills_MatchScheme_0200 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -912,7 +912,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_MatchScheme_0300, Functio
if (!matchingSkills.MatchScheme("MatchScheme")) {
result = false;
printf("CES_MatchingSkills_MatchScheme_0300 : %d \n", i);
GTEST_LOG_(INFO) << "CES_MatchingSkills_MatchScheme_0300 faild, frequency: " << i;
break;
} else {
result = true;
@@ -920,7 +920,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_MatchScheme_0300, Functio
matchingSkills.RemoveScheme(scheme);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_MatchingSkills_MatchScheme_0300 : %d \n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_MatchingSkills_MatchScheme_0300 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -941,7 +941,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_MatchScheme_0400, Functio
if (!matchingSkills.MatchScheme("MatchScheme2")) {
result = false;
printf("CES_MatchingSkills_MatchScheme_0400 : %d \n", i);
GTEST_LOG_(INFO) << "CES_MatchingSkills_MatchScheme_0400 faild, frequency: " << i;
break;
} else {
result = true;
@@ -949,7 +949,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_MatchScheme_0400, Functio
matchingSkills.RemoveScheme(scheme);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_MatchingSkills_MatchScheme_0400 : %d \n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_MatchingSkills_MatchScheme_0400 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -970,7 +970,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_MatchScheme_0500, Functio
if (!matchingSkills.MatchScheme("MatchScheme5")) {
result = false;
printf("CES_MatchingSkills_MatchScheme_0500 : %d \n", i);
GTEST_LOG_(INFO) << "CES_MatchingSkills_MatchScheme_0500 faild, frequency: " << i;
break;
} else {
result = true;
@@ -978,7 +978,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_MatchScheme_0500, Functio
matchingSkills.RemoveScheme(scheme);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_MatchingSkills_MatchScheme_0500 : %d \n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_MatchingSkills_MatchScheme_0500 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -1003,7 +1003,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_Match_0100, Function | Me
if (!matchingSkills.Match(want)) {
result = false;
printf("CES_MatchingSkills_Match_0100 : %d \n", i);
GTEST_LOG_(INFO) << "CES_MatchingSkills_Match_0100 faild, frequency: " << i;
break;
} else {
result = true;
@@ -1013,7 +1013,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_Match_0100, Function | Me
want.RemoveEntity(entity);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_MatchingSkills_Match_0100 : %d \n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_MatchingSkills_Match_0100 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -1038,7 +1038,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_Match_0200, Function | Me
want.SetAction(eventName2);
if (!matchingSkills.Match(want)) {
result = false;
printf("CES_MatchingSkills_Match_0200 : %d \n", i);
GTEST_LOG_(INFO) << "CES_MatchingSkills_Match_0200 faild, frequency: " << i;
break;
} else {
result = true;
@@ -1048,7 +1048,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_Match_0200, Function | Me
want.RemoveEntity(entity);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_MatchingSkills_Match_0200 : %d \n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_MatchingSkills_Match_0200 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -1072,7 +1072,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_Match_0300, Function | Me
want.SetAction(eventName3);
if (!matchingSkills.Match(want)) {
result = false;
printf("CES_MatchingSkills_Match_0300 : %d \n", i);
GTEST_LOG_(INFO) << "CES_MatchingSkills_Match_0300 faild, frequency: " << i;
break;
} else {
result = true;
@@ -1082,7 +1082,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_Match_0300, Function | Me
want.RemoveEntity(entity);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_MatchingSkills_Match_0300 : %d \n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_MatchingSkills_Match_0300 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -1106,7 +1106,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_Match_0400, Function | Me
want.SetAction(eventName4);
if (!matchingSkills.Match(want)) {
result = false;
printf("CES_MatchingSkills_Match_0400 : %d \n", i);
GTEST_LOG_(INFO) << "CES_MatchingSkills_Match_0400 faild, frequency: " << i;
break;
} else {
result = true;
@@ -1116,7 +1116,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_Match_0400, Function | Me
want.RemoveEntity(entity);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_MatchingSkills_Match_0400 : %d \n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_MatchingSkills_Match_0400 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -1140,7 +1140,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_Match_0500, Function | Me
want.SetAction(eventName5);
if (!matchingSkills.Match(want)) {
result = false;
printf("CES_MatchingSkills_Match_0500 : %d \n", i);
GTEST_LOG_(INFO) << "CES_MatchingSkills_Match_0500 faild, frequency: " << i;
break;
} else {
result = true;
@@ -1150,7 +1150,7 @@ HWTEST_F(ActsCESMatchingSkillsTest, CES_MatchingSkills_Match_0500, Function | Me
want.RemoveEntity(entity);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_MatchingSkills_Match_0500 : %d \n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_MatchingSkills_Match_0500 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -86,7 +86,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_Priority_0100, Function | M
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
subscribeInfo.SetPriority(PRIORITYTEST1);
if (subscribeInfo.GetPriority() != PRIORITYTEST1) {
printf("CES_SubscribeInfo_Priority_0100 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_Priority_0100 faild ,frequency: " << i;
result = false;
break;
} else {
@@ -95,7 +95,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_Priority_0100, Function | M
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_SubscribeInfo_Priority_0100 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_Priority_0100 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -115,7 +115,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_Priority_0200, Function | M
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
subscribeInfo.SetPriority(PRIORITYTEST2);
if (subscribeInfo.GetPriority() != PRIORITYTEST2) {
printf("CES_SubscribeInfo_Priority_0200 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_Priority_0200 faild ,frequency: " << i;
result = false;
break;
} else {
@@ -124,7 +124,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_Priority_0200, Function | M
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_SubscribeInfo_Priority_0200 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_Priority_0200 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -144,7 +144,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_Priority_0300, Function | M
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
subscribeInfo.SetPriority(PRIORITYTEST3);
if (subscribeInfo.GetPriority() != PRIORITYTEST3) {
printf("CES_SubscribeInfo_Priority_0300 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_Priority_0300 faild ,frequency: " << i;
result = false;
break;
} else {
@@ -153,7 +153,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_Priority_0300, Function | M
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_SubscribeInfo_Priority_0300 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_Priority_0300 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -173,7 +173,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_Priority_0400, Function | M
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
subscribeInfo.SetPriority(PRIORITYTEST4);
if (subscribeInfo.GetPriority() != PRIORITYTEST4) {
printf("CES_SubscribeInfo_Priority_0400 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_Priority_0400 faild ,frequency: " << i;
result = false;
break;
} else {
@@ -182,7 +182,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_Priority_0400, Function | M
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_SubscribeInfo_Priority_0400 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_Priority_0400 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -202,7 +202,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_Priority_0500, Function | M
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
subscribeInfo.SetPriority(PRIORITYTEST5);
if (subscribeInfo.GetPriority() != PRIORITYTEST5) {
printf("CES_SubscribeInfo_Priority_0500 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_Priority_0500 faild ,frequency: " << i;
result = false;
break;
} else {
@@ -211,7 +211,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_Priority_0500, Function | M
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_SubscribeInfo_Priority_0500 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_Priority_0500 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -231,7 +231,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_Permission_0100, Function |
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
subscribeInfo.SetPermission(PERMISSIONTEST1);
if (subscribeInfo.GetPermission() != PERMISSIONTEST1) {
printf("CES_SubscribeInfo_Permission_0100 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_Permission_0100 faild ,frequency: " << i;
result = false;
break;
} else {
@@ -240,7 +240,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_Permission_0100, Function |
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_SubscribeInfo_Permission_0100 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_Permission_0100 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -261,7 +261,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_Permission_0200, Function |
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
subscribeInfo.SetPermission(PERMISSIONTEST2);
if (subscribeInfo.GetPermission() != PERMISSIONTEST2) {
printf("CES_SubscribeInfo_Permission_0200 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_Permission_0200 faild ,frequency: " << i;
result = false;
break;
} else {
@@ -270,7 +270,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_Permission_0200, Function |
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_SubscribeInfo_Permission_0200 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_Permission_0200 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -290,7 +290,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_Permission_0300, Function |
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
subscribeInfo.SetPermission(PERMISSIONTEST3);
if (subscribeInfo.GetPermission() != PERMISSIONTEST3) {
printf("CES_SubscribeInfo_Permission_0300 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_Permission_0300 faild ,frequency: " << i;
result = false;
break;
} else {
@@ -299,7 +299,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_Permission_0300, Function |
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_SubscribeInfo_Permission_0300 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_Permission_0300 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -319,7 +319,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_Permission_0400, Function |
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
subscribeInfo.SetPermission(PERMISSIONTEST4);
if (subscribeInfo.GetPermission() != PERMISSIONTEST4) {
printf("CES_SubscribeInfo_Permission_0400 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_Permission_0400 faild ,frequency: " << i;
result = false;
break;
} else {
@@ -328,7 +328,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_Permission_0400, Function |
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_SubscribeInfo_Permission_0400 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_Permission_0400 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -348,7 +348,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_Permission_0500, Function |
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
subscribeInfo.SetPermission(PERMISSIONTEST5);
if (subscribeInfo.GetPermission() != PERMISSIONTEST5) {
printf("CES_SubscribeInfo_Permission_0500 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_Permission_0500 faild ,frequency: " << i;
result = false;
break;
} else {
@@ -357,7 +357,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_Permission_0500, Function |
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_SubscribeInfo_Permission_0500 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_Permission_0500 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -378,7 +378,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_ThreadMode_0100, Function |
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
subscribeInfo.SetThreadMode(CommonEventSubscribeInfo::ThreadMode::HANDLER);
if (subscribeInfo.GetThreadMode() != CommonEventSubscribeInfo::ThreadMode::HANDLER) {
printf("CES_SubscribeInfo_ThreadMode_0100 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_ThreadMode_0100 faild ,frequency: " << i;
result = false;
break;
} else {
@@ -387,7 +387,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_ThreadMode_0100, Function |
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_SubscribeInfo_ThreadMode_0100 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_ThreadMode_0100 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -407,7 +407,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_ThreadMode_0200, Function |
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
subscribeInfo.SetThreadMode(CommonEventSubscribeInfo::ThreadMode::POST);
if (subscribeInfo.GetThreadMode() != CommonEventSubscribeInfo::ThreadMode::POST) {
printf("CES_SubscribeInfo_ThreadMode_0200 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_ThreadMode_0200 faild ,frequency: " << i;
result = false;
break;
} else {
@@ -416,7 +416,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_ThreadMode_0200, Function |
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_SubscribeInfo_ThreadMode_0200 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_ThreadMode_0200 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -437,7 +437,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_ThreadMode_0300, Function |
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
subscribeInfo.SetThreadMode(CommonEventSubscribeInfo::ThreadMode::ASYNC);
if (subscribeInfo.GetThreadMode() != CommonEventSubscribeInfo::ThreadMode::ASYNC) {
printf("CES_SubscribeInfo_ThreadMode_0300 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_ThreadMode_0300 faild ,frequency: " << i;
result = false;
break;
} else {
@@ -446,7 +446,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_ThreadMode_0300, Function |
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_SubscribeInfo_ThreadMode_0300 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_ThreadMode_0300 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -467,7 +467,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_ThreadMode_0400, Function |
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
subscribeInfo.SetThreadMode(CommonEventSubscribeInfo::ThreadMode::BACKGROUND);
if (subscribeInfo.GetThreadMode() != CommonEventSubscribeInfo::ThreadMode::BACKGROUND) {
printf("CES_SubscribeInfo_ThreadMode_0400 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_ThreadMode_0400 faild ,frequency: " << i;
result = false;
break;
} else {
@@ -476,7 +476,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_ThreadMode_0400, Function |
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_SubscribeInfo_ThreadMode_0400 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_ThreadMode_0400 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -496,7 +496,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_DeviceId_0100, Function | M
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
subscribeInfo.SetDeviceId(DEVICEIDTEST1);
if (subscribeInfo.GetDeviceId() != DEVICEIDTEST1) {
printf("CES_SubscribeInfo_DeviceId_0100 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_DeviceId_0100 faild ,frequency: " << i;
result = false;
break;
} else {
@@ -505,7 +505,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_DeviceId_0100, Function | M
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_SubscribeInfo_DeviceId_0100 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_DeviceId_0100 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -525,7 +525,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_DeviceId_0200, Function | M
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
subscribeInfo.SetDeviceId(DEVICEIDTEST2);
if (subscribeInfo.GetDeviceId() != DEVICEIDTEST2) {
printf("CES_SubscribeInfo_DeviceId_0200 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_DeviceId_0200 faild ,frequency: " << i;
result = false;
break;
} else {
@@ -534,7 +534,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_DeviceId_0200, Function | M
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_SubscribeInfo_DeviceId_0200 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_DeviceId_0200 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -554,7 +554,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_DeviceId_0300, Function | M
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
subscribeInfo.SetDeviceId(DEVICEIDTEST3);
if (subscribeInfo.GetDeviceId() != DEVICEIDTEST3) {
printf("CES_SubscribeInfo_DeviceId_0300 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_DeviceId_0300 faild ,frequency: " << i;
result = false;
break;
} else {
@@ -563,7 +563,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_DeviceId_0300, Function | M
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_SubscribeInfo_DeviceId_0300 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_DeviceId_0300 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -583,7 +583,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_DeviceId_0400, Function | M
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
subscribeInfo.SetDeviceId(DEVICEIDTEST4);
if (subscribeInfo.GetDeviceId() != DEVICEIDTEST4) {
printf("CES_SubscribeInfo_DeviceId_0400 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_DeviceId_0400 faild ,frequency: " << i;
result = false;
break;
} else {
@@ -592,7 +592,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_DeviceId_0400, Function | M
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_SubscribeInfo_DeviceId_0400 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_DeviceId_0400 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -612,7 +612,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_DeviceId_0500, Function | M
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
subscribeInfo.SetDeviceId(DEVICEIDTEST5);
if (subscribeInfo.GetDeviceId() != DEVICEIDTEST5) {
printf("CES_SubscribeInfo_DeviceId_0500 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_DeviceId_0500 faild ,frequency: " << i;
result = false;
break;
} else {
@@ -621,7 +621,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_DeviceId_0500, Function | M
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_SubscribeInfo_DeviceId_0500 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_DeviceId_0500 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
@@ -640,7 +640,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_GetMatchingSkills_0100, Fun
matchingSkills.AddEvent(eventName);
CommonEventSubscribeInfo subscribeInfo(matchingSkills);
if (subscribeInfo.GetMatchingSkills().HasEvent(eventName) == false) {
printf("CES_SubscribeInfo_GetMatchingSkills_0100 faild ,this is %d round\n", i);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_GetMatchingSkills_0100 faild ,frequency: " << i;
result = false;
break;
} else {
@@ -649,7 +649,7 @@ HWTEST_F(ActsCESSubscribeInfoTest, CES_SubscribeInfo_GetMatchingSkills_0100, Fun
matchingSkills.RemoveEvent(eventName);
}
if (result && stLevel_.CESLevel >= 1) {
printf("CES_SubscribeInfo_GetMatchingSkills_0100 : %d\n", stLevel_.CESLevel);
GTEST_LOG_(INFO) << "CES_SubscribeInfo_GetMatchingSkills_0100 stress level: " << stLevel_.CESLevel;
}
EXPECT_TRUE(result);
}
+8 -9
View File
@@ -1,17 +1,15 @@
#
# 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
# 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.
# 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.
import("//base/notification/ces_standard/event.gni")
import("//build/test.gni")
@@ -34,6 +32,7 @@ ohos_systemtest("ActsFuzzTest") {
include_dirs = [
"//utils/native/base/include",
"//foundation/aafwk/standard/interfaces/innerkits/base/include",
"//foundation/aafwk/standard/interfaces/innerkits/want/include/ohos/aafwk/content",
"${ces_standard_path}/test/systemtest/common/resource",
"//third_party/json/single_include",
+7 -9
View File
@@ -1,17 +1,15 @@
#
# 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
# 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.
# 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.
import("//base/notification/ces_standard/event.gni")
import("//build/ohos.gni")
@@ -1,17 +1,15 @@
#
# 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
# 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.
# 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.
import("//base/notification/ces_standard/event.gni")
import("//build/test.gni")
@@ -1,17 +1,15 @@
#
# 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
# 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.
# 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.
import("//base/notification/ces_standard/event.gni")
import("//build/test.gni")
+2
View File
@@ -43,6 +43,7 @@ config("cesSTPermissionAndABConfig") {
}
ohos_shared_library("libraryCesSTPermissionAndAB") {
include_dirs = [ "//third_party/jsoncpp/include" ]
sources = [ "${SUBDEMOSYSTEM_DIR}/src/ces_st_permission_and_AB.cpp" ]
configs = [ ":cesSTPermissionAndABConfig" ]
@@ -53,6 +54,7 @@ ohos_shared_library("libraryCesSTPermissionAndAB") {
"//foundation/appexecfwk/standard/common:libappexecfwk_common",
"//foundation/appexecfwk/standard/kits:appkit_native",
"//foundation/appexecfwk/standard/services/bundlemgr:libbms",
"//third_party/jsoncpp:jsoncpp",
"//utils/native/base:utilsbase",
]
+2
View File
@@ -25,6 +25,7 @@ config("cesSTPermissionDefaultAConfig") {
include_dirs = [
"${SUBDEMOSYSTEM_DIR}/include",
"//third_party/jsoncpp/include",
"//foundation/appexecfwk/standard/kits/appkit/native/app",
"//foundation/aafwk/standard/interfaces/innerkits/want/include/ohos/aafwk/content",
"//foundation/aafwk/standard/interfaces/innerkits/ability_manager/include",
@@ -52,6 +53,7 @@ ohos_shared_library("libraryCesSTPermissionDefaultA") {
"//foundation/appexecfwk/standard/common:libappexecfwk_common",
"//foundation/appexecfwk/standard/kits:appkit_native",
"//foundation/appexecfwk/standard/services/bundlemgr:libbms",
"//third_party/jsoncpp:jsoncpp",
"//utils/native/base:utilsbase",
]
+2
View File
@@ -26,6 +26,7 @@ config("cesSTPermissionOrABConfig") {
include_dirs = [
"${SUBDEMOSYSTEM_DIR}/include",
"//third_party/jsoncpp/include",
"//foundation/appexecfwk/standard/kits/appkit/native/app",
"//foundation/aafwk/standard/interfaces/innerkits/want/include/ohos/aafwk/content",
"//foundation/aafwk/standard/interfaces/innerkits/ability_manager/include",
@@ -53,6 +54,7 @@ ohos_shared_library("libraryCesSTPermissionOrAB") {
"//foundation/appexecfwk/standard/common:libappexecfwk_common",
"//foundation/appexecfwk/standard/kits:appkit_native",
"//foundation/appexecfwk/standard/services/bundlemgr:libbms",
"//third_party/jsoncpp:jsoncpp",
"//utils/native/base:utilsbase",
]
+2
View File
@@ -26,6 +26,7 @@ config("cesSTPermissionOrAXConfig") {
include_dirs = [
"${SUBDEMOSYSTEM_DIR}/include",
"//third_party/jsoncpp/include",
"//foundation/appexecfwk/standard/kits/appkit/native/app",
"//foundation/aafwk/standard/interfaces/innerkits/want/include/ohos/aafwk/content",
"//foundation/aafwk/standard/interfaces/innerkits/ability_manager/include",
@@ -53,6 +54,7 @@ ohos_shared_library("libraryCesSTPermissionOrAX") {
"//foundation/appexecfwk/standard/common:libappexecfwk_common",
"//foundation/appexecfwk/standard/kits:appkit_native",
"//foundation/appexecfwk/standard/services/bundlemgr:libbms",
"//third_party/jsoncpp:jsoncpp",
"//utils/native/base:utilsbase",
]
@@ -502,7 +502,6 @@
"ContinueAbilityReversiblyS": [],
"GetOriginalDeviceId": [],
"GetContinuationState": [],
"ReverseContinueAbility": [],
"GetAbilityPackage": [],
"DenormalizeUri": [],
"Reload": [],
@@ -46,9 +46,9 @@ private:
fuzzTestManager(fuzzTestManager &) = delete;
fuzzTestManager &operator=(const fuzzTestManager &) = delete;
static Ptr instance_;
uint16_t cycle_;
std::unordered_map<std::string, int> remainderMap_;
std::unordered_map<std::string, std::function<void()>> callFunctionMap_;
uint16_t cycle_{};
std::unordered_map<std::string, int> remainderMap_{};
std::unordered_map<std::string, std::function<void()>> callFunctionMap_{};
void RegisterAsyncCommonEventResult();
void RegisterCommonEventData();
@@ -53,7 +53,7 @@
// aafwk/bundle
#include "bundle_mgr_proxy.h"
#include "ohos/aafwk/base/short_wrapper.h"
#include "../include/getparam.h"
#include "../include/fuzzTestManager.h"
@@ -1148,12 +1148,6 @@ void fuzzTestManager::RegisterWantParams()
want1 = want2;
};
callFunctionMap_["WantParamsSetParam"] = []() {
std::shared_ptr<AAFwk::WantParams> temp = GetParamWantParams();
OHOS::AAFwk::IInterface *param = OHOS::AAFwk::Short::Box(GetShortParam()).GetRefPtr();
temp->SetParam(GetStringParam(), param);
};
callFunctionMap_["WantParamsGetParam"] = []() {
std::shared_ptr<AAFwk::WantParams> temp = GetParamWantParams();
temp->GetParam(GetStringParam());
@@ -2238,11 +2232,6 @@ void fuzzTestManager::RegisterAbility()
temp->GetContinuationState();
});
callFunctionMap_.emplace("AbilityReverseContinueAbility", []() {
std::shared_ptr<OHOS::AppExecFwk::Ability> temp = GetParamAbility();
temp->ReverseContinueAbility();
});
callFunctionMap_.emplace("AbilityGetAbilityPackage", []() {
std::shared_ptr<OHOS::AppExecFwk::Ability> temp = GetParamAbility();
temp->GetAbilityPackage();
@@ -207,7 +207,7 @@ char32_t GetChar32Param()
char *GetCharArryParam()
{
static char param[256];
strcpy(param, GetStringParam().c_str());
strcpy_s(param, 255, GetStringParam().c_str());
return param;
}
+6 -1
View File
@@ -19,7 +19,10 @@ module_output_path = "ces_standard/tools"
ohos_systemtest("common_event_command_dump_system_test") {
module_out_path = module_output_path
include_dirs = [ "${aafwk_path}/tools/test/systemtest/aa" ]
include_dirs = [
"${aafwk_path}/tools/test/systemtest/aa",
"//third_party/jsoncpp/include",
]
sources = [
"${aafwk_path}/tools/aa/src/shell_command.cpp",
@@ -45,6 +48,7 @@ ohos_systemtest("common_event_command_dump_system_test") {
"${ces_core_path}:cesfwk_core",
"${ces_native_path}:cesfwk_innerkits",
"//third_party/googletest:gtest_main",
"//third_party/jsoncpp:jsoncpp",
"//utils/native/base:utils",
]
@@ -84,6 +88,7 @@ ohos_systemtest("common_event_command_publish_system_test") {
"${ces_core_path}:cesfwk_core",
"${ces_native_path}:cesfwk_innerkits",
"//third_party/googletest:gtest_main",
"//third_party/jsoncpp:jsoncpp",
"//utils/native/base:utils",
]