31 #define BOOST_TEST_MODULE rpVOP
32 #define BOOST_TEST_MAIN
33 #include "boost/test/included/unit_test.hpp"
37 #include "videoOutputPortConfig.hpp"
38 #include "audioOutputPortConfig.hpp"
45 #include "illegalArgumentException.hpp"
47 #include "exception.hpp"
50 #undef _DS_VIDEOOUTPUTPORTSETTINGS_H
51 #include "dsVideoPortSettings.h"
52 #undef _DS_VIDEORESOLUTIONSETTINGS_H
53 #include "dsVideoResolutionSettings.h"
55 BOOST_AUTO_TEST_CASE(test_VideoOutputPortConfig_load)
60 device::AudioOutputPortConfig::getInstance().load();
64 BOOST_CHECK(vTypes.
size() == 0);
67 vTypes = vConfig.getSupportedTypes();
70 for (
size_t i = 0; i < rpVOP_PIXELRES_MAX; i++) {
71 BOOST_CHECK(device::VideoOutputPortConfig::getInstance().getPixelResolution(i).getId() == i);
72 BOOST_CHECK(!device::VideoOutputPortConfig::getInstance().getPixelResolution(i).getName().empty());
75 for (
size_t i = 0; i < rpVOP_ASPECT_MAX; i++) {
76 BOOST_CHECK(device::VideoOutputPortConfig::getInstance().getAspectRatio(i).getId() == i);
77 BOOST_CHECK(!device::VideoOutputPortConfig::getInstance().getAspectRatio(i).getName().empty());
81 for (
size_t i = 0; i < rpVOP_SSMODE_MAX; i++) {
82 BOOST_CHECK(device::VideoOutputPortConfig::getInstance().getSSMode(i).getId() == i);
83 BOOST_CHECK(!device::VideoOutputPortConfig::getInstance().getPortType(i).getName().empty());
87 for (
size_t i = 0; i < rpVOP_FRAMERATE_MAX; i++) {
88 BOOST_CHECK(device::VideoOutputPortConfig::getInstance().getFrameRate(i).getId() == i);
89 BOOST_CHECK(!device::VideoOutputPortConfig::getInstance().getFrameRate(i).getName().empty());
90 BOOST_CHECK(device::VideoOutputPortConfig::getInstance().getFrameRate(i).getId() == device::FrameRate::getInstance(i).getId());
93 BOOST_CHECK(device::VideoOutputPortConfig::getInstance().getPorts().size() ==
dsUTL_DIM(kPorts));
95 for (
size_t i = 0; i <
dsUTL_DIM(kPorts); i++) {
96 BOOST_CHECK(device::VideoOutputPortConfig::getInstance().getPort(i).getId() == i);
100 vTypes = vConfig.getSupportedTypes();
102 BOOST_CHECK(vTypes.
size() ==
dsUTL_DIM(kSupportedPortTypes));
104 for (
size_t i = 0; i < vTypes.
size(); i++) {
108 for (
size_t j = 0; j <
dsUTL_DIM(kConfigs); j++) {
109 if (vTypes.at(i).
getId() == kConfigs[i].typeId) {
110 BOOST_CHECK(std::string(vTypes.at(i).
getName()).compare(kConfigs[i].name) == 0);
111 BOOST_CHECK(vTypes.at(i).
isHDCPSupported() == kConfigs[i].hdcpSupported);
113 BOOST_CHECK(vTypes.at(i).
isDTCPSupported() == kConfigs[i].dtcpSupported);
122 for (
size_t j = 0; j < vTypes.at(i).getSupportedResolutions().size(); j++) {
123 BOOST_CHECK(std::string(vTypes.at(i).
getSupportedResolutions().at(j).getName()).compare(std::string(kResolutions[j].name)) == 0);
125 BOOST_CHECK(vTypes.at(i).
getSupportedResolutions().at(j).getPixelResolution() == kResolutions[j].pixelResolution);
129 BOOST_CHECK(vTypes.at(i).
getSupportedResolutions().at(j).getStereoscopicMode() == kResolutions[j].stereoScopicMode);
139 BOOST_CHECK(vConfig.getPorts().size() ==
dsUTL_DIM(kPorts));
142 for (
size_t i = 0; i < vPortTypes.
size(); i++) {
144 for (
size_t j = 0; j < vPortTypes.at(i).getPorts().size(); j++) {
148 for (
size_t k = 0; k <
dsUTL_DIM(kPorts); k++) {
149 if (vPortTypes.at(i).
getId() == kPorts[k].id.type && vPortTypes.at(i).
getPorts().at(j).getIndex() == kPorts[k].id.index) {
150 BOOST_CHECK(vPortTypes.at(i).
getPorts().at(j).getType().getId() == kPorts[k].id.type);
151 BOOST_CHECK(std::string(vPortTypes.at(i).
getPorts().at(j).getResolution().getName()).compare(std::string(kPorts[k].defaultResolution)) == 0);
187 BOOST_AUTO_TEST_CASE(testDummy)