Re-factor tests a little bit.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>