tests: Simplify the tests with macros

Signed-off-by: Gergely Nagy <algernon@balabit.hu>