diff options
author | David Sterba <dsterba@suse.com> | 2018-03-23 16:21:37 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-03-30 22:15:55 +0200 |
commit | a855717a87a8da78b62148e8bf0a629695596097 (patch) | |
tree | bf4606be59922453b284350bf8121907fc705a4f /tests | |
parent | a1e21ec5a880044f44a9109633c7503bce02cb5e (diff) |
btrfs-progs: tests: remove trivial use of local variables
No need to use a temporary variable if the parameter usage is obvious
from the context.
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/fsck-tests/015-tree-reloc-tree/test.sh | 5 | ||||
-rwxr-xr-x | tests/fsck-tests/020-extent-ref-cases/test.sh | 5 | ||||
-rwxr-xr-x | tests/fuzz-tests/001-simple-check-unmounted/test.sh | 5 | ||||
-rwxr-xr-x | tests/fuzz-tests/002-simple-image/test.sh | 5 | ||||
-rwxr-xr-x | tests/fuzz-tests/004-simple-dump-tree/test.sh | 5 | ||||
-rwxr-xr-x | tests/fuzz-tests/006-simple-tree-stats/test.sh | 5 | ||||
-rwxr-xr-x | tests/misc-tests/002-uuid-rewrite/test.sh | 5 | ||||
-rwxr-xr-x | tests/misc-tests/003-zero-log/test.sh | 10 |
8 files changed, 9 insertions, 36 deletions
diff --git a/tests/fsck-tests/015-tree-reloc-tree/test.sh b/tests/fsck-tests/015-tree-reloc-tree/test.sh index 21987b0c..5d9d5122 100755 --- a/tests/fsck-tests/015-tree-reloc-tree/test.sh +++ b/tests/fsck-tests/015-tree-reloc-tree/test.sh @@ -10,10 +10,7 @@ source "$TEST_TOP/common" check_prereq btrfs check_image() { - local image - - image=$1 - run_check "$TOP/btrfs" check "$image" + run_check "$TOP/btrfs" check "$1" } check_all_images diff --git a/tests/fsck-tests/020-extent-ref-cases/test.sh b/tests/fsck-tests/020-extent-ref-cases/test.sh index 9cf99a51..a1bf75b1 100755 --- a/tests/fsck-tests/020-extent-ref-cases/test.sh +++ b/tests/fsck-tests/020-extent-ref-cases/test.sh @@ -20,10 +20,7 @@ source "$TEST_TOP/common" check_prereq btrfs check_image() { - local image - - image=$1 - run_check "$TOP/btrfs" check "$image" + run_check "$TOP/btrfs" check "$1" } check_all_images diff --git a/tests/fuzz-tests/001-simple-check-unmounted/test.sh b/tests/fuzz-tests/001-simple-check-unmounted/test.sh index 84d7ed83..87a63944 100755 --- a/tests/fuzz-tests/001-simple-check-unmounted/test.sh +++ b/tests/fuzz-tests/001-simple-check-unmounted/test.sh @@ -9,10 +9,7 @@ check_prereq btrfs # redefine the one provided by common check_image() { - local image - - image=$1 - run_mayfail "$TOP/btrfs" check "$image" + run_mayfail "$TOP/btrfs" check "$1" } check_all_images "$TEST_TOP/fuzz-tests/images" diff --git a/tests/fuzz-tests/002-simple-image/test.sh b/tests/fuzz-tests/002-simple-image/test.sh index 0db61908..5dddc9e1 100755 --- a/tests/fuzz-tests/002-simple-image/test.sh +++ b/tests/fuzz-tests/002-simple-image/test.sh @@ -9,11 +9,8 @@ check_prereq btrfs-image # redefine the one provided by common check_image() { - local image - - image=$1 truncate -s0 target - run_mayfail "$TOP/btrfs-image" "$image" target + run_mayfail "$TOP/btrfs-image" "$1" target truncate -s0 target } diff --git a/tests/fuzz-tests/004-simple-dump-tree/test.sh b/tests/fuzz-tests/004-simple-dump-tree/test.sh index 857c742a..c09b8478 100755 --- a/tests/fuzz-tests/004-simple-dump-tree/test.sh +++ b/tests/fuzz-tests/004-simple-dump-tree/test.sh @@ -7,10 +7,7 @@ check_prereq btrfs # redefine the one provided by common check_image() { - local image - - image=$1 - run_mayfail "$TOP/btrfs" inspect-internal dump-tree "$image" + run_mayfail "$TOP/btrfs" inspect-internal dump-tree "$1" } check_all_images "$TEST_TOP/fuzz-tests/images" diff --git a/tests/fuzz-tests/006-simple-tree-stats/test.sh b/tests/fuzz-tests/006-simple-tree-stats/test.sh index cb82e2cf..146afa93 100755 --- a/tests/fuzz-tests/006-simple-tree-stats/test.sh +++ b/tests/fuzz-tests/006-simple-tree-stats/test.sh @@ -7,10 +7,7 @@ check_prereq btrfs # redefine the one provided by common check_image() { - local image - - image=$1 - run_mayfail "$TOP/btrfs" inspect-internal tree-stats "$image" + run_mayfail "$TOP/btrfs" inspect-internal tree-stats "$1" } check_all_images "$TEST_TOP/fuzz-tests/images" diff --git a/tests/misc-tests/002-uuid-rewrite/test.sh b/tests/misc-tests/002-uuid-rewrite/test.sh index e32aff0c..8e7011a8 100755 --- a/tests/misc-tests/002-uuid-rewrite/test.sh +++ b/tests/misc-tests/002-uuid-rewrite/test.sh @@ -10,10 +10,7 @@ check_prereq btrfs prepare_test_dev get_fs_uuid() { - local image - - image="$1" - run_check_stdout $TOP/btrfs inspect-internal dump-super "$image" | \ + run_check_stdout $TOP/btrfs inspect-internal dump-super "$1" | \ grep '^fsid' | awk '{print $2}' } diff --git a/tests/misc-tests/003-zero-log/test.sh b/tests/misc-tests/003-zero-log/test.sh index 9d2940f5..51cf6ae4 100755 --- a/tests/misc-tests/003-zero-log/test.sh +++ b/tests/misc-tests/003-zero-log/test.sh @@ -9,17 +9,11 @@ prepare_test_dev get_log_root() { - local image - - image="$1" - $TOP/btrfs inspect-internal dump-super "$image" | \ + $TOP/btrfs inspect-internal dump-super "$1" | \ grep '^log_root\>' | awk '{print $2}' } get_log_root_level() { - local image - - image="$1" - $TOP/btrfs inspect-internal dump-super "$image" | \ + $TOP/btrfs inspect-internal dump-super "$1" | \ grep '^log_root_level' | awk '{print $2}' } |