diff --git a/test/bevent.c b/test/bevent.c index d98dfcff2..e1eeb403d 100644 --- a/test/bevent.c +++ b/test/bevent.c @@ -11,7 +11,6 @@ struct fixture { int cnt; - int cntold; enum ua_event expected_event; }; @@ -98,27 +97,6 @@ static void event_handler(enum ua_event ev, struct bevent *event, void *arg) } -static void ua_event_handler(struct ua *ua, enum ua_event ev, - struct call *call, const char *prm, void *arg) -{ - struct fixture *f = arg; - - if (ua == (void *) 0xdeadbeef && !call) - ++f->cntold; - else if (ev == UA_EVENT_CALL_INCOMING) - ++f->cntold; - else if (ev == UA_EVENT_SIPSESS_CONN) - ++f->cntold; - else if (ev == UA_EVENT_EXIT && !str_cmp(prm, "details")) - ++f->cntold; - else if (ev == UA_EVENT_SHUTDOWN && !str_cmp(prm, "details")) - ++f->cntold; - else if (ev == UA_EVENT_MODULE && - !str_cmp(prm, "module,event,details")) - ++f->cntold; -} - - int test_event_register(void) { int err = 0; @@ -129,9 +107,6 @@ int test_event_register(void) err = bevent_register(event_handler, &f); TEST_ERR(err); - err = uag_event_register(ua_event_handler, &f); - TEST_ERR(err); - f.expected_event = UA_EVENT_EXIT; err = bevent_app_emit(UA_EVENT_EXIT, (void *) 0xdeadbeef, "%s", "details"); @@ -156,28 +131,8 @@ int test_event_register(void) TEST_ERR(err); ASSERT_EQ(4, f.cnt); - ASSERT_EQ(4, f.cntold); - - /* test deprecated ua_event() with old and new handlers */ - f.expected_event = UA_EVENT_EXIT; - ua_event(NULL, UA_EVENT_EXIT, NULL, "%s", "details"); - ua_event(NULL, UA_EVENT_SHUTDOWN, NULL, "%s", "details"); - f.expected_event = UA_EVENT_REGISTER_OK; - ua_event((struct ua *) 0xdeadbeef, UA_EVENT_REGISTER_OK, NULL, "%s", - "details"); - f.expected_event = UA_EVENT_CALL_INCOMING; - ua_event(NULL, UA_EVENT_CALL_INCOMING, NULL, NULL); - f.expected_event = UA_EVENT_SIPSESS_CONN; - ua_event(NULL, UA_EVENT_SIPSESS_CONN, NULL, NULL); - f.expected_event = UA_EVENT_MODULE; - module_event("module", "event", NULL, NULL, "%s", "details"); - - ASSERT_EQ(9, f.cnt); - /* event error not supported with deprecated ua_event() */ - ASSERT_EQ(10, f.cntold); out: bevent_unregister(event_handler); - uag_event_unregister(ua_event_handler); return err; }