MCPcopy Create free account
hub / github.com/cisco/openh264 / TEST

Function TEST

test/common/WelsThreadPoolTest.cpp:46–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44
45
46TEST (CThreadPoolTest, CThreadPoolTest) {
47 OneCallingFunc(NULL);
48
49 int iRet = CWelsThreadPool::SetThreadNum (8);
50 EXPECT_EQ (0, iRet);
51 EXPECT_FALSE (CWelsThreadPool::IsReferenced());
52
53 CWelsThreadPool* pThreadPool = (CWelsThreadPool::AddReference());
54 ASSERT_TRUE (pThreadPool != NULL);
55
56 EXPECT_TRUE (pThreadPool->IsReferenced());
57
58 EXPECT_EQ (8, pThreadPool->GetThreadNum());
59
60 iRet = CWelsThreadPool::SetThreadNum (4);
61 EXPECT_TRUE (0 != iRet);
62 EXPECT_EQ (8, pThreadPool->GetThreadNum());
63
64 pThreadPool->RemoveInstance();
65
66 iRet = CWelsThreadPool::SetThreadNum (4);
67 EXPECT_EQ (0, iRet);
68
69 pThreadPool = (CWelsThreadPool::AddReference());
70 EXPECT_TRUE (pThreadPool->IsReferenced());
71 EXPECT_EQ (4, pThreadPool->GetThreadNum());
72 pThreadPool->RemoveInstance();
73
74 EXPECT_FALSE (CWelsThreadPool::IsReferenced());
75}
76
77
78TEST (CThreadPoolTest, CThreadPoolTestMulti) {

Callers

nothing calls this directly

Calls 7

OneCallingFuncFunction · 0.85
WelsThreadCreateFunction · 0.85
WelsSleepFunction · 0.85
WelsThreadJoinFunction · 0.85
IsReferencedMethod · 0.80
GetThreadNumMethod · 0.80
RemoveInstanceMethod · 0.80

Tested by

no test coverage detected