selftests/nolibc: mmap_munmap_good: fix up return value
Subsystems (2)
PATCH 1/1 selftests/nolibc: mmap_munmap_good: fix up return value
The other tests use 1 as failure, mmap_munmap_good uses -1 as failure, let's fix up this.
Signed-off-by Zhangjin Wu <[email protected]>
---
Willy, if it is ok for you, please merge this one to our old queued commit:
commit 6b3e54d01905 ("selftests/nolibc: add mmap_munmap_good test case")
--- tools/testing/selftests/nolibc/nolibc-test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
tools/testing/selftests/nolibc/nolibc-test.c +4 -4
@@ -725,7 +725,7 @@ int test_mmap_munmap(void) page_size =getpagesize ();if (page_size <0 ) -return -1 ; +return 1 ;/* find a right file to mmap, existed and accessible */ for (i =0 ; files[i] !=NULL ; i++) {
@@ -736,7 +736,7 @@ int test_mmap_munmap(void)break ; }if (ret ==-1 ) -return ret; +return 1 ; ret =stat (files[i], &stat_buf);if (ret ==-1 )
@@ -756,7 +756,7 @@ int test_mmap_munmap(void) mem =mmap (NULL , length + offset - pa_offset,PROT_READ ,MAP_SHARED , fd, pa_offset);if (mem ==MAP_FAILED ) { - ret =-1 ; + ret =1 ; goto end; }
@@ -764,7 +764,7 @@ int test_mmap_munmap(void) end:close (fd); -return ret; +return !!ret; }
Signature · 1 line
2.25.1
Quoted 4 lines · Zhangjin Wu
The other tests use 1 as failure,
mmap_munmap_gooduses -1 as failure, let's fix up this.Signed-off-by Zhangjin Wu <[email protected]>
Reviewed-by Thomas Weißschuh <[email protected]>
Quoted 9 lines
---
Willy, if it is ok for you, please merge this one to our old queued commit:
commit
6b3e54d01905("selftests/nolibc: addmmap_munmap_goodtest case")--- tools/testing/selftests/nolibc/nolibc-test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Quoted 7 lines · Thomas Weißschuh
Quoted 4 lines · Zhangjin Wu
The other tests use 1 as failure,
mmap_munmap_gooduses -1 as failure, let's fix up this.Signed-off-by Zhangjin Wu <[email protected]>Reviewed-by Thomas Weißschuh <[email protected]>
Applied, thanks to you both.
Willy