Added tests for the new flag handling.

Signed-off-by: Florian Bergmann <fbergmann@suse.de>