"my" variable $output masks earlier declaration in same scope at
/home/libguestfs/tests/daemon/test-btrfs.pl line 66.
"my" variable @r masks earlier declaration in same scope at
/home/libguestfs/tests/daemon/test-btrfs.pl line 72.
Also remove some redundant whitespace.
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
---
tests/daemon/test-btrfs.pl | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/tests/daemon/test-btrfs.pl b/tests/daemon/test-btrfs.pl
index 815ab1d..1430231 100755
--- a/tests/daemon/test-btrfs.pl
+++ b/tests/daemon/test-btrfs.pl
@@ -63,13 +63,13 @@ EOF
die unless $r[2]->{btrfssubvolume_path} eq "test3";
# Test btrfs_qgroup_show.
- my $output = <<EOF;
-qgroupid rfer excl
--------- ---- ----
-0/5 4096 4096
+ $output = <<EOF;
+qgroupid rfer excl
+-------- ---- ----
+0/5 4096 4096
EOF
set_btrfs_output ($output);
- my @r = $g->btrfs_qgroup_show ("/");
+ @r = $g->btrfs_qgroup_show ("/");
die unless @r == 1;
die unless $r[0]->{btrfsqgroup_id} == "0/5";
die unless $r[0]->{btrfsqgroup_rfer} == 4096;
--
2.1.0
Richard W.M. Jones
2015-Jun-30 10:07 UTC
Re: [Libguestfs] [PATCH] tests: fix two minor warnings
On Tue, Jun 30, 2015 at 05:45:14PM +0800, Chen Hanxiao wrote:> "my" variable $output masks earlier declaration in same scope at /home/libguestfs/tests/daemon/test-btrfs.pl line 66. > "my" variable @r masks earlier declaration in same scope at /home/libguestfs/tests/daemon/test-btrfs.pl line 72. > > Also remove some redundant whitespace. > > Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com> > --- > tests/daemon/test-btrfs.pl | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/tests/daemon/test-btrfs.pl b/tests/daemon/test-btrfs.pl > index 815ab1d..1430231 100755 > --- a/tests/daemon/test-btrfs.pl > +++ b/tests/daemon/test-btrfs.pl > @@ -63,13 +63,13 @@ EOF > die unless $r[2]->{btrfssubvolume_path} eq "test3"; > > # Test btrfs_qgroup_show. > - my $output = <<EOF; > -qgroupid rfer excl > --------- ---- ---- > -0/5 4096 4096 > + $output = <<EOF; > +qgroupid rfer excl > +-------- ---- ---- > +0/5 4096 4096 > EOF > set_btrfs_output ($output); > - my @r = $g->btrfs_qgroup_show ("/"); > + @r = $g->btrfs_qgroup_show ("/"); > die unless @r == 1; > die unless $r[0]->{btrfsqgroup_id} == "0/5"; > die unless $r[0]->{btrfsqgroup_rfer} == 4096;Partial ACK. The whitespace is actually included in the output of the real btrfs command, so I wanted to check the btrfs code in the daemon could parse it. I will push a modified patch shortly. Thanks, Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
Seemingly Similar Threads
- Re: [PATCH v4 1/3] do_btrfs_qgroup_show: fix a bad return value
- [PATCH 09/11] New API: btrfs_qgroup_show
- [PATCH v4 0/3] btrfs: use CLEANUP_FREE_STRING_LIST for list free
- [PATCH v4 1/3] do_btrfs_qgroup_show: fix a bad return value
- [PATCH v5 1/2] do_btrfs_qgroup_show: fix a bad return value