RDK Documentation (Open Sourced RDK Components)
testHost.cpp
1 /*
2  * If not stated otherwise in this file or this component's Licenses.txt file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2016 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 
20 // TODO: Include your class to test here.
21 
22 
23 /**
24 * @defgroup devicesettings
25 * @{
26 * @defgroup test
27 * @{
28 **/
29 
30 
31 #define BOOST_TEST_MODULE Host
32 #define BOOST_TEST_MAIN
33 #include "boost/test/included/unit_test.hpp"
34 #include <iostream>
35 
36 #include "videoOutputPort.hpp"
37 #include "host.hpp"
38 #include "videoOutputPortConfig.hpp"
39 #include "videoResolution.hpp"
40 #include "audioOutputPort.hpp"
41 #include "audioEncoding.hpp"
42 #include "audioCompression.hpp"
43 #include "audioStereoMode.hpp"
44 #include "audioOutputPortType.hpp"
45 #include "videoOutputPort.hpp"
46 
47 
48 #include "dsUtl.h"
49 #include "dsError.h"
50 #include "dsVideoPort.h"
51 
52 #undef _DS_VIDEOOUTPUTPORTSETTINGS_H
53 #include "dsVideoPortSettings.h"
54 #undef _DS_VIDEORESOLUTIONSETTINGS_H
55 #include "dsVideoResolutionSettings.h"
56 
57 BOOST_AUTO_TEST_CASE(test_Host)
58 {
59  try {
60  //BOOST_CHECK(device::Host::getInstance() is instance of hostImpl);
62  BOOST_CHECK(aPorts.size() != 0);
63 
64 
65  /* Exact Host Module */
66  {
67  class power: public device::PowerModeChangeListener
68  {
69  public:
70  void powerModeChanged(int newMode)
71  {
72  return;
73  }
74  };
75 
77  {
78  public:
79  void displayConnectionChanged(device::VideoOutputPort &port, int newConnectionStatus)
80  {
81  return;
82  }
83  };
84 
88 
89  power p;
90  disp d;
95  }
96  }
97  catch(...) {
98  BOOST_CHECK(0);
99  }
100 }
101 
102 BOOST_AUTO_TEST_CASE(testDummy)
103 {
104  BOOST_CHECK(1 == 1);
105 }
106 
107 
108 /** @} */
109 /** @} */
device::Host::addDisplayConnectionListener
void addDisplayConnectionListener(DisplayConnectionChangeListener *l)
This API is used to register listeners for Display connection change event. The listener will be noti...
Definition: host.cpp:174
device::VideoOutputPort
Class extending enumerable to implement the videoooutputport interface.
Definition: videoOutputPort.hpp:59
dsVideoPort.h
device::Host::getAudioOutputPorts
List< AudioOutputPort > getAudioOutputPorts()
This API is used to get the list of the audio output ports supported on the device....
Definition: host.cpp:309
dsError.h
Device Settings HAL error codes.
device::List::size
size_t size()
This function gets the size of the container.
Definition: list.hpp:118
dsUtl.h
Device Settings HAL utilities.
audioStereoMode.hpp
This file defines AudioStereoMode class for managing audio mode types.
videoResolution.hpp
It contains class and structure refrenced by the videoResolution.cpp file.
device::Host::addPowerModeListener
void addPowerModeListener(PowerModeChangeListener *l)
This API is used to register listeners for Power Mode change event. The listener object is created by...
Definition: host.cpp:116
device::PowerModeChangeListener
Definition: powerModeChangeListener.hpp:36
device::DisplayConnectionChangeListener
Definition: displayConnectionChangeListener.hpp:38
videoOutputPort.hpp
It contains class and structure refrenced by the videooutputport.cpp file.
device::Host::removeDisplayConnectionListener
void removeDisplayConnectionListener(DisplayConnectionChangeListener *l)
This API is used to remove listeners from the Display connection change event list.
Definition: host.cpp:200
device::Host::getInstance
static Host & getInstance(void)
This API is used to get a reference to the single instance of the Host object.
Definition: host.cpp:88
device::List< device::AudioOutputPort >
audioOutputPortType.hpp
It contain variables,stuctures,class and functions referenced by audiooutputportType code.
audioOutputPort.hpp
It contain variables,stuctures,class and functions referenced by audiooutputport code.
device::Host::setPowerMode
bool setPowerMode(int mode)
This API is used to change the power mode of the device. This function will set the power mode to act...
Definition: host.cpp:256
device::Host::getPowerMode
int getPowerMode()
This API is used to get the current power mode of the device. This function is currently not supporte...
Definition: host.cpp:269
audioCompression.hpp
This file defines AudioCompression class for managing audio compression levels.
device::Host::removePowerModeChangeListener
void removePowerModeChangeListener(PowerModeChangeListener *l)
This API is used to remove a listener from Power Mode change listener list.
Definition: host.cpp:142
audioEncoding.hpp
This file defines AudioEncoding class for managing audio encoding types.