/** * Check the TOD matches what we expect */ void DmxterWidgetTest::ValidateTod(const ola::rdm::UIDSet &uids) { UID uid1(0x707a, 0xffffff00); UID uid2(0x5252, 0x12345678); CPPUNIT_ASSERT_EQUAL((unsigned int) 2, uids.Size()); CPPUNIT_ASSERT(uids.Contains(uid1)); CPPUNIT_ASSERT(uids.Contains(uid2)); m_tod_counter++; m_ss.Terminate(); }
/** * Check the TOD matches what we expect */ void DmxTriWidgetTest::ValidateTod(const ola::rdm::UIDSet &uids) { if (m_expect_uids_in_tod) { UID uid1(0x707a, 0xffffff00); UID uid2(0x5252, 0x12345678); OLA_ASSERT_EQ((unsigned int) 2, uids.Size()); OLA_ASSERT(uids.Contains(uid1)); OLA_ASSERT(uids.Contains(uid2)); } else { OLA_ASSERT_EQ((unsigned int) 0, uids.Size()); } m_tod_counter++; m_ss.Terminate(); }
/* * Update the UID : port mapping with this new data */ void Universe::NewUIDList(OutputPort *port, const ola::rdm::UIDSet &uids) { map<UID, OutputPort*>::iterator iter = m_output_uids.begin(); while (iter != m_output_uids.end()) { if (iter->second == port && !uids.Contains(iter->first)) m_output_uids.erase(iter++); else ++iter; } ola::rdm::UIDSet::Iterator set_iter = uids.Begin(); for (; set_iter != uids.End(); ++set_iter) { iter = m_output_uids.find(*set_iter); if (iter == m_output_uids.end()) { m_output_uids[*set_iter] = port; } else if (iter->second != port) { OLA_WARN << "UID " << *set_iter << " seen on more than one port"; } } if (m_export_map) (*m_export_map->GetUIntMapVar(K_UNIVERSE_UID_COUNT_VAR))[m_universe_id_str] = m_output_uids.size(); }
/** * Called when the widget returns a new TOD. Check this matches what we expect. */ void ArduinoWidgetTest::ValidateTod(const ola::rdm::UIDSet &uids) { UID uid1(ESTA_ID, SERIAL_NUMBER); OLA_ASSERT_EQ((unsigned int) 1, uids.Size()); OLA_ASSERT(uids.Contains(uid1)); m_tod_counter++; }