Skip to content

Commit

Permalink
test: bevent - remove test for deprecated functions
Browse files Browse the repository at this point in the history
  • Loading branch information
cspiel1 committed Oct 17, 2024
1 parent 2de77f7 commit 8606f04
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions test/bevent.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

struct fixture {
int cnt;
int cntold;

enum ua_event expected_event;
};
Expand Down Expand Up @@ -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;
Expand All @@ -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");
Expand All @@ -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;
}

0 comments on commit 8606f04

Please sign in to comment.