History

remove sink in WelsThreadPool and hide the construtor to finish the singleTon

sijchen committed 10 years ago

Commit 4db9c321 parent d4f09d97 files · +28 −54Browse files

Showing the changes to test/common/WelsThreadPoolTest.cpp (1 of 7 files). Show all

Unified · Split

test/common/WelsThreadPoolTest.cpp+5−3
@@ -39,7 +39,7 @@ uint32_t CSimpleTask::id = 0; · 38 unmodified lines
39void* OneCallingFunc() {39void* OneCallingFunc() {
40 CThreadPoolTest cThreadPoolTest;40 CThreadPoolTest cThreadPoolTest;
41 CSimpleTask* aTasks[TEST_TASK_NUM];41 CSimpleTask* aTasks[TEST_TASK_NUM];
42 CWelsThreadPool* pThreadPool = & (CWelsThreadPool::AddReference (&cThreadPoolTest));42 CWelsThreadPool* pThreadPool = & (CWelsThreadPool::AddReference());
43 43
44 int32_t i;44 int32_t i;
45 for (i = 0; i < TEST_TASK_NUM; i++) {45 for (i = 0; i < TEST_TASK_NUM; i++) {
@@ -70,8 +70,9 @@ TEST (CThreadPoolTest, CThreadPoolTest) { · 24 unmodified lines
70 EXPECT_EQ (0, iRet);70 EXPECT_EQ (0, iRet);
71 EXPECT_FALSE (CWelsThreadPool::IsReferenced());71 EXPECT_FALSE (CWelsThreadPool::IsReferenced());
72 72
73 CWelsThreadPool* pThreadPool = & (CWelsThreadPool::AddReference (NULL));73 CWelsThreadPool* pThreadPool = & (CWelsThreadPool::AddReference ());
74 EXPECT_TRUE(pThreadPool->IsReferenced());74 EXPECT_TRUE(pThreadPool->IsReferenced());
75
75 EXPECT_EQ (8, pThreadPool->GetThreadNum());76 EXPECT_EQ (8, pThreadPool->GetThreadNum());
76 77
77 iRet = CWelsThreadPool::SetThreadNum (4);78 iRet = CWelsThreadPool::SetThreadNum (4);
@@ -82,7 +83,8 @@ TEST (CThreadPoolTest, CThreadPoolTest) { · 4 unmodified lines
82 83
83 iRet = CWelsThreadPool::SetThreadNum (4);84 iRet = CWelsThreadPool::SetThreadNum (4);
84 EXPECT_EQ (0, iRet);85 EXPECT_EQ (0, iRet);
85 pThreadPool = & (CWelsThreadPool::AddReference (NULL));86
87 pThreadPool = & (CWelsThreadPool::AddReference ());
86 EXPECT_TRUE (pThreadPool->IsReferenced());88 EXPECT_TRUE (pThreadPool->IsReferenced());
87 EXPECT_EQ (4, pThreadPool->GetThreadNum());89 EXPECT_EQ (4, pThreadPool->GetThreadNum());
88 pThreadPool->RemoveInstance();90 pThreadPool->RemoveInstance();

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t