tests/utils/utils.sh: bt_diff_cli(): return directly, don't use `ret`
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 10 Nov 2023 04:24:43 +0000 (23:24 -0500)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 7 Feb 2024 21:25:56 +0000 (16:25 -0500)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I60257da865052146ca3b1bb3b10bcea02f4ff1d2

tests/utils/utils.sh

index 739ec225b1b5345c24a5bde6ca29ba825287afc8..af500b9635751026f3c05e8a372cba2350557015 100644 (file)
@@ -277,7 +277,6 @@ bt_diff_cli() {
 
        local -r temp_stdout_output_file="$(mktemp -t actual-stdout.XXXXXX)"
        local -r temp_stderr_output_file="$(mktemp -t actual-stderr.XXXXXX)"
-       local ret=0
 
        bt_cli "$temp_stdout_output_file" "$temp_stderr_output_file" "${args[@]}"
 
@@ -286,13 +285,9 @@ bt_diff_cli() {
        bt_diff "$expected_stderr_file" "$temp_stderr_output_file" "${args[@]}"
        local -r ret_stderr=$?
 
-       if ((ret_stdout != 0 || ret_stderr != 0)); then
-               ret=1
-       fi
-
        rm -f "$temp_stdout_output_file" "$temp_stderr_output_file"
 
-       return $ret
+       return $((ret_stdout || ret_stderr))
 }
 
 # Checks the difference between:
This page took 0.02492 seconds and 4 git commands to generate.