修改初始化GetLastRequestTime值

Signed-off-by: yanghang <yanghang86@huawei.com>
This commit is contained in:
yanghang 2024-07-31 16:21:34 +08:00
parent f8b915b756
commit 10081a51ca
2 changed files with 4 additions and 1 deletions

View File

@ -66,6 +66,9 @@ IPCObjectStub::IPCObjectStub(std::u16string descriptor, bool serialInvokeFlag)
ZLOGD(LABEL, "desc:%{public}s, %{public}u",
ProcessSkeleton::ConvertToSecureDesc(Str16ToStr8(descriptor_)).c_str(),
ProcessSkeleton::ConvertAddr(this));
auto start = std::chrono::steady_clock::now();
lastRequestTime_ = static_cast<uint64_t>(std::chrono::duration_cast<std::chrono::milliseconds>(
start.time_since_epoch()).count());
InitCodeMap();
ProcessSkeleton *current = ProcessSkeleton::GetInstance();
if (current == nullptr) {

View File

@ -170,7 +170,7 @@ HWTEST_F(IPCObjectStubTest, GetLastRequestTimeTest001, TestSize.Level1)
sptr<IPCObjectStub> testStub = new IPCObjectStub(u"testStub");
uint64_t ret = testStub->GetLastRequestTime();
EXPECT_EQ(ret, 0);
EXPECT_TRUE(ret > 0);
}
/**