fix codex

Signed-off-by: wangxingboo <wangxingbo11@h-partners.com>
This commit is contained in:
wangxingboo 2024-10-12 14:31:53 +08:00
parent f9fca001bb
commit 65a90724c1
7 changed files with 13 additions and 11 deletions

View File

@ -60,7 +60,7 @@ inline constexpr const char *COUNTRY_CODE_KEY = "telephony.sim.countryCode";
inline constexpr const char *TEL_SATELLITE_SUPPORTED = "const.telephony.satellite.supported";
inline constexpr const char *DEFAULT_VSIM_MODEM_COUNT = "0";
inline constexpr const char *VSIM_MODEM_COUNT_STR = "const.telephony.vsimModemCount";
inline constexpr const char *TEL_ESIM_SUPPORT = "const.telephony.esim.supported";
inline constexpr const char *TEL_ESIM_SUPPORT = "persist.telephony.esim.supported";
template<typename T>
inline T GetVirtualModemSwitch()

View File

@ -109,7 +109,7 @@ bool EsimFile::ProcessEstablishDefaultSmdpAddressDone(const AppExecFwk::InnerEve
TELEPHONY_LOGE("pAsn1Node is nullptr");
return false;
}
setDpAddressResult_ = (ResultState)pAsn1Node->Asn1AsInteger();
setDpAddressResult_ = static_cast<ResultState>(pAsn1Node->Asn1AsInteger());
{
std::lock_guard<std::mutex> lock(setDefaultSmdpAddressMutex_);
isSetDefaultSmdpAddressReady_ = true;
@ -250,12 +250,14 @@ bool EsimFile::ProcessSendApduData(int32_t slotId, const AppExecFwk::InnerEvent:
return false;
}
EsimProfile *profile = &esimProfile_;
std::string hexStr = OHOS::Telephony::ToUtf8(profile->toBeSendApduDataHexStr);
std::string hexStr = OHOS::Telephony::ToUtf8(esimProfile_.toBeSendApduDataHexStr);
RequestApduBuild codec(currentChannelId_);
codec.BuildStoreData(hexStr);
std::list<std::unique_ptr<ApduCommand>> list = codec.GetCommands();
std::unique_ptr<ApduCommand> apdCmd = std::move(list.front());
if (apdCmd == nullptr) {
return false;
}
ApduSimIORequestInfo reqInfo;
CopyApdCmdToReqInfo(&reqInfo, apdCmd.get());
if (telRilManager_ == nullptr) {

View File

@ -71,7 +71,7 @@ HWTEST_F(EsimCoreServiceClientBranchTest, ResetMemory_0100, Function | MediumTes
HWTEST_F(EsimCoreServiceClientBranchTest, SetDefaultSmdpAddress_0100, Function | MediumTest | Level1)
{
int32_t slotId = 0;
std::u16string defaultSmdpAddress = Str8ToStr16("smdp.gsma.com");
std::u16string defaultSmdpAddress = Str8ToStr16("test.com");
ResultState SetAddressResult;
EXPECT_CALL(*samgr, CheckSystemAbility(testing::_)).WillOnce(testing::Return(nullptr));
int32_t result = CoreServiceClient::GetInstance().

View File

@ -59,7 +59,7 @@ HWTEST_F(EsimCoreServiceClientTest, ResetMemory_0001, Function | MediumTest | Le
HWTEST_F(EsimCoreServiceClientTest, SetDefaultSmdpAddress_0001, Function | MediumTest | Level1)
{
int32_t slotId = 0;
std::u16string defaultSmdpAddress = Str8ToStr16("smdp.gsma.com");
std::u16string defaultSmdpAddress = Str8ToStr16("test.com");
ResultState SetAddressResult;
int32_t result = CoreServiceClient::GetInstance().SetDefaultSmdpAddress(
slotId, defaultSmdpAddress, SetAddressResult);

View File

@ -141,7 +141,7 @@ HWTEST_F(EsimCoreServiceProxyTest, SetDefaultSmdpAddress_001, Function | MediumT
{
sptr<MockIRemoteObject> remote = nullptr;
CoreServiceProxy proxy(remote);
std::u16string defaultSmdpAddress = Str8ToStr16("smdp.gsma.com");
std::u16string defaultSmdpAddress = Str8ToStr16("test.com");
ResultState setAddressResult;
int32_t ret = proxy.SetDefaultSmdpAddress(SLOT_ID, defaultSmdpAddress, setAddressResult);
EXPECT_EQ(ret, TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL);
@ -151,7 +151,7 @@ HWTEST_F(EsimCoreServiceProxyTest, SetDefaultSmdpAddress_002, Function | MediumT
{
sptr<MockIRemoteObject> remote = new (std::nothrow) MockIRemoteObject();
CoreServiceProxy proxy(remote);
std::u16string defaultSmdpAddress = Str8ToStr16("smdp.gsma.com");
std::u16string defaultSmdpAddress = Str8ToStr16("test.com");
ResultState setAddressResult;
EXPECT_CALL(*remote, SendRequest(testing::_, testing::_, testing::_, testing::_)).WillOnce(testing::Return(-500));
int32_t ret = proxy.SetDefaultSmdpAddress(SLOT_ID, defaultSmdpAddress, setAddressResult);
@ -162,7 +162,7 @@ HWTEST_F(EsimCoreServiceProxyTest, SetDefaultSmdpAddress_003, Function | MediumT
{
sptr<MockIRemoteObject> remote = new (std::nothrow) MockIRemoteObject();
CoreServiceProxy proxy(remote);
std::u16string defaultSmdpAddress = Str8ToStr16("smdp.gsma.com");
std::u16string defaultSmdpAddress = Str8ToStr16("test.com");
ResultState setAddressResult;
EXPECT_CALL(*remote, SendRequest(testing::_, testing::_, testing::_, testing::_)).WillOnce(testing::Return(0));
int32_t ret = proxy.SetDefaultSmdpAddress(SLOT_ID, defaultSmdpAddress, setAddressResult);

View File

@ -67,7 +67,7 @@ HWTEST_F(EsimCoreServiceTest, SetDefaultSmdpAddress_0001, Function | MediumTest
std::shared_ptr<TelRilManager> telRilManager = std::make_shared<TelRilManager>();
mCoreService->simManager_ = std::make_shared<SimManager>(telRilManager);
int32_t slotId = 0;
std::u16string defaultSmdpAddress = Str8ToStr16("smdp.gsma.com");
std::u16string defaultSmdpAddress = Str8ToStr16("test.com");
ResultState SetAddressResult;
EXPECT_NE(mCoreService->SetDefaultSmdpAddress(
slotId, defaultSmdpAddress, SetAddressResult), TELEPHONY_ERR_SUCCESS);

View File

@ -81,7 +81,7 @@ HWTEST_F(EsimManagerTest, ResetMemory, Function | MediumTest | Level1)
HWTEST_F(EsimManagerTest, SetDefaultSmdpAddress, Function | MediumTest | Level1)
{
int32_t slotId = 0;
std::u16string defaultSmdpAddress = Str8ToStr16("smdp.gsma.com");
std::u16string defaultSmdpAddress = Str8ToStr16("test.com");
ResultState SetAddressResult;
std::shared_ptr<TelRilManager> telRilManager = std::make_shared<TelRilManager>();
std::shared_ptr<Telephony::SimManager> simManager = std::make_shared<SimManager>(telRilManager);