tests: use -z / -n to test for string empty / non-empty
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 2 Aug 2022 19:21:21 +0000 (15:21 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Tue, 16 Aug 2022 19:50:22 +0000 (15:50 -0400)
shellcheck gives many warnings of this kind

    In env.sh.in line 44:
    if [ "x${BT_TESTS_CC_BIN:-}" = "x" ]; then
         ^---------------------^ SC2268 (style): Avoid x-prefix in comparisons as it no longer serves a purpose.

    Did you mean:
    if [ "${BT_TESTS_CC_BIN:-}" = "" ]; then

Fix them by using test's -z and -n switches, which test for empty and
non-empty strings, respectively.  In some cases, we are checking for the
string to have a specific value ( = "x1"), in which case I left the
comparison, but just removed the leading x's.

Change-Id: I3cd841d881916696419d540ed629e685d2edce9d
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8635
Tested-by: jenkins <jenkins@lttng.org>

No differences found
This page took 0.026269 seconds and 4 git commands to generate.