void assertHasAdcEvent() { EventType *adcEventType = AdcEventType_get(); Event *event = EventSource_poll(_eventSource); CHECK( event != NULL); POINTERS_EQUAL(adcEventType, Event_getEventType(event)); }
static void BasicAdcService_start(AdcService *baseSelf) { BasicAdcService *self = (BasicAdcService *)baseSelf; EventListener *adcListener = AdcServiceAdcListener_asEventListener(&self->adcListener); EventManager_addListener( self->eventManager, AdcEventType_get(), adcListener); }
void assertHasAdcEventWithSample(int channelId, uint16_t value) { EventType *adcEventType = AdcEventType_get(); Event *event = EventSource_poll(_eventSource); CHECK( event != NULL); POINTERS_EQUAL(adcEventType, Event_getEventType(event)); AdcEvent *adcEvent = AdcEvent_fromEvent(event); AdcSample *sample = AdcEvent_getSample(adcEvent); CHECK_EQUAL(channelId, AdcSample_getChannelId(sample)); CHECK_EQUAL(value, AdcSample_getValue(sample)) }