util: add checks before and after each test

This uncovered missing events.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>