tests: use -z / -n to test for string empty / non-empty
[babeltrace.git] / tests / cli / query / test_query
index 803644ba462a942e6a7312c4f853d5c6788ea1e5..e44d67779b629417291dca8a403d833db0ed41c0 100755 (executable)
@@ -1,21 +1,11 @@
 #!/bin/bash
 #
-# Copyright (C) 2019 Simon Marchi <simon.marchi@efficios.com>
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License, version 2 only, as
-# published by the Free Software Foundation.
+# SPDX-License-Identifier: GPL-2.0-only
 #
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
-# more details.
+# Copyright (C) 2019 Simon Marchi <simon.marchi@efficios.com>
 #
-# You should have received a copy of the GNU General Public License along with
-# this program; if not, write to the Free Software Foundation, Inc., 51
-# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-if [ "x${BT_TESTS_SRCDIR:-}" != "x" ]; then
+if [ -n "${BT_TESTS_SRCDIR:-}" ]; then
        UTILSSH="$BT_TESTS_SRCDIR/utils/utils.sh"
 else
        UTILSSH="$(dirname "$0")/../../utils/utils.sh"
@@ -89,7 +79,7 @@ expect_failure "ValueError: catastrophic failure" \
        'src.query.SourceWithQueryThatPrintsParams' 'please-fail' '-p' 'a=2'
 
 # Non-existent component class.
-expect_failure 'Cannot find component class: plugin-name="query", comp-cls-name="NonExistentSource", comp-cls-type=1' \
+expect_failure 'Cannot find component class: plugin-name="query", comp-cls-name="NonExistentSource", comp-cls-type=SOURCE' \
        'src.query.NonExistentSource' 'the-object' '-p' 'a=2'
 
 # Wrong parameter syntax.
This page took 0.02383 seconds and 4 git commands to generate.