Commit 03ded311 authored by Pekka Pessi's avatar Pekka Pessi

test_nua.c: added --print-tags and --tags-a, --tags

Added more functions for handling events

darcs-hash:20070601192033-65a35-3b2d95b227567bb71dcaf2a3fe92abbd2333adb4.gz
parent 3e82fc52
......@@ -211,6 +211,18 @@ int main(int argc, char *argv[])
else if (strcmp(argv[i], "--loop") == 0) {
o_alarm = 0, o_loop = 1;
}
else if (strcmp(argv[i], "--print-tags") == 0) {
ctx->print_tags = 1;
}
else if (strcmp(argv[i], "--tags=a") == 0) {
ctx->a.print_tags = 1;
}
else if (strcmp(argv[i], "--tags=b") == 0) {
ctx->b.print_tags = 1;
}
else if (strcmp(argv[i], "--tags=c") == 0) {
ctx->c.print_tags = 1;
}
else if (strcmp(argv[i], "--log=a") == 0) {
ctx->a.logging = 1;
}
......@@ -317,8 +329,8 @@ int main(int argc, char *argv[])
retval |= test_rejects(ctx); SINGLE_FAILURE_CHECK();
retval |= test_call_cancel(ctx); SINGLE_FAILURE_CHECK();
retval |= test_call_destroy(ctx); SINGLE_FAILURE_CHECK();
retval |= test_offer_answer(ctx); SINGLE_FAILURE_CHECK();
retval |= test_early_bye(ctx); SINGLE_FAILURE_CHECK();
retval |= test_offer_answer(ctx); SINGLE_FAILURE_CHECK();
retval |= test_reinvites(ctx); SINGLE_FAILURE_CHECK();
retval |= test_session_timer(ctx); SINGLE_FAILURE_CHECK();
retval |= test_refer(ctx); SINGLE_FAILURE_CHECK();
......
......@@ -124,6 +124,7 @@ struct context
su_root_t *root;
int threading, proxy_tests, expensive, quit_on_single_failure, osx_runloop;
int print_tags;
char const *external_proxy;
int proxy_logging;
......@@ -133,6 +134,7 @@ struct context
struct context *ctx; /* Backpointer */
int logging;
int print_tags;
int running;
......@@ -196,6 +198,9 @@ void free_event_in_list(struct context *ctx,
struct eventlist *list,
struct event *e);
struct event *event_by_type(struct event *e, nua_event_t);
size_t count_events(struct event const *e);
#define CONDITION_PARAMS \
nua_event_t event, \
int status, char const *phrase, \
......
......@@ -190,7 +190,8 @@ void print_event(nua_event_t event,
ep->name, (void *)nh, operation);
}
if ((tstflags & tst_verbatim) && tags)
if (tags &&
((tstflags & tst_verbatim) || ctx->print_tags || ep->print_tags))
tl_print(stderr, "", tags);
}
......@@ -499,6 +500,27 @@ void free_event_in_list(struct context *ctx,
}
}
struct event *event_by_type(struct event *e, nua_event_t etype)
{
for (; e; e = e->next) {
if (e->data->e_event == etype)
break;
}
return e;
}
size_t count_events(struct event const *e)
{
size_t n;
for (n = 0; e; e = e->next)
n++;
return n;
}
int is_special(nua_event_t e)
{
if (e == nua_i_active || e == nua_i_terminated)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment