Reduced noise in event tests when a handler that should have run did not run.

This commit is contained in:
Pietro Gagliardi 2019-05-18 22:21:23 -04:00
parent 3b1f5e0e54
commit 973696137f
1 changed files with 8 additions and 6 deletions

View File

@ -20,12 +20,14 @@ static void handler(void *sender, void *args, void *data)
#define checkHandlerRun(h, whichSender, whichArgs) \ #define checkHandlerRun(h, whichSender, whichArgs) \
if (!h.run) \ if (!h.run) \
testingTErrorf(t, "%s not run", h.name); \ testingTErrorf(t, "%s not run", h.name); \
else { \
if (h.sender != whichSender) \ if (h.sender != whichSender) \
diff_2str(t, "incorrect sender seen by", h.name, \ diff_2str(t, "incorrect sender seen by", h.name, \
"%p", h.sender, whichSender); \ "%p", h.sender, whichSender); \
if (h.args != whichArgs) \ if (h.args != whichArgs) \
diff_2str(t, "incorrect args seen by", h.name, \ diff_2str(t, "incorrect args seen by", h.name, \
"%p", h.args, whichArgs); "%p", h.args, whichArgs); \
}
#define checkHandlerNotRun(h) \ #define checkHandlerNotRun(h) \
if (h.run) \ if (h.run) \