Changeset 112:4756cdcbb205 in finroc_plugins_data_ports
- Timestamp:
- 17.05.2017 20:28:17 (7 years ago)
- Branch:
- 14.08
- Children:
- 113:938e71ac0af4, 116:a842f5afb76b
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/test_collection.cpp
r68 r112 44 44 #include "plugins/data_ports/tProxyPort.h" 45 45 #include "plugins/data_ports/tThreadLocalBufferManagement.h" 46 #include "plugins/data_ports/tPortPack.h" 46 47 47 48 //---------------------------------------------------------------------- … … 242 243 RRLIB_UNIT_TESTS_BEGIN_SUITE(DataPortsTestCollection); 243 244 RRLIB_UNIT_TESTS_ADD_TEST(Test); 245 RRLIB_UNIT_TESTS_ADD_TEST(PortPack); 244 246 RRLIB_UNIT_TESTS_END_SUITE; 245 247 … … 257 259 TestPortListeners<int>(1); 258 260 } 261 262 void PortPack() 263 { 264 auto parent = new core::tFrameworkElement(&core::tRuntimeEnvironment::GetInstance(), "TestPortPack"); 265 266 using tTypeList = rrlib::util::tTypeList<int, double, std::string, bool>; 267 data_ports::tPortPack<tInputPort, tTypeList> ports(parent, "X"); 268 269 RRLIB_UNIT_TESTS_EQUALITY(tTypeList::cSIZE, ports.NumberOfPorts()); 270 271 for (size_t i = 0; i < tTypeList::cSIZE; ++i) 272 { 273 RRLIB_UNIT_TESTS_EQUALITY("X" + std::to_string(i + 1), ports.GetPort(i).GetName()); 274 } 275 276 std::array<std::string, tTypeList::cSIZE> names {"foo", "bar", "baz", "fnord"}; 277 data_ports::tPortPack<tInputPort, tTypeList> named_ports(parent, names.begin(), names.end()); 278 279 for (size_t i = 0; i < tTypeList::cSIZE; ++i) 280 { 281 RRLIB_UNIT_TESTS_EQUALITY(names[i], named_ports.GetPort(i).GetName()); 282 } 283 } 259 284 }; 260 285
Note: See TracChangeset
for help on using the changeset viewer.