remove some of that code duplication in the tests. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>