提交 3141b800 编写于 作者: S selectfromemp

Modify the possible crash points in process

Change-Id: I11cf71f4e6768d1a717f1e4cd8ad803b2fe7ed8d
上级 1d46b68e
......@@ -223,6 +223,7 @@ HWTEST_F(ActsProcessApiTest, testPthreadSetnameNp1100, Function | MediumTest | L
<< "ErrInfo: pthread_setname_np thread:='" << newThread
<< "(0x" << newThread << ")' *name:='fThreadName',"
<< " --> returnVal:='" << returnVal << "'";
EXPECT_EQ(pthread_join(newThread, nullptr), 0) << "pthread join errno = " << errno;
}
/**
......@@ -263,4 +264,5 @@ HWTEST_F(ActsProcessApiTest, testPthreadAttrGetguardsize0100, Function | MediumT
EXPECT_EQ(guardsize, 4096)
<< "ErrInfo: pthread_attr_getguardsize attr:='&threadAttr' guardsize:='&guardsize',"
<< " --> returnVal:='" << returnVal << "', guardsize:='" << guardsize << "'";
EXPECT_EQ(pthread_join(newThread, nullptr), 0) << "pthread join errno = " << errno;
}
......@@ -93,7 +93,7 @@ HWTEST_F(PthreadTest, testPthreadAttrSetscope, Function | MediumTest | Level3)
ASSERT_EQ(pthread_create(&tid, &attr, ThreadPthreadAttrSetscope, nullptr), 0) << "> return errno";
Msleep(20);
pthread_cancel(tid);
pthread_join(tid, nullptr);
EXPECT_EQ(pthread_attr_destroy(&attr), 0);
}
......@@ -133,7 +133,7 @@ HWTEST_F(PthreadTest, testPthreadAttrSetguardsize, Function | MediumTest | Level
ASSERT_EQ(pthread_create(&tid, &attr, ThreadPthreadAttrSetguardsize, nullptr), 0) << "> return errno";
Msleep(20);
pthread_cancel(tid);
pthread_join(tid, nullptr);
EXPECT_EQ(pthread_attr_destroy(&attr), 0);
}
......@@ -176,7 +176,7 @@ HWTEST_F(PthreadTest, testPthreadAttrSetstacksize, Function | MediumTest | Level
ASSERT_EQ(pthread_create(&tid, &attr, ThreadPthreadAttrSetstacksize, nullptr), 0) << "> return errno";
Msleep(20);
pthread_cancel(tid);
pthread_join(tid, nullptr);
EXPECT_EQ(pthread_attr_destroy(&attr), 0);
}
......@@ -241,7 +241,7 @@ HWTEST_F(PthreadTest, testPthreadAttrSetstack, Function | MediumTest | Level3)
EXPECT_EQ(pthread_create(&tid, &attr, ThreadPthreadAttrSetstack, stackAddr), 0) << "> return errno";
Msleep(100);
pthread_cancel(tid);
pthread_join(tid, nullptr);
EXPECT_EQ(pthread_attr_destroy(&attr), 0);
}
......@@ -296,5 +296,5 @@ HWTEST_F(PthreadTest, testPthreadGetattrNp, Function | MediumTest | Level3)
pthread_t tid;
EXPECT_EQ(pthread_create(&tid, nullptr, ThreadPthreadGetattrNp, nullptr), 0) << "> return errno";
Msleep(100);
pthread_cancel(tid);
pthread_join(tid, nullptr);
}
......@@ -308,7 +308,9 @@ HWTEST_F(PthreadTest, testPthreadSpecificAll, Function | MediumTest | Level3)
ASSERT_EQ(pthread_create(&tid2, nullptr, ThreadPthreadSpecificAll, nullptr), 0) << "> return errno";
Msleep(100);
pthread_cancel(tid1);
pthread_join(tid1, nullptr);
pthread_cancel(tid2);
pthread_join(tid2, nullptr);
EXPECT_EQ(g_intPthreadSpecificAll, 5);
}
......@@ -340,7 +342,7 @@ HWTEST_F(PthreadTest, testPthreadSpecificAllDelete, Function | MediumTest | Leve
pthread_t tid;
ASSERT_EQ(pthread_create(&tid, nullptr, ThreadPthreadSpecificAllDelete, (void*)&data), 0) << "> return errno";
Msleep(100);
pthread_cancel(tid);
pthread_join(tid, nullptr);
EXPECT_EQ(data, 1);
}
......@@ -374,7 +376,7 @@ HWTEST_F(PthreadTest, testPthreadCleanupPushPopBasic, Function | MediumTest | Le
CheckStep(1);
ASSERT_EQ(pthread_create(&tid, nullptr, ThreadTestPush, nullptr), 0) << "> return errno";
Msleep(100);
pthread_cancel(tid);
pthread_join(tid, nullptr);
EXPECT_EQ(CheckStep(4), (uint64_t)0x1234);
}
......@@ -404,7 +406,7 @@ HWTEST_F(PthreadTest, testPthreadCleanupPushPopParam, Function | MediumTest | Le
CheckStep(1);
ASSERT_EQ(pthread_create(&tid, nullptr, ThreadTestPushParam, nullptr), 0) << "> return errno";
Msleep(100);
pthread_cancel(tid);
pthread_join(tid, nullptr);
EXPECT_EQ(CheckStep(3), (uint64_t)0x123);
}
......@@ -439,7 +441,7 @@ HWTEST_F(PthreadTest, testPop, Function | MediumTest | Level3)
CheckStep(1);
ASSERT_EQ(pthread_create(&tid, nullptr, ThreadTestop, nullptr), 0) << "> return errno";
Msleep(100);
pthread_cancel(tid);
pthread_join(tid, nullptr);
EXPECT_EQ(CheckStep(3), (uint64_t)0x123);
}
......@@ -525,8 +527,8 @@ HWTEST_F(PthreadTest, testBarrierWait, Function | MediumTest | Level3)
ADD_FAILURE();
}
Msleep(50);
pthread_cancel(tid);
pthread_cancel(tid1);
pthread_join(tid, nullptr);
pthread_join(tid1, nullptr);
EXPECT_EQ(pthread_barrier_destroy(&g_barrier), 0) << "> return errno";
EXPECT_EQ(CheckStep(3), (uint64_t)0x123);
EXPECT_EQ(intParam, 2);
......@@ -567,8 +569,8 @@ HWTEST_F(PthreadTest, testBarrierAlwaysWait, Function | MediumTest | Level3)
if ((reInt != PTHREAD_BARRIER_SERIAL_THREAD) && (reInt != 0)) {
ADD_FAILURE();
}
pthread_cancel(tid);
pthread_cancel(tid1);
pthread_join(tid, nullptr);
pthread_join(tid1, nullptr);
EXPECT_EQ(pthread_barrier_destroy(&barrier), 0) << "> return errno";
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册