test_user_copy: Improve failure output

Improve the test() macro so that values can be printed in the failure
message and so that the result can be compared against specific values.

This helps for debugging, and allows test_user_copy to be more easily
extended to test in loops without the failure output becoming confusing.

We make use of the value comparison to ensure that failing copies return
a specific value (PAGE_SIZE) for the number of bytes that couldn't be

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: linux-kernel@vger.kernel.org
Cc: Kees Cook <keescook@chromium.org>
1 file changed