tests: Use proper functions types instead of void (*fn)