diff options
author | Dave Jones <davej@redhat.com> | 2012-12-17 19:04:52 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-17 20:15:27 -0500 |
commit | 2bf1cbf1c616b4dd85a3a8a715af9c5701c16a91 (patch) | |
tree | d42dd56db8607b3a35cd8727c7f6838753c0a262 /tools | |
parent | 5a55f8bb2d0c4e5c05837b688ed1b2132a0ed0e7 (diff) |
tools/testing/selftests/kcmp/kcmp_test.c: print reason for failure in kcmp_test
I was curious why sys_kcmp wasn't working, which led me to the testcase.
It turned out I hadn't enabled CHECKPOINT_RESTORE in the kernel I was
testing. Add a decoding of errno to the testcase to make that obvious.
Signed-off-by: Dave Jones <davej@redhat.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/kcmp/kcmp_test.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/testing/selftests/kcmp/kcmp_test.c b/tools/testing/selftests/kcmp/kcmp_test.c index 358cc6bfa35d..fa4f1b37e045 100644 --- a/tools/testing/selftests/kcmp/kcmp_test.c +++ b/tools/testing/selftests/kcmp/kcmp_test.c | |||
@@ -72,7 +72,8 @@ int main(int argc, char **argv) | |||
72 | /* This one should return same fd */ | 72 | /* This one should return same fd */ |
73 | ret = sys_kcmp(pid1, pid2, KCMP_FILE, fd1, fd1); | 73 | ret = sys_kcmp(pid1, pid2, KCMP_FILE, fd1, fd1); |
74 | if (ret) { | 74 | if (ret) { |
75 | printf("FAIL: 0 expected but %d returned\n", ret); | 75 | printf("FAIL: 0 expected but %d returned (%s)\n", |
76 | ret, strerror(errno)); | ||
76 | ret = -1; | 77 | ret = -1; |
77 | } else | 78 | } else |
78 | printf("PASS: 0 returned as expected\n"); | 79 | printf("PASS: 0 returned as expected\n"); |
@@ -80,7 +81,8 @@ int main(int argc, char **argv) | |||
80 | /* Compare with self */ | 81 | /* Compare with self */ |
81 | ret = sys_kcmp(pid1, pid1, KCMP_VM, 0, 0); | 82 | ret = sys_kcmp(pid1, pid1, KCMP_VM, 0, 0); |
82 | if (ret) { | 83 | if (ret) { |
83 | printf("FAIL: 0 expected but %li returned\n", ret); | 84 | printf("FAIL: 0 expected but %li returned (%s)\n", |
85 | ret, strerror(errno)); | ||
84 | ret = -1; | 86 | ret = -1; |
85 | } else | 87 | } else |
86 | printf("PASS: 0 returned as expected\n"); | 88 | printf("PASS: 0 returned as expected\n"); |