mirror of
https://gitee.com/openharmony/ability_dmsfwk
synced 2024-11-27 00:20:44 +00:00
commit
192764a162
@ -29,7 +29,7 @@ namespace {
|
||||
constexpr int32_t DISTRIBUTED_SCHED_SA_ID = 1401;
|
||||
const char* HIDUMPER_PROCESS_NAME = "hidumper_service";
|
||||
const char* DISTSCHED_PROCESS_NAME = "distributedsched";
|
||||
const char* INVAILD_PROCESS_NAME = "invaild_process";
|
||||
const char* INVALID_PROCESS_NAME = "invalid_process";
|
||||
bool g_mockResult = false;
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ void DistributedAbilityManagerDumperTest::TearDown()
|
||||
|
||||
/**
|
||||
* @tc.name: Dump_001
|
||||
* @tc.desc: call dump with invaild fd.
|
||||
* @tc.desc: call dump with invalid fd.
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I5PUBK
|
||||
*/
|
||||
@ -298,7 +298,7 @@ HWTEST_F(DistributedAbilityManagerDumperTest, Dumper_Dump_004, TestSize.Level3)
|
||||
|
||||
/**
|
||||
* @tc.name: Dumper_Dump_005
|
||||
* @tc.desc: call DistributedAbilityManagerDumper::Dump with invaild args.
|
||||
* @tc.desc: call DistributedAbilityManagerDumper::Dump with invalid args.
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I5PUBK
|
||||
*/
|
||||
@ -341,7 +341,7 @@ HWTEST_F(DistributedAbilityManagerDumperTest, Dumper_Dump_006, TestSize.Level4)
|
||||
|
||||
/**
|
||||
* @tc.name: Dumper_Dump_007
|
||||
* @tc.desc: call DistributedAbilityManagerDumper::Dump from invaild process.
|
||||
* @tc.desc: call DistributedAbilityManagerDumper::Dump from invalid process.
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I5PUBK
|
||||
*/
|
||||
@ -352,7 +352,7 @@ HWTEST_F(DistributedAbilityManagerDumperTest, Dumper_Dump_007, TestSize.Level4)
|
||||
DTEST_LOG << "dtbabilitymgrService_ is nullptr" << std::endl;
|
||||
return;
|
||||
}
|
||||
MockProcess(INVAILD_PROCESS_NAME);
|
||||
MockProcess(INVALID_PROCESS_NAME);
|
||||
const std::vector<std::string> args;
|
||||
std::string dumpResult;
|
||||
bool result = DistributedAbilityManagerDumper::Dump(dtbabilitymgrService_, args, dumpResult);
|
||||
|
@ -130,6 +130,7 @@ ohos_unittest("distributedschedsvrtest") {
|
||||
|
||||
sources = [
|
||||
"unittest/distributed_sched_adapter_test.cpp",
|
||||
"unittest/distributed_sched_dumper_test.cpp",
|
||||
"unittest/distributed_sched_service_test.cpp",
|
||||
"unittest/distributed_sched_stub_test.cpp",
|
||||
"unittest/dms_callback_task_test.cpp",
|
||||
|
@ -15,6 +15,7 @@
|
||||
|
||||
#include "distributed_sched_adapter_test.h"
|
||||
#include "dtbschedmgr_log.h"
|
||||
#include "mock_remote_stub.h"
|
||||
#include "snapshot.h"
|
||||
#include "test_log.h"
|
||||
|
||||
@ -45,6 +46,20 @@ void DistributedSchedAdapterTest::SetUp()
|
||||
DTEST_LOG << "DistributedSchedAdapterTest::SetUp" << std::endl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: Init_001
|
||||
* @tc.desc: dmsAdapterHandler_ is not nullptr
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I60TOK
|
||||
*/
|
||||
HWTEST_F(DistributedSchedAdapterTest, Init_001, TestSize.Level3)
|
||||
{
|
||||
DTEST_LOG << "DistributedSchedAdapterTest Init_001 begin" << std::endl;
|
||||
distributedSchedAdapter_->Init();
|
||||
EXPECT_NE(distributedSchedAdapter_->dmsAdapterHandler_, nullptr);
|
||||
DTEST_LOG << "DistributedSchedAdapterTest Init_001 end" << std::endl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: ConnectAbility_001
|
||||
* @tc.desc: invalid params
|
||||
@ -200,6 +215,21 @@ HWTEST_F(DistributedSchedAdapterTest, ProcessConnectDied_002, TestSize.Level3)
|
||||
DTEST_LOG << "DistributedSchedAdapterTest ProcessConnectDied_002 end" << std::endl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: ProcessConnectDied_003
|
||||
* @tc.desc: process connect died
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I60TOK
|
||||
*/
|
||||
HWTEST_F(DistributedSchedAdapterTest, ProcessConnectDied_003, TestSize.Level3)
|
||||
{
|
||||
DTEST_LOG << "DistributedSchedAdapterTest ProcessConnectDied_003 begin" << std::endl;
|
||||
const sptr<IRemoteObject> connect = new MockRemoteStub();
|
||||
distributedSchedAdapter_->ProcessConnectDied(connect);
|
||||
EXPECT_NE(distributedSchedAdapter_->dmsAdapterHandler_, nullptr);
|
||||
DTEST_LOG << "DistributedSchedAdapterTest ProcessConnectDied_003 end" << std::endl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: ProcessCalleeDied_001
|
||||
* @tc.desc: dmsAdapterHandler_ is nullptr
|
||||
@ -231,6 +261,21 @@ HWTEST_F(DistributedSchedAdapterTest, ProcessCalleeDied_002, TestSize.Level3)
|
||||
DTEST_LOG << "DistributedSchedAdapterTest ProcessCalleeDied_002 end" << std::endl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: ProcessCalleeDied_003
|
||||
* @tc.desc: processs callee died
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I60TOK
|
||||
*/
|
||||
HWTEST_F(DistributedSchedAdapterTest, ProcessCalleeDied_003, TestSize.Level3)
|
||||
{
|
||||
DTEST_LOG << "DistributedSchedAdapterTest ProcessCalleeDied_003 begin" << std::endl;
|
||||
const sptr<IRemoteObject> connect = new MockRemoteStub();
|
||||
distributedSchedAdapter_->ProcessCalleeDied(connect);
|
||||
EXPECT_NE(distributedSchedAdapter_->dmsAdapterHandler_, nullptr);
|
||||
DTEST_LOG << "DistributedSchedAdapterTest ProcessCalleeDied_003 end" << std::endl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: ProcessCallerDied_001
|
||||
* @tc.desc: dmsAdapterHandler_ is nullptr
|
||||
@ -264,6 +309,22 @@ HWTEST_F(DistributedSchedAdapterTest, ProcessCallerDied_002, TestSize.Level3)
|
||||
DTEST_LOG << "DistributedSchedAdapterTest ProcessCallerDied_002 end" << std::endl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: ProcessCallerDied_003
|
||||
* @tc.desc: process caller died
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I60TOK
|
||||
*/
|
||||
HWTEST_F(DistributedSchedAdapterTest, ProcessCallerDied_003, TestSize.Level3)
|
||||
{
|
||||
DTEST_LOG << "DistributedSchedAdapterTest ProcessCallerDied_003 begin" << std::endl;
|
||||
const sptr<IRemoteObject> connect = new MockRemoteStub();
|
||||
int32_t deviceType = 0;
|
||||
distributedSchedAdapter_->ProcessCallerDied(connect, deviceType);
|
||||
EXPECT_NE(distributedSchedAdapter_->dmsAdapterHandler_, nullptr);
|
||||
DTEST_LOG << "DistributedSchedAdapterTest ProcessCallerDied_003 end" << std::endl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: GetLocalMissionInfos_001
|
||||
* @tc.desc: numMissions is invalid
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "distributed_sched_util.h"
|
||||
#include "dtbschedmgr_device_info_storage.h"
|
||||
#include "mock_distributed_sched.h"
|
||||
#include "mock_remote_stub.h"
|
||||
|
||||
using namespace testing;
|
||||
using namespace testing::ext;
|
||||
@ -481,6 +482,23 @@ HWTEST_F(DSchedContinuationTest, PushAbilityToken_004, TestSize.Level1)
|
||||
DTEST_LOG << "DSchedContinuationTest PushAbilityToken_004 end" << std::endl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: PushAbilityToken_005
|
||||
* @tc.desc: AbilityToken is exist.
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I60TOK
|
||||
*/
|
||||
HWTEST_F(DSchedContinuationTest, PushAbilityToken_005, TestSize.Level1)
|
||||
{
|
||||
DTEST_LOG << "DSchedContinuationTest PushAbilityToken_005 start" << std::endl;
|
||||
dschedContinuation_->Init(nullptr);
|
||||
auto sessionId = 1;
|
||||
bool ret = dschedContinuation_->PushAbilityToken(sessionId, GetDSchedService());
|
||||
ret = dschedContinuation_->PushAbilityToken(sessionId, GetDSchedService());
|
||||
EXPECT_EQ(ret, false);
|
||||
DTEST_LOG << "DSchedContinuationTest PushAbilityToken_005 end" << std::endl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: PopAbilityToken_001
|
||||
* @tc.desc: input invalid params.
|
||||
@ -541,6 +559,157 @@ HWTEST_F(DSchedContinuationTest, PopAbilityToken_003, TestSize.Level1)
|
||||
DTEST_LOG << "DSchedContinuationTest PopAbilityToken_003 end" << std::endl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: PopAbilityToken_004
|
||||
* @tc.desc: pop abilityToken success.
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I60TOK
|
||||
*/
|
||||
HWTEST_F(DSchedContinuationTest, PopAbilityToken_004, TestSize.Level1)
|
||||
{
|
||||
DTEST_LOG << "DSchedContinuationTest PopAbilityToken_004 start" << std::endl;
|
||||
dschedContinuation_->continuationHandler_ = nullptr;
|
||||
|
||||
int32_t sessionId = PushAbilityToken();
|
||||
sptr<IRemoteObject> abilityToken = dschedContinuation_->PopAbilityToken(sessionId);
|
||||
EXPECT_TRUE(abilityToken != nullptr);
|
||||
DTEST_LOG << "DSchedContinuationTest PopAbilityToken_004 end" << std::endl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: GenerateSessionId_001
|
||||
* @tc.desc: test GenerateSessionId when currSessionId is less than zero.
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I60TOK
|
||||
*/
|
||||
HWTEST_F(DSchedContinuationTest, GenerateSessionId_001, TestSize.Level4)
|
||||
{
|
||||
DTEST_LOG << "DSchedContinuationTest GenerateSessionId_001 start" << std::endl;
|
||||
int32_t sessionId = dschedContinuation_->currSessionId_;
|
||||
dschedContinuation_->currSessionId_ = -100;
|
||||
dschedContinuation_->GenerateSessionId();
|
||||
EXPECT_EQ(dschedContinuation_->currSessionId_, 1);
|
||||
dschedContinuation_->currSessionId_ = sessionId;
|
||||
DTEST_LOG << "DSchedContinuationTest GenerateSessionId_001 end" << std::endl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: SetTimeOut_001
|
||||
* @tc.desc: test SetTimeOut.
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I60TOK
|
||||
*/
|
||||
HWTEST_F(DSchedContinuationTest, SetTimeOut_001, TestSize.Level3)
|
||||
{
|
||||
DTEST_LOG << "DSchedContinuationTest SetTimeOut_001 start" << std::endl;
|
||||
dschedContinuation_->Init(nullptr);
|
||||
|
||||
int32_t missionId = 0;
|
||||
int32_t timeout = 1000;
|
||||
dschedContinuation_->SetTimeOut(missionId, timeout);
|
||||
EXPECT_NE(dschedContinuation_->continuationHandler_, nullptr);
|
||||
DTEST_LOG << "DSchedContinuationTest SetTimeOut_001 end" << std::endl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: RemoveTimeOut_001
|
||||
* @tc.desc: test RemoveTimeOut.
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I60TOK
|
||||
*/
|
||||
HWTEST_F(DSchedContinuationTest, RemoveTimeOut_001, TestSize.Level3)
|
||||
{
|
||||
DTEST_LOG << "DSchedContinuationTest RemoveTimeOut_001 start" << std::endl;
|
||||
dschedContinuation_->Init(nullptr);
|
||||
|
||||
int32_t missionId = 0;
|
||||
int32_t timeout = 1000;
|
||||
dschedContinuation_->SetTimeOut(missionId, timeout);
|
||||
EXPECT_NE(dschedContinuation_->continuationHandler_, nullptr);
|
||||
DTEST_LOG << "DSchedContinuationTest RemoveTimeOut_001 end" << std::endl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: GetTargetDevice_001
|
||||
* @tc.desc: test GetTargetDevice.
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I60TOK
|
||||
*/
|
||||
HWTEST_F(DSchedContinuationTest, GetTargetDevice_001, TestSize.Level3)
|
||||
{
|
||||
DTEST_LOG << "DSchedContinuationTest GetTargetDevice_001 start" << std::endl;
|
||||
dschedContinuation_->Init(nullptr);
|
||||
|
||||
int32_t missionId = 0;
|
||||
std::string mockDevice = "mockDevice";
|
||||
dschedContinuation_->continuationDevices_[missionId] = mockDevice;
|
||||
std::string result = dschedContinuation_->GetTargetDevice(missionId);
|
||||
EXPECT_EQ(result, mockDevice);
|
||||
DTEST_LOG << "DSchedContinuationTest GetTargetDevice_001 end" << std::endl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: PushCallback_001
|
||||
* @tc.desc: test PushCallback when callback is nullptr.
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I60TOK
|
||||
*/
|
||||
HWTEST_F(DSchedContinuationTest, PushCallback_001, TestSize.Level3)
|
||||
{
|
||||
DTEST_LOG << "DSchedContinuationTest PushCallback_001 start" << std::endl;
|
||||
dschedContinuation_->Init(nullptr);
|
||||
|
||||
int32_t missionId = 0;
|
||||
const sptr<IRemoteObject> callback = nullptr;
|
||||
std::string deviceId = "";
|
||||
bool isFreeInstall = true;
|
||||
bool result = dschedContinuation_->PushCallback(missionId, callback, deviceId, isFreeInstall);
|
||||
EXPECT_EQ(result, false);
|
||||
DTEST_LOG << "DSchedContinuationTest PushCallback_001 end" << std::endl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: PushCallback_002
|
||||
* @tc.desc: test PushCallback when callback is exist.
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I60TOK
|
||||
*/
|
||||
HWTEST_F(DSchedContinuationTest, PushCallback_002, TestSize.Level3)
|
||||
{
|
||||
DTEST_LOG << "DSchedContinuationTest PushCallback_002 start" << std::endl;
|
||||
dschedContinuation_->Init(nullptr);
|
||||
|
||||
int32_t missionId = 0;
|
||||
const sptr<IRemoteObject> callback = new MockRemoteStub();
|
||||
std::string deviceId = "";
|
||||
bool isFreeInstall = true;
|
||||
dschedContinuation_->callbackMap_[missionId] = callback;
|
||||
bool result = dschedContinuation_->PushCallback(missionId, callback, deviceId, isFreeInstall);
|
||||
EXPECT_EQ(result, false);
|
||||
DTEST_LOG << "DSchedContinuationTest PushCallback_002 end" << std::endl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: PushCallback_003
|
||||
* @tc.desc: test PushCallback when isFreeInstall is true.
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I60TOK
|
||||
*/
|
||||
HWTEST_F(DSchedContinuationTest, PushCallback_003, TestSize.Level3)
|
||||
{
|
||||
DTEST_LOG << "DSchedContinuationTest PushCallback_003 start" << std::endl;
|
||||
dschedContinuation_->Init(nullptr);
|
||||
|
||||
int32_t missionId = 0;
|
||||
const sptr<IRemoteObject> callback = new MockRemoteStub();
|
||||
std::string deviceId = "";
|
||||
bool isFreeInstall = true;
|
||||
dschedContinuation_->callbackMap_.clear();
|
||||
bool result = dschedContinuation_->PushCallback(missionId, callback, deviceId, isFreeInstall);
|
||||
EXPECT_EQ(result, true);
|
||||
DTEST_LOG << "DSchedContinuationTest PushCallback_003 end" << std::endl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: ContinueMission_001
|
||||
* @tc.desc: test ContinueMission when srcDeviceId is empty.
|
||||
|
@ -0,0 +1,123 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "distributed_sched_dumper_test.h"
|
||||
#include "test_log.h"
|
||||
|
||||
using namespace testing;
|
||||
using namespace testing::ext;
|
||||
|
||||
namespace OHOS {
|
||||
namespace DistributedSchedule {
|
||||
void DistributedSchedDumperTest::SetUpTestCase()
|
||||
{
|
||||
DTEST_LOG << "DistributedSchedDumperTest::SetUpTestCase" << std::endl;
|
||||
}
|
||||
|
||||
void DistributedSchedDumperTest::TearDownTestCase()
|
||||
{
|
||||
DTEST_LOG << "DistributedSchedDumperTest::TearDownTestCase" << std::endl;
|
||||
}
|
||||
|
||||
void DistributedSchedDumperTest::TearDown()
|
||||
{
|
||||
DTEST_LOG << "DistributedSchedDumperTest::TearDown" << std::endl;
|
||||
}
|
||||
|
||||
void DistributedSchedDumperTest::SetUp()
|
||||
{
|
||||
DTEST_LOG << "DistributedSchedDumperTest::SetUp" << std::endl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: DumpDefault_001
|
||||
* @tc.desc: dump default info
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I60TOK
|
||||
*/
|
||||
HWTEST_F(DistributedSchedDumperTest, DumpDefault_001, TestSize.Level3)
|
||||
{
|
||||
DTEST_LOG << "DistributedSchedDumperTest DumpDefault_001 begin" << std::endl;
|
||||
std::string result = "";
|
||||
bool res = DistributedSchedDumper::DumpDefault(result);
|
||||
EXPECT_EQ(res, true);
|
||||
DTEST_LOG << "DistributedSchedDumperTest DumpDefault_001 end" << std::endl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: Dump_001
|
||||
* @tc.desc: dump info with null arg
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I60TOK
|
||||
*/
|
||||
HWTEST_F(DistributedSchedDumperTest, Dump_001, TestSize.Level3)
|
||||
{
|
||||
DTEST_LOG << "DistributedSchedDumperTest Dump_001 begin" << std::endl;
|
||||
const std::vector<std::string> args = {};
|
||||
std::string result = "";
|
||||
bool res = DistributedSchedDumper::Dump(args, result);
|
||||
EXPECT_EQ(res, true);
|
||||
DTEST_LOG << "DistributedSchedDumperTest Dump_001 end" << std::endl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: Dump_002
|
||||
* @tc.desc: dump info with a correct arg
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I60TOK
|
||||
*/
|
||||
HWTEST_F(DistributedSchedDumperTest, Dump_002, TestSize.Level3)
|
||||
{
|
||||
DTEST_LOG << "DistributedSchedDumperTest Dump_002 begin" << std::endl;
|
||||
const std::vector<std::string> args = {"-connect"};
|
||||
std::string result = "";
|
||||
bool res = DistributedSchedDumper::Dump(args, result);
|
||||
EXPECT_EQ(res, true);
|
||||
DTEST_LOG << "DistributedSchedDumperTest Dump_002 end" << std::endl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: Dump_003
|
||||
* @tc.desc: dump info with a invalid arg
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I60TOK
|
||||
*/
|
||||
HWTEST_F(DistributedSchedDumperTest, Dump_003, TestSize.Level3)
|
||||
{
|
||||
DTEST_LOG << "DistributedSchedDumperTest Dump_003 begin" << std::endl;
|
||||
const std::vector<std::string> args = {"-invalid"};
|
||||
std::string result = "";
|
||||
bool res = DistributedSchedDumper::Dump(args, result);
|
||||
EXPECT_EQ(res, false);
|
||||
DTEST_LOG << "DistributedSchedDumperTest Dump_003 end" << std::endl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: Dump_004
|
||||
* @tc.desc: dump info with two args
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I60TOK
|
||||
*/
|
||||
HWTEST_F(DistributedSchedDumperTest, Dump_004, TestSize.Level3)
|
||||
{
|
||||
DTEST_LOG << "DistributedSchedDumperTest Dump_004 begin" << std::endl;
|
||||
const std::vector<std::string> args = {"-invalid1", "-invalid2"};
|
||||
std::string result = "";
|
||||
bool res = DistributedSchedDumper::Dump(args, result);
|
||||
EXPECT_EQ(res, false);
|
||||
DTEST_LOG << "DistributedSchedDumperTest Dump_004 end" << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (c) 2022 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.
|
||||
*/
|
||||
|
||||
#ifndef DISTRIBUTED_SCHED_DUMPER_TEST_H
|
||||
#define DISTRIBUTED_SCHED_DUMPER_TEST_H
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#define private public
|
||||
#include "distributed_sched_dumper.h"
|
||||
#undef private
|
||||
|
||||
namespace OHOS {
|
||||
namespace DistributedSchedule {
|
||||
class DistributedSchedDumperTest : public testing::Test {
|
||||
public:
|
||||
static void SetUpTestCase();
|
||||
static void TearDownTestCase();
|
||||
void SetUp();
|
||||
void TearDown();
|
||||
};
|
||||
} // namespace DistributedSchedule
|
||||
} // namespace OHOS
|
||||
#endif // DISTRIBUTED_SCHED_DUMPER_TEST_H
|
@ -27,10 +27,6 @@ using namespace testing::ext;
|
||||
|
||||
namespace OHOS {
|
||||
namespace DistributedSchedule {
|
||||
namespace {
|
||||
|
||||
}
|
||||
|
||||
void DmsVersionManagerTest::SetUpTestCase()
|
||||
{
|
||||
DTEST_LOG << "DmsVersionManagerTest::SetUpTestCase" << std::endl;
|
||||
@ -133,14 +129,14 @@ HWTEST_F(DmsVersionManagerTest, ParseDmsVersionTest_001, TestSize.Level3)
|
||||
|
||||
/**
|
||||
* @tc.name: ParseDmsVersionTest_002
|
||||
* @tc.desc: test call ParseDmsVersion with invaild dmsVersionData
|
||||
* @tc.desc: test call ParseDmsVersion with invalid dmsVersionData
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I5RWKZ
|
||||
*/
|
||||
HWTEST_F(DmsVersionManagerTest, ParseDmsVersionTest_002, TestSize.Level3)
|
||||
{
|
||||
DTEST_LOG << "DmsVersionManagerTest ParseDmsVersionTest_002 begin" << std::endl;
|
||||
std::string dmsVersionData = "invaild.2.1";
|
||||
std::string dmsVersionData = "invalid.2.1";
|
||||
DmsVersion dmsVersion;
|
||||
bool result = DmsVersionManager::ParseDmsVersion(dmsVersionData, dmsVersion);
|
||||
EXPECT_EQ(result, false);
|
||||
@ -149,7 +145,7 @@ HWTEST_F(DmsVersionManagerTest, ParseDmsVersionTest_002, TestSize.Level3)
|
||||
|
||||
/**
|
||||
* @tc.name: ParseDmsVersionTest_003
|
||||
* @tc.desc: test call ParseDmsVersion with invaild dmsVersionData
|
||||
* @tc.desc: test call ParseDmsVersion with invalid dmsVersionData
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I5RWKZ
|
||||
*/
|
||||
@ -165,14 +161,14 @@ HWTEST_F(DmsVersionManagerTest, ParseDmsVersionTest_003, TestSize.Level3)
|
||||
|
||||
/**
|
||||
* @tc.name: ParseDmsVersionTest_004
|
||||
* @tc.desc: test call ParseDmsVersion with invaild dmsVersionData
|
||||
* @tc.desc: test call ParseDmsVersion with invalid dmsVersionData
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I5RWKZ
|
||||
*/
|
||||
HWTEST_F(DmsVersionManagerTest, ParseDmsVersionTest_004, TestSize.Level3)
|
||||
{
|
||||
DTEST_LOG << "DmsVersionManagerTest ParseDmsVersionTest_004 begin" << std::endl;
|
||||
std::string dmsVersionData = "3.invaild.1";
|
||||
std::string dmsVersionData = "3.invalid.1";
|
||||
DmsVersion dmsVersion;
|
||||
bool result = DmsVersionManager::ParseDmsVersion(dmsVersionData, dmsVersion);
|
||||
EXPECT_EQ(result, false);
|
||||
@ -181,7 +177,7 @@ HWTEST_F(DmsVersionManagerTest, ParseDmsVersionTest_004, TestSize.Level3)
|
||||
|
||||
/**
|
||||
* @tc.name: ParseDmsVersionTest_005
|
||||
* @tc.desc: test call ParseDmsVersion with invaild dmsVersionData
|
||||
* @tc.desc: test call ParseDmsVersion with invalid dmsVersionData
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I5RWKZ
|
||||
*/
|
||||
@ -197,14 +193,14 @@ HWTEST_F(DmsVersionManagerTest, ParseDmsVersionTest_005, TestSize.Level3)
|
||||
|
||||
/**
|
||||
* @tc.name: ParseDmsVersionTest_006
|
||||
* @tc.desc: test call ParseDmsVersion with invaild dmsVersionData
|
||||
* @tc.desc: test call ParseDmsVersion with invalid dmsVersionData
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I5RWKZ
|
||||
*/
|
||||
HWTEST_F(DmsVersionManagerTest, ParseDmsVersionTest_006, TestSize.Level3)
|
||||
{
|
||||
DTEST_LOG << "DmsVersionManagerTest ParseDmsVersionTest_006 begin" << std::endl;
|
||||
std::string dmsVersionData = "3.2.invaild";
|
||||
std::string dmsVersionData = "3.2.invalid";
|
||||
DmsVersion dmsVersion;
|
||||
bool result = DmsVersionManager::ParseDmsVersion(dmsVersionData, dmsVersion);
|
||||
EXPECT_EQ(result, false);
|
||||
@ -213,7 +209,7 @@ HWTEST_F(DmsVersionManagerTest, ParseDmsVersionTest_006, TestSize.Level3)
|
||||
|
||||
/**
|
||||
* @tc.name: ParseDmsVersionTest_007
|
||||
* @tc.desc: test call ParseDmsVersion with invaild dmsVersionData
|
||||
* @tc.desc: test call ParseDmsVersion with invalid dmsVersionData
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I5RWKZ
|
||||
*/
|
||||
@ -281,7 +277,7 @@ HWTEST_F(DmsVersionManagerTest, GetDmsVersionDataFromAppInfo_002, TestSize.Level
|
||||
|
||||
/**
|
||||
* @tc.name: GetDmsVersionDataFromAppInfo_003
|
||||
* @tc.desc: test call GetDmsVersionDataFromAppInfo with invaild data
|
||||
* @tc.desc: test call GetDmsVersionDataFromAppInfo with invalid data
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I5RWKZ
|
||||
*/
|
||||
@ -299,7 +295,7 @@ HWTEST_F(DmsVersionManagerTest, GetDmsVersionDataFromAppInfo_003, TestSize.Level
|
||||
|
||||
/**
|
||||
* @tc.name: GetDmsVersionDataFromAppInfo_004
|
||||
* @tc.desc: test call GetDmsVersionDataFromAppInfo with invaild data
|
||||
* @tc.desc: test call GetDmsVersionDataFromAppInfo with invalid data
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I5RWKZ
|
||||
*/
|
||||
@ -335,7 +331,7 @@ HWTEST_F(DmsVersionManagerTest, GetDmsVersionDataFromAppInfo_005, TestSize.Level
|
||||
|
||||
/**
|
||||
* @tc.name: GetAppInfoFromDP_001
|
||||
* @tc.desc: test call GetAppInfoFromDP with invaild device id
|
||||
* @tc.desc: test call GetAppInfoFromDP with invalid device id
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I5RWKZ
|
||||
*/
|
||||
@ -403,7 +399,7 @@ HWTEST_F(DmsVersionManagerTest, ParseAppInfo_002, TestSize.Level3)
|
||||
|
||||
/**
|
||||
* @tc.name: ParseAppInfo_003
|
||||
* @tc.desc: test call ParseAppInfo with invaild packageNamesData
|
||||
* @tc.desc: test call ParseAppInfo with invalid packageNamesData
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I5RWKZ
|
||||
*/
|
||||
@ -439,7 +435,7 @@ HWTEST_F(DmsVersionManagerTest, ParseAppInfo_004, TestSize.Level3)
|
||||
|
||||
/**
|
||||
* @tc.name: ParseAppInfo_005
|
||||
* @tc.desc: test call ParseAppInfo with invaild versionsData
|
||||
* @tc.desc: test call ParseAppInfo with invalid versionsData
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I5RWKZ
|
||||
*/
|
||||
@ -475,7 +471,7 @@ HWTEST_F(DmsVersionManagerTest, ParseAppInfo_006, TestSize.Level3)
|
||||
|
||||
/**
|
||||
* @tc.name: GetRemoteDmsVersion_001
|
||||
* @tc.desc: test call GetRemoteDmsVersion with invaild deviceId
|
||||
* @tc.desc: test call GetRemoteDmsVersion with invalid deviceId
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I5RWKZ
|
||||
*/
|
||||
@ -507,7 +503,7 @@ HWTEST_F(DmsVersionManagerTest, GetRemoteDmsVersion_002, TestSize.Level3)
|
||||
|
||||
/**
|
||||
* @tc.name: IsRemoteDmsVersionLower_001
|
||||
* @tc.desc: test call IsRemoteDmsVersionLower with invaild deviceId
|
||||
* @tc.desc: test call IsRemoteDmsVersionLower with invalid deviceId
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: I5RWKZ
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user