From 1d968f7ddde9f8f4bcb5ff3291f28e15d47a0ccf Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 24 Aug 2017 17:25:40 +0200 Subject: [PATCH] feat(Event): add assert on type when Call or Conference event are created --- src/event/call-event.cpp | 1 + src/event/conference-event.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/event/call-event.cpp b/src/event/call-event.cpp index bc17b4e2c..f6eee2b1e 100644 --- a/src/event/call-event.cpp +++ b/src/event/call-event.cpp @@ -36,6 +36,7 @@ public: CallEvent::CallEvent (Type type, const shared_ptr &call) : Event(*new CallEventPrivate, type) { L_D(CallEvent); L_ASSERT(call); + L_ASSERT(type == CallStartEvent || type == CallEndEvent); d->call = call; } diff --git a/src/event/conference-event.cpp b/src/event/conference-event.cpp index 9cd2e9d11..9fb000415 100644 --- a/src/event/conference-event.cpp +++ b/src/event/conference-event.cpp @@ -35,6 +35,7 @@ public: ConferenceEvent::ConferenceEvent (Type type, const shared_ptr
&address) : Event(*new ConferenceEventPrivate, type) { L_D(ConferenceEvent); + L_ASSERT(type == ConferenceCreatedEvent || type == ConferenceDestroyedEvent); L_ASSERT(address); d->address = address; }