test: make the peck_dispatch_until_stable() a macro

This way we can insert the line number for easier debugging

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2020-09-22 13:19:41 +10:00
parent c72f27b4c2
commit 4de3380a88
2 changed files with 7 additions and 4 deletions

View file

@ -401,18 +401,18 @@ peck_dispatch_ei(struct peck *peck)
}
void
peck_dispatch_until_stable(struct peck *peck)
_peck_dispatch_until_stable(struct peck *peck, int lineno)
{
bool eis, ei;
log_debug(peck, "dispatching until stable state >>>>>\n");
log_debug(peck, "dispatching until stable state at line %d >>>>>\n", lineno);
do {
eis = peck_dispatch_eis(peck);
ei = peck_dispatch_ei(peck);
} while (ei || eis);
log_debug(peck, "<<<<<\n");
log_debug(peck, "<<<<< stable at %d\n", lineno);
}
void

View file

@ -149,7 +149,10 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(struct peck*, peck_unref);
* pending that are not processed by the current behaviors.
*/
void
peck_dispatch_until_stable(struct peck *peck);
_peck_dispatch_until_stable(struct peck *peck, int lineno);
#define peck_dispatch_until_stable(_p) \
_peck_dispatch_until_stable((_p), __LINE__)
/**
* Discard all pending events.