Inspired by the previous bug, build something we can use to write damage testcases, including testing for the bug. Signed-off-by: Eric Anholt <eric@anholt.net>