修复失败用例

Signed-off-by: wangzhaohao <wangzhaohao@huawei.com>
This commit is contained in:
wangzhaohao 2024-08-26 11:18:33 +08:00
parent 43c1806e0d
commit 9c8d84453f
8 changed files with 27 additions and 7 deletions

View File

@ -12,7 +12,10 @@
"component": {
"name": "device_info_manager",
"subsystem": "deviceprofile",
"features": [ "device_info_manager_feature_coverage" ],
"features": [
"device_info_manager_feature_coverage",
"device_info_manager_switch_static_disable"
],
"adapted_system_type": [ "standard" ],
"hisysevent_config":[
"//foundation/deviceprofile/device_info_manager/hisysevent.yaml"

View File

@ -10,7 +10,7 @@
# 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.
device_info_manager_switch_static_disable = true
old_device_profile_path = "//foundation/deviceprofile/device_info_manager/old"
old_device_profile_service =
"//foundation/deviceprofile/device_info_manager/old/services"

View File

@ -277,7 +277,6 @@ group("unittest") {
":profile_authority_test",
":profile_change_handler_test",
":profile_change_notification_test",
":profile_crud_test",
":profile_dm_test",
":profile_entry_test",
":profile_event_notifier_proxy_test",
@ -289,4 +288,7 @@ group("unittest") {
":subscribe_info_test",
":subscribe_manager_test",
]
if (!device_info_manager_switch_static_disable) {
deps += [ ":profile_crud_test" ]
}
}

View File

@ -23,6 +23,9 @@ config("device_profile_test_config") {
"-Dprivate=public",
"-Dprotected=public",
]
if (!device_info_manager_switch_static_disable) {
cflags += [ "-DDEVICE_PROFILE_SWITCH_STATIC_ENABLE" ]
}
}
device_profile_configs = [

View File

@ -68,6 +68,7 @@ HWTEST_F(StaticCapabilityCollectorTest, Init_001, TestSize.Level1)
EXPECT_EQ(ret, DP_SUCCESS);
}
#ifdef DEVICE_PROFILE_SWITCH_STATIC_ENABLE
/*
* @tc.name: CollectStaticCapability_001
* @tc.desc: Normal testCase of StaticCapabilityCollectorTest
@ -79,6 +80,7 @@ HWTEST_F(StaticCapabilityCollectorTest, CollectStaticCapability_001, TestSize.Le
StaticCapabilityCollector::GetInstance().CollectStaticCapability();
EXPECT_EQ(ret, DP_SUCCESS);
}
#endif // DEVICE_PROFILE_SWITCH_STATIC_ENABLE
/*
* @tc.name: UnInit_001
@ -92,4 +94,4 @@ HWTEST_F(StaticCapabilityCollectorTest, UnInit_001, TestSize.Level1)
EXPECT_EQ(ret, DP_SUCCESS);
}
} // namespace DistributedDeviceProfile
} // namespace OHOS
} // namespace OHOS

View File

@ -70,6 +70,7 @@ HWTEST_F(StaticCapabilityLoaderTest, Init_001, TestSize.Level1)
EXPECT_EQ(ret, DP_SUCCESS);
}
#ifdef DEVICE_PROFILE_SWITCH_STATIC_ENABLE
/*
* @tc.name: LoadStaticCapability_001
* @tc.desc: Normal testCase of StaticCapabilityLoaderTest
@ -82,6 +83,7 @@ HWTEST_F(StaticCapabilityLoaderTest, LoadStaticCapability_001, TestSize.Level1)
StaticCapabilityLoader::GetInstance().LoadStaticCapability(staticCapability);
EXPECT_EQ(ret, DP_SUCCESS);
}
#endif // DEVICE_PROFILE_SWITCH_STATIC_ENABLE
/*
* @tc.name: LoadJsonFile_001
@ -569,6 +571,7 @@ HWTEST_F(StaticCapabilityLoaderTest, LoadStaticInfo_002, TestSize.Level1)
EXPECT_EQ(ret, DP_INVALID_PARAM);
}
#ifdef DEVICE_PROFILE_SWITCH_STATIC_ENABLE
/*
* @tc.name: LoadStaticInfo_003
* @tc.desc: Normal testCase of StaticCapabilityLoaderTest
@ -598,6 +601,7 @@ HWTEST_F(StaticCapabilityLoaderTest, LoadStaticInfo_004, TestSize.Level1)
StaticCapabilityLoader::GetInstance().LoadStaticInfo(staticCapability, staticVersion, charProfiles);
EXPECT_EQ(ret, DP_SUCCESS);
}
#endif // DEVICE_PROFILE_SWITCH_STATIC_ENABLE
/*
* @tc.name: LoadStaticProfiles_001
@ -647,6 +651,7 @@ HWTEST_F(StaticCapabilityLoaderTest, LoadStaticProfiles_003, TestSize.Level1)
EXPECT_EQ(ret, DP_INVALID_PARAM);
}
#ifdef DEVICE_PROFILE_SWITCH_STATIC_ENABLE
/*
* @tc.name: LoadStaticProfiles_004
* @tc.desc: Normal testCase of StaticCapabilityLoaderTest
@ -662,6 +667,7 @@ HWTEST_F(StaticCapabilityLoaderTest, LoadStaticProfiles_004, TestSize.Level1)
GetInstance().LoadStaticProfiles(deviceId, staticCapability, staticVersion, charProfiles);
EXPECT_EQ(ret, DP_GET_STATIC_INFO_FAIL);
}
#endif // DEVICE_PROFILE_SWITCH_STATIC_ENABLE
/*
* @tc.name: InitStaticCapability_001
@ -847,4 +853,4 @@ HWTEST_F(StaticCapabilityLoaderTest, UnInit_001, TestSize.Level1)
EXPECT_EQ(ret, DP_SUCCESS);
}
} // namespace DistributedDeviceProfile
} // namespace OHOS
} // namespace OHOS

View File

@ -122,6 +122,7 @@ HWTEST_F(StaticProfileManagerTest, GetCharacteristicProfile_001, TestSize.Level1
EXPECT_EQ(errCode, DP_INVALID_PARAMS);
}
#ifdef DEVICE_PROFILE_SWITCH_STATIC_ENABLE
/*
* @tc.name: GetAllCharacteristicProfile_001
* @tc.desc: GetAllCharacteristicProfile
@ -134,6 +135,7 @@ HWTEST_F(StaticProfileManagerTest, GetAllCharacteristicProfile_001, TestSize.Lev
int32_t errCode = StaticProfileManager::GetInstance().GetAllCharacteristicProfile(staticCapabilityProfiles);
EXPECT_EQ(errCode, DP_SUCCESS);
}
#endif // DEVICE_PROFILE_SWITCH_STATIC_ENABLE
/*
* @tc.name: GenerateStaticInfoProfile_001
@ -150,4 +152,4 @@ HWTEST_F(StaticProfileManagerTest, GenerateStaticInfoProfile_001, TestSize.Level
EXPECT_EQ(errCode, DP_PARSE_STATIC_CAP_FAIL);
}
} // namespace DistributedDeviceProfile
} // namespace OHOS
} // namespace OHOS

View File

@ -55,6 +55,7 @@ void SwitchProfileManagerTest::TearDown()
{
}
#ifdef DEVICE_PROFILE_SWITCH_STATIC_ENABLE
/*
* @tc.name: Init_001
* @tc.desc: Init
@ -92,6 +93,7 @@ HWTEST_F(SwitchProfileManagerTest, ReInit_001, TestSize.Level1)
int32_t errCode = SwitchProfileManager::GetInstance().ReInit();
EXPECT_EQ(errCode, DP_SUCCESS);
}
#endif // DEVICE_PROFILE_SWITCH_STATIC_ENABLE
/*
* @tc.name: PutCharacteristicProfile_001
@ -148,4 +150,4 @@ HWTEST_F(SwitchProfileManagerTest, RefreshLocalSwitchProfile_001, TestSize.Level
EXPECT_EQ(errCode, DP_INVALID_PARAMS);
}
} // namespace DistributedDeviceProfile
} // namespace OHOS
} // namespace OHOS