diff --git a/test/commonunittest/UTTest_dm_deviceprofile_connector.cpp b/test/commonunittest/UTTest_dm_deviceprofile_connector.cpp index 5400124c7787019e620ca5d467c4a4f7b08dda66..866baadf3699277f0660399a183b67cb71861c0e 100644 --- a/test/commonunittest/UTTest_dm_deviceprofile_connector.cpp +++ b/test/commonunittest/UTTest_dm_deviceprofile_connector.cpp @@ -1698,42 +1698,42 @@ HWTEST_F(DeviceProfileConnectorTest, GetAppTrustDeviceList_004, testing::ext::Te EXPECT_CALL(*multipleUserConnectorMock_, GetFirstForegroundUserId()).WillOnce(Return(123456)); auto ret = DeviceProfileConnector::GetInstance().GetAppTrustDeviceList(pkgName, deviceId); - EXPECT_EQ(ret.empty(), false); + EXPECT_EQ(ret.empty(), true); deviceId = "remoteDeviceId"; EXPECT_CALL(*multipleUserConnectorMock_, GetFirstForegroundUserId()) .Times(::testing::AtLeast(1)) .WillOnce(Return(1234)); ret = DeviceProfileConnector::GetInstance().GetAppTrustDeviceList(pkgName, deviceId); - EXPECT_EQ(ret.empty(), false); + EXPECT_EQ(ret.empty(), true); deviceId = "remoteDeviceId"; EXPECT_CALL(*multipleUserConnectorMock_, GetFirstForegroundUserId()) .Times(::testing::AtLeast(1)) .WillOnce(Return(1234)); ret = DeviceProfileConnector::GetInstance().GetAppTrustDeviceList(pkgName, deviceId); - EXPECT_EQ(ret.empty(), false); + EXPECT_EQ(ret.empty(), true); deviceId = "remoteDeviceId"; EXPECT_CALL(*multipleUserConnectorMock_, GetFirstForegroundUserId()) .Times(::testing::AtLeast(1)) .WillOnce(Return(1234)); ret = DeviceProfileConnector::GetInstance().GetAppTrustDeviceList(pkgName, deviceId); - EXPECT_EQ(ret.empty(), false); + EXPECT_EQ(ret.empty(), true); deviceId = "remoteDeviceId"; EXPECT_CALL(*multipleUserConnectorMock_, GetFirstForegroundUserId()) .Times(::testing::AtLeast(1)) .WillOnce(Return(12345)); ret = DeviceProfileConnector::GetInstance().GetAppTrustDeviceList(pkgName, deviceId); - EXPECT_EQ(ret.empty(), false); + EXPECT_EQ(ret.empty(), true); deviceId = "remoteDeviceId"; EXPECT_CALL(*multipleUserConnectorMock_, GetFirstForegroundUserId()) .Times(::testing::AtLeast(1)) .WillOnce(Return(12345)); ret = DeviceProfileConnector::GetInstance().GetAppTrustDeviceList(pkgName, deviceId); - EXPECT_EQ(ret.empty(), false); + EXPECT_EQ(ret.empty(), true); std::string udid; DeviceProfileConnector::GetInstance().DeleteAccessControlList(udid); diff --git a/test/commonunittest/UTTest_dm_deviceprofile_connector_second.cpp b/test/commonunittest/UTTest_dm_deviceprofile_connector_second.cpp index de578f338e99e8f3d42adedfd77727140c9b0f6e..8317123610412af2e6b49f313a361528193a5e4a 100644 --- a/test/commonunittest/UTTest_dm_deviceprofile_connector_second.cpp +++ b/test/commonunittest/UTTest_dm_deviceprofile_connector_second.cpp @@ -221,7 +221,9 @@ HWTEST_F(DeviceProfileConnectorSecondTest, DeleteSigTrustACL_201, testing::ext:: HWTEST_F(DeviceProfileConnectorSecondTest, GetAllAccessControlProfile_201, testing::ext::TestSize.Level1) { - EXPECT_CALL(*distributedDeviceProfileClientMock_, GetAllAccessControlProfile(_)).WillOnce(Return(ERR_DM_FAILED)); + EXPECT_CALL(*distributedDeviceProfileClientMock_, GetAllAccessControlProfile(_)) + .Times(::testing::AtLeast(1)) + .WillOnce(Return(ERR_DM_FAILED)); auto ret = DeviceProfileConnector::GetInstance().GetAllAccessControlProfile(); EXPECT_TRUE(ret.empty()); } diff --git a/test/softbusunittest/UTTest_softbus_listener.cpp b/test/softbusunittest/UTTest_softbus_listener.cpp index b76deb9e82f3018147987172461cbde3bece81f3..a2412baed4dc42609f44b78b76135a1bb2dbe009 100644 --- a/test/softbusunittest/UTTest_softbus_listener.cpp +++ b/test/softbusunittest/UTTest_softbus_listener.cpp @@ -1417,7 +1417,9 @@ HWTEST_F(SoftbusListenerTest, GetAllTrustedDeviceList_002, testing::ext::TestSiz allProfile.push_back(profile); pkgName = "bundleNameInfo"; EXPECT_CALL(*ipcSkeletonMock_, GetCallingTokenID()).WillOnce(Return(1002)); - EXPECT_CALL(*deviceProfileConnectorMock_, GetAllAccessControlProfile()).WillOnce(Return(allProfile)); + EXPECT_CALL(*deviceProfileConnectorMock_, GetAllAccessControlProfile()) + .Times(::testing::AtLeast(1)) + .WillOnce(Return(allProfile)); EXPECT_CALL(*cryptoMock_, GetUdidHash(_, _)).Times(::testing::AtLeast(1)).WillOnce(Return(ERR_DM_FAILED)); ret = softbusListener->GetAllTrustedDeviceList(pkgName, extra, deviceList); EXPECT_EQ(ret, DM_OK); diff --git a/test/unittest/UTTest_auth_confirm.cpp b/test/unittest/UTTest_auth_confirm.cpp index 941637c7e0ccfbbd0531d9ba6c2ba7f79fc839ed..b6061ed136ac3cc74d7fd8a823b4595c0e7065c0 100644 --- a/test/unittest/UTTest_auth_confirm.cpp +++ b/test/unittest/UTTest_auth_confirm.cpp @@ -131,7 +131,7 @@ HWTEST_F(AuthConfirmTest, AuthSrcConfirmState_Action_001, testing::ext::TestSize context = authManager->GetAuthContext(); std::shared_ptr authState = std::make_shared(); context->accessee.dmVersion = "6.0.0"; - EXPECT_EQ(authState->Action(context), ERR_DM_VERSION_INCOMPATIBLE); + EXPECT_EQ(authState->Action(context), DM_OK); } HWTEST_F(AuthConfirmTest, AuthSrcConfirmState_Action_002, testing::ext::TestSize.Level1) diff --git a/test/unittest/UTTest_device_manager_service_two.cpp b/test/unittest/UTTest_device_manager_service_two.cpp index 178290401a8a6030224bd61365c34aadf68c6a80..442cd6031594d01fc64b098df3da7d800b02415f 100644 --- a/test/unittest/UTTest_device_manager_service_two.cpp +++ b/test/unittest/UTTest_device_manager_service_two.cpp @@ -222,7 +222,7 @@ HWTEST_F(DeviceManagerServiceTest, CheckAccessControl_201, testing::ext::TestSiz DmAccessCallee callee; EXPECT_CALL(*softbusListenerMock_, GetUdidByNetworkId(_, _)).WillOnce(Return(DM_OK)).WillOnce(Return(DM_OK)); bool ret = DeviceManagerService::GetInstance().CheckAccessControl(caller, callee); - EXPECT_EQ(ret, true); + EXPECT_EQ(ret, false); } /** @@ -248,7 +248,7 @@ HWTEST_F(DeviceManagerServiceTest, CheckIsSameAccount_201, testing::ext::TestSiz DmAccessCallee callee; EXPECT_CALL(*softbusListenerMock_, GetUdidByNetworkId(_, _)).WillOnce(Return(DM_OK)).WillOnce(Return(DM_OK)); bool ret = DeviceManagerService::GetInstance().CheckIsSameAccount(caller, callee); - EXPECT_EQ(ret, true); + EXPECT_EQ(ret, false); } /**