test: hexdump: fix misplaced return
PATCH 1/1 test: hexdump: fix misplaced return
One of the hexdump tests in test/lib/hexdump.c returns right at the start of the function without testing anything.
Fix this by moving the 'return 0;' statement to the end of the function.
---
test/lib/hexdump.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
test/lib/hexdump.c +2 -2
@@ -11,8 +11,6 @@static int lib_test_hex_to_bin (struct unit_test_state *uts) { -return 0 ; -ut_asserteq (0x0 ,hex_to_bin ('0' ));ut_asserteq (0x1 ,hex_to_bin ('1' ));ut_asserteq (0x2 ,hex_to_bin ('2' ));
@@ -30,6 +28,8 @@ static int lib_test_hex_to_bin(struct unit_test_state *uts)ut_asserteq (0xe ,hex_to_bin ('e' ));ut_asserteq (0xf ,hex_to_bin ('f' ));ut_asserteq (-1 ,hex_to_bin ('g' )); + +return 0 ; }DM_TEST (lib_test_hex_to_bin,DM_TESTF_SCAN_PDATA |DM_TESTF_SCAN_FDT );
Signature · 1 line
2.17.1
PATCH 1/1 test: hexdump: fix misplaced return
Quoted 11 lines · Simon Goldschmidt
One of the hexdump tests in
test/lib/hexdump.creturns right at the start of the function without testing anything.Fix this by moving the 'return 0;' statement to the end of the function.
Signed-off-by Simon Goldschmidt <[email protected]>---
test/lib/hexdump.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
That's one way to make a test pass.
PATCH 1/1 test: hexdump: fix misplaced return
Am 05.12.2018 um 13:55 schrieb Simon Glass:
Quoted 11 lines
Quoted 9 lines · Simon Goldschmidt
One of the hexdump tests in
test/lib/hexdump.creturns right at the start of the function without testing anything.Fix this by moving the 'return 0;' statement to the end of the function.
Signed-off-by Simon Goldschmidt <[email protected]>---
Quoted 6 lines
Quoted 2 lines
test/lib/hexdump.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)That's one way to make a test pass.
Reviewed-by Simon Glass <[email protected]>
Is there a plan to make all tests under test/ run with 'make check'? Seems like this one is not included there?
Simon
PATCH 1/1 test: hexdump: fix misplaced return
Quoted 16 lines · Simon Goldschmidt
Am 05.12.2018 um 13:55 schrieb Simon Glass:
Quoted 14 lines
Quoted 11 lines · Simon Goldschmidt
One of the hexdump tests in
test/lib/hexdump.creturns right at the start of the function without testing anything.Fix this by moving the 'return 0;' statement to the end of the function.
Signed-off-by Simon Goldschmidt <[email protected]>---
test/lib/hexdump.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 6 lines
Quoted 3 lines
That's one way to make a test pass.
Reviewed-by Simon Glass <[email protected]>Is there a plan to make all tests under test/ run with 'make check'? Seems like this one is not included there?
Yes I agree, it needs to be added.
- Simon
Quoted 7 lines · Simon Goldschmidt
One of the hexdump tests in
test/lib/hexdump.creturns right at the start of the function without testing anything.Fix this by moving the 'return 0;' statement to the end of the function.
Signed-off-by Simon Goldschmidt <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181212/1e69481e/attachment.sig>