/** * @file test/event.c Baresip selftest -- event handling * * Copyright (C) 2010 Creytiv.com */ #include #include #include #include "test.h" int test_event(void) { struct odict *od = NULL; size_t i; int err = 0; static const enum ua_event eventv[] = { UA_EVENT_REGISTERING, UA_EVENT_REGISTER_OK, UA_EVENT_REGISTER_FAIL, UA_EVENT_UNREGISTERING, UA_EVENT_SHUTDOWN, UA_EVENT_EXIT /* .. more events .. */ }; for (i=0; i= 2); /* verify the mandatory entries */ entry = odict_lookup(od, "type"); ASSERT_TRUE(entry != NULL); ASSERT_EQ(ODICT_STRING, entry->type); ASSERT_STREQ(uag_event_str(ev), entry->u.str); od = mem_deref(od); } out: mem_deref(od); return err; }