[lvm-devel] master - tests: better check for empty set

Zdenek Kabelac zkabelac at fedoraproject.org
Fri Apr 3 15:18:35 UTC 2015


Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=93ab6d51844352d8680d62e68da7973c4bf98346
Commit:        93ab6d51844352d8680d62e68da7973c4bf98346
Parent:        ce3c61c4af4622674d8ebd4301d4fd24c4cb8886
Author:        Zdenek Kabelac <zkabelac at redhat.com>
AuthorDate:    Fri Apr 3 16:38:05 2015 +0200
Committer:     Zdenek Kabelac <zkabelac at redhat.com>
CommitterDate: Fri Apr 3 16:38:05 2015 +0200

tests: better check for empty set

Even when no arg is passed - there is still one "" arg there...
So taky it easy and check for empty string instead.
---
 test/lib/aux.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 7499aac..f4fc1b5 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -431,10 +431,10 @@ common_dev_() {
 		if test "$read_ms" -eq 0 -a "$write_ms" -eq 0 ; then
 			offsets=
 		else
-			test ${#offsets[@]} -eq 0 && offsets="0:"
+			test -z "${offsets[@]}" && offsets="0:"
 		fi ;;
 	error)  offsets=${@:3}
-		test ${#offsets[@]} -eq 0 && offsets="0:" ;;
+		test -z "${offsets[@]}" && offsets="0:" ;;
 	esac
 
 	local pos




More information about the lvm-devel mailing list