diff options
author | André Nusser <andre.nusser@googlemail.com> | 2020-02-18 12:02:49 +0100 |
---|---|---|
committer | André Nusser <andre.nusser@googlemail.com> | 2020-02-23 13:46:28 +0100 |
commit | 2261c525f34f6df8ded520c2fa6278c9799d6997 (patch) | |
tree | d130f59aef8192cf2ea7bd71fe7938f8ed257ac3 | |
parent | 7623de94e9566392ad69b2ca31dcf6453f816571 (diff) |
Add part to unit test for EventsDS::get.
-rw-r--r-- | test/eventsdstest.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/eventsdstest.cc b/test/eventsdstest.cc index c884e4f..b9c2f0a 100644 --- a/test/eventsdstest.cc +++ b/test/eventsdstest.cc @@ -77,6 +77,14 @@ public: } DGUNIT_ASSERT(group_concat == "abcd"); + // get + for (auto const& sample_event: events_ds.iterateOver<SampleEvent>(13)) { + DGUNIT_ASSERT(events_ds.get<SampleEvent>(sample_event.id).channel == 13); + Event* event_ptr = events_ds.get(sample_event.id); + DGUNIT_ASSERT(event_ptr->type == Event::Type::SampleEvent); + DGUNIT_ASSERT(static_cast<SampleEvent*>(event_ptr)->channel == 13); + } + // remove auto event_id = events_ds.getEventIDsOf(events_ds.getSampleEventGroupIDsOf(42).back()).back(); events_ds.remove(event_id); |