Skip to content

Commit cd027c4

Browse files
committed
AVInput COM-RPC Support: WIP
1 parent d86bc30 commit cd027c4

File tree

1 file changed

+43
-81
lines changed

1 file changed

+43
-81
lines changed

Tests/L1Tests/tests/test_AVInput.cpp

Lines changed: 43 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -53,25 +53,19 @@ class AVInputTest : public ::testing::Test {
5353

5454
Core::ProxyType<Plugin::AVInput> plugin;
5555
Core::ProxyType<Plugin::AVInputImplementation> AVInputImpl;
56-
// <pca> debug
57-
//Core::ProxyType<WorkerPoolImplementation> workerPool;
58-
// </pca>
56+
Core::ProxyType<WorkerPoolImplementation> workerPool;
5957

6058
NiceMock<COMLinkMock> comLinkMock;
6159
NiceMock<ServiceMock> service;
62-
// <pca>
63-
//NiceMock<FactoriesImplementation> factoriesImplementation;
64-
// </pca>
60+
NiceMock<FactoriesImplementation> factoriesImplementation;
6561

6662
WrapsImplMock* p_wrapsImplMock = nullptr;
6763
ServiceMock* p_serviceMock = nullptr;
6864
AVInputMock* p_avInputMock = nullptr;
6965
HdmiInputImplMock* p_hdmiInputImplMock = nullptr;
7066
CompositeInputImplMock* p_compositeInputImplMock = nullptr;
7167
HostImplMock* p_HostImplMock = nullptr;
72-
// <pca> debug
73-
//IarmBusImplMock* p_iarmBusImplMock = nullptr;
74-
// </pca>
68+
IarmBusImplMock* p_iarmBusImplMock = nullptr;
7569

7670
Exchange::IAVInput::IDevicesChangedNotification *OnDevicesChangedNotification = nullptr;
7771
Exchange::IAVInput::ISignalChangedNotification *OnSignalChangedNotification = nullptr;
@@ -87,19 +81,12 @@ class AVInputTest : public ::testing::Test {
8781
IARM_EventHandler_t dsAVVideoModeEventHandler;
8882
IARM_EventHandler_t dsAviContentTypeEventHandler;
8983

90-
// <pca> debug
91-
// AVInputTest()
92-
// : plugin(Core::ProxyType<Plugin::AVInput>::Create())
93-
// , handler(*(plugin))
94-
// , INIT_CONX(1, 0) , workerPool(Core::ProxyType<WorkerPoolImplementation>::Create(
95-
// 2, Core::Thread::DefaultStackSize(), 16))
96-
// {
9784
AVInputTest()
9885
: plugin(Core::ProxyType<Plugin::AVInput>::Create())
9986
, handler(*(plugin))
100-
, INIT_CONX(1, 0)
87+
, INIT_CONX(1, 0) , workerPool(Core::ProxyType<WorkerPoolImplementation>::Create(
88+
2, Core::Thread::DefaultStackSize(), 16))
10189
{
102-
// </pca>
10390
printf("*** _DEBUG: AVInputTest ctor: entry");
10491

10592
p_serviceMock = new NiceMock <ServiceMock>;
@@ -108,18 +95,11 @@ class AVInputTest : public ::testing::Test {
10895

10996
Wraps::setImpl(p_wrapsImplMock);
11097

111-
// <pca> debug
112-
//PluginHost::IFactories::Assign(&factoriesImplementation);
113-
// </pca>
98+
PluginHost::IFactories::Assign(&factoriesImplementation);
11499

115-
// <pca> debug
116-
// dispatcher = static_cast<PLUGINHOST_DISPATCHER*>(plugin->QueryInterface(PLUGINHOST_DISPATCHER_ID));
117-
// dispatcher->Activate(&service);
118-
// </pca>
100+
dispatcher = static_cast<PLUGINHOST_DISPATCHER*>(plugin->QueryInterface(PLUGINHOST_DISPATCHER_ID));
101+
dispatcher->Activate(&service);
119102

120-
// <pca> debug
121-
#if 0
122-
// </pca>
123103
ON_CALL(*p_avInputMock, Register(::testing::Matcher<Exchange::IAVInput::IDevicesChangedNotification*>(::testing::_)))
124104
.WillByDefault(::testing::Invoke(
125105
[&](Exchange::IAVInput::IDevicesChangedNotification *notification){
@@ -174,13 +154,6 @@ class AVInputTest : public ::testing::Test {
174154
.WillByDefault(::testing::Return(AVInputImpl));
175155
#endif
176156

177-
// <pca> debug
178-
#endif
179-
// </pca>
180-
181-
// <pca>
182-
#if 0
183-
// </pca>
184157
p_iarmBusImplMock = new NiceMock<IarmBusImplMock>;
185158
IarmBus::setImpl(p_iarmBusImplMock);
186159

@@ -233,14 +206,9 @@ class AVInputTest : public ::testing::Test {
233206
}
234207
return IARM_RESULT_SUCCESS;
235208
}));
236-
// <pca>
237-
#endif
238-
// </pca>
239209

240-
// <pca> debug
241-
// Core::IWorkerPool::Assign(&(*workerPool));
242-
// workerPool->Run();
243-
// </pca>
210+
Core::IWorkerPool::Assign(&(*workerPool));
211+
workerPool->Run();
244212

245213
plugin->Initialize(&service);
246214

@@ -259,10 +227,8 @@ class AVInputTest : public ::testing::Test {
259227
TEST_LOG("*** _DEBUG: AVInputTest xtor");
260228
plugin->Deinitialize(&service);
261229

262-
// <pca> debug
263-
// Core::IWorkerPool::Assign(nullptr);
264-
// workerPool.Release();
265-
// </pca>
230+
Core::IWorkerPool::Assign(nullptr);
231+
workerPool.Release();
266232

267233
if (p_serviceMock != nullptr)
268234
{
@@ -302,20 +268,16 @@ class AVInputTest : public ::testing::Test {
302268
p_HostImplMock = nullptr;
303269
}
304270

305-
// <pca> debug
306-
// dispatcher->Deactivate();
307-
// dispatcher->Release();
308-
// </pca>
271+
dispatcher->Deactivate();
272+
dispatcher->Release();
309273

310274
PluginHost::IFactories::Assign(nullptr);
311275

312-
// <pca> debug
313-
// IarmBus::setImpl(nullptr);
314-
// if (p_iarmBusImplMock != nullptr) {
315-
// delete p_iarmBusImplMock;
316-
// p_iarmBusImplMock = nullptr;
317-
// }
318-
// </pca>
276+
IarmBus::setImpl(nullptr);
277+
if (p_iarmBusImplMock != nullptr) {
278+
delete p_iarmBusImplMock;
279+
p_iarmBusImplMock = nullptr;
280+
}
319281
}
320282
};
321283

@@ -325,28 +287,28 @@ class AVInputTest : public ::testing::Test {
325287
TEST_F(AVInputTest, RegisteredMethods)
326288
{
327289
printf("*** _DEBUG: TEST_F(AVInputTest, RegisteredMethods): entry");
328-
// EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("numberOfInputs")));
329-
// EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("currentVideoMode")));
330-
// EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("contentProtected")));
331-
// EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("setEdid2AllmSupport")));
332-
// EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("getEdid2AllmSupport")));
333-
// EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("setVRRSupport")));
334-
// EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("getVRRSupport")));
335-
// EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("getVRRFrameRate")));
336-
// EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("getInputDevices")));
337-
// EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("writeEDID")));
338-
// EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("readEDID")));
339-
// EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("getRawSPD")));
340-
// EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("getSPD")));
341-
// EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("setEdidVersion")));
342-
// EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("getEdidVersion")));
343-
// EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("getHdmiVersion")));
344-
// EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("setMixerLevels")));
345-
// EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("startInput")));
346-
// EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("stopInput")));
347-
// EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("setVideoRectangle")));
348-
// EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("getSupportedGameFeatures")));
349-
// EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("getGameFeatureStatus")));
290+
EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("numberOfInputs")));
291+
EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("currentVideoMode")));
292+
EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("contentProtected")));
293+
EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("setEdid2AllmSupport")));
294+
EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("getEdid2AllmSupport")));
295+
EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("setVRRSupport")));
296+
EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("getVRRSupport")));
297+
EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("getVRRFrameRate")));
298+
EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("getInputDevices")));
299+
EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("writeEDID")));
300+
EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("readEDID")));
301+
EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("getRawSPD")));
302+
EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("getSPD")));
303+
EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("setEdidVersion")));
304+
EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("getEdidVersion")));
305+
EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("getHdmiVersion")));
306+
EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("setMixerLevels")));
307+
EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("startInput")));
308+
EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("stopInput")));
309+
EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("setVideoRectangle")));
310+
EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("getSupportedGameFeatures")));
311+
EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("getGameFeatureStatus")));
350312
}
351313

352314
TEST_F(AVInputTest, contentProtected)
@@ -362,7 +324,7 @@ TEST_F(AVInputTest, contentProtected)
362324
// </pca>
363325

364326
// <pca> debug
365-
#if 0
327+
#if 1
366328
// </pca>
367329
TEST_F(AVInputTest, numberOfInputs)
368330
{
@@ -426,7 +388,7 @@ TEST_F(AVInputTest, getVRRFrameRate)
426388
// </pca>
427389

428390
// <pca> debug
429-
#if 0
391+
#if 1
430392
// </pca>
431393
TEST_F(AVInputTest, getInputDevices)
432394
{

0 commit comments

Comments
 (0)