修改黄区子进程退出后ut失败

Signed-off-by: cheng_jinsong <chengjinsong2@huawei.com>
This commit is contained in:
cheng_jinsong 2023-07-04 14:44:30 +08:00
parent 28f9c5035b
commit 592ec7f76c

View File

@ -566,9 +566,11 @@ static void TestBeforeInit(void)
}
#endif
static pid_t g_currPid = 0;
static __attribute__((constructor(101))) void ParamTestStubInit(void)
{
printf("Init unit test start \n");
g_currPid = getpid();
printf("Init unit test start %u \n", g_currPid);
EnableInitLog(INIT_ERROR);
// prepare data
@ -594,7 +596,10 @@ static __attribute__((constructor(101))) void ParamTestStubInit(void)
__attribute__((destructor)) static void ParamTestStubExit(void)
{
PARAM_LOGI("ParamTestStubExit");
PARAM_LOGI("ParamTestStubExit %u %u \n", g_currPid, getpid());
if (g_currPid != getpid()) {
return;
}
#ifndef OHOS_LITE
StopParamService();