add dmsfwk 3 UT

Signed-off-by: c30051536 <chenbin179@huawei.com>
This commit is contained in:
c30051536 2024-04-27 16:28:01 +08:00
parent fec7028599
commit 42d3000177
4 changed files with 38 additions and 8 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 Huawei Device Co., Ltd.
* Copyright (c) 2021-2024 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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 Huawei Device Co., Ltd.
* Copyright (c) 2023-2024 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

View File

@ -145,13 +145,9 @@ HWTEST_F(DistributedClientTest, UnRegisterDSchedEventListener_002, TestSize.Leve
HWTEST_F(DistributedClientTest, GetContinueInfo_001, TestSize.Level3)
{
DTEST_LOG << "DistributedClientTest GetContinueInfo_001 start" << std::endl;
sptr<IRemoteObject> proxy = GetDmsProxy();
if (proxy == nullptr) {
return;
}
ContinueInfo continueInfo;
int32_t result = distributedClient_.GetContinueInfo(continueInfo);
EXPECT_EQ(result, ERR_NONE);
EXPECT_EQ(result, ERR_FLATTEN_OBJECT);
DTEST_LOG << "DistributedClientTest GetContinueInfo_001 end" << std::endl;
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
* Copyright (c) 2022-2024 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
@ -218,5 +218,39 @@ HWTEST_F(DmsSaClientTest, OnRemoveSystemAbility_001, TestSize.Level3)
EXPECT_EQ(result, NO_ERROR);
DTEST_LOG << "DmsSaClientTest OnRemoveSystemAbility_001 end" << std::endl;
}
/**
* @tc.name: DmsSAStatusChangeOnAddSystemAbility_001
* @tc.desc: DmsSAStatusChangeOnAddSystemAbility
* @tc.type: FUNC
* @tc.require: I9K4JN
*/
HWTEST_F(DmsSaClientTest, DmsSAStatusChangeOnAddSystemAbility_001, TestSize.Level3)
{
DTEST_LOG << "DmsSaClientTest DmsSAStatusChangeOnAddSystemAbility_001 start" << std::endl;
DmsSystemAbilityStatusChange dmsSystemAbilityStatusChange;
//systemAbilityId not is DISTRIBUTED_SCHED_SA_ID
dmsSystemAbilityStatusChange.OnAddSystemAbility(-1, DEVICE_ID);
//systemAbilityId is DISTRIBUTED_SCHED_SA_ID
dmsSystemAbilityStatusChange.OnAddSystemAbility(DISTRIBUTED_SCHED_SA_ID, DEVICE_ID);
DTEST_LOG << "DmsSaClientTest DmsSAStatusChangeOnAddSystemAbility_001 end" << std::endl;
}
/**
* @tc.name: DmsSAStatusChangeOnRemoveSystemAbility_001
* @tc.desc: DmsSAStatusChangeOnRemoveSystemAbility_001
* @tc.type: FUNC
* @tc.require: I9K4JN
*/
HWTEST_F(DmsSaClientTest, DmsSAStatusChangeOnRemoveSystemAbility_001, TestSize.Level3)
{
DTEST_LOG << "DmsSaClientTest DmsSAStatusChangeOnRemoveSystemAbility_001 start" << std::endl;
DmsSystemAbilityStatusChange dmsSystemAbilityStatusChange;
//systemAbilityId not is DISTRIBUTED_SCHED_SA_ID
dmsSystemAbilityStatusChange.OnRemoveSystemAbility(-1, DEVICE_ID);
//systemAbilityId is DISTRIBUTED_SCHED_SA_ID
dmsSystemAbilityStatusChange.OnRemoveSystemAbility(DISTRIBUTED_SCHED_SA_ID, DEVICE_ID);
DTEST_LOG << "DmsSaClientTest DmsSAStatusChangeOnRemoveSystemAbility_001 end" << std::endl;
}
}
}