selftests/powerpc: Fail load_unaligned_zeropad on miscompare
authorMichael Ellerman <mpe@ellerman.id.au>
Tue, 1 Nov 2016 04:01:18 +0000 (15:01 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 14 Nov 2016 00:11:51 +0000 (11:11 +1100)
If the result returned by load_unaligned_zeropad() doesn't match what we
expect we should fail the test!

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
tools/testing/selftests/powerpc/primitives/load_unaligned_zeropad.c

index cf7a4a114a90424175f47e9f65da0df8cb80aff2..cd7af4e1b65a3ce3087649348846f539174b3542 100644 (file)
@@ -118,8 +118,10 @@ static int do_one_test(char *p, int page_offset)
 
        got = load_unaligned_zeropad(p);
 
-       if (should != got)
+       if (should != got) {
                printf("offset %u load_unaligned_zeropad returned 0x%lx, should be 0x%lx\n", page_offset, got, should);
+               return 1;
+       }
 
        return 0;
 }