diff --git a/test/call.c b/test/call.c index eaca525f8c..2c3c135526 100644 --- a/test/call.c +++ b/test/call.c @@ -275,6 +275,18 @@ static void cancel_rule_reset(struct cancel_rule *cr) } +static void cancel_rules_reset(struct fixture *f) +{ + struct le *le; + + LIST_FOREACH(&f->rules, le) { + struct cancel_rule *cr = le->data; + + cancel_rule_reset(cr); + } +} + + #define cancel_rule_new(ev, ua, n_incoming, n_progress, n_established) \ cr = fixture_add_cancel_rule(f, ev, ua, n_incoming, n_progress, \ n_established); \ @@ -310,6 +322,8 @@ static bool check_rule(struct cancel_rule *rule, int met_prev, if (rule->cr_and) { met_next = check_rule(rule->cr_and, rule->met && met_prev, ag, ev, prm); + if (rule->met && met_prev && met_next) + return true; } if (rule->met) @@ -398,8 +412,9 @@ static bool check_rule(struct cancel_rule *rule, int met_prev, out: if (met_prev && met_next) { + info("canceled by %H", cancel_rule_debug, rule); re_cancel(); - cancel_rule_reset(rule); + cancel_rules_reset(ag->fix); } return met_next;