Explicit setter for filter_zeroed_rows

This commit is contained in:
Brian Fraser
2012-01-10 13:46:05 -03:00
parent 25909caa4e
commit 187d921069
3 changed files with 9 additions and 7 deletions

View File

@@ -123,13 +123,15 @@ sub set_first_ts {
} }
sub filter_zeroed_rows { sub filter_zeroed_rows {
my ($self, $new_val) = @_; my ($self) = @_;
if ( defined($new_val) ) {
$self->{filter_zeroed_rows} = $new_val;
}
return $self->{filter_zeroed_rows}; return $self->{filter_zeroed_rows};
} }
sub set_filter_zeroed_rows {
my ($self, $new_val) = @_;
$self->{filter_zeroed_rows} = $new_val;
}
sub sample_time { sub sample_time {
my ($self, $new_val) = @_; my ($self, $new_val) = @_;
if (defined($new_val)) { if (defined($new_val)) {

View File

@@ -371,7 +371,7 @@ sub hide_inactive_disks {
# Eeep. In OptionParser, "true" means show; in Diskstats, "true" means hide. # Eeep. In OptionParser, "true" means show; in Diskstats, "true" means hide.
# Thus !$new_val for OptionParser # Thus !$new_val for OptionParser
$args{options}->{OptionParser}->set('zero-rows', !$new_val); $args{options}->{OptionParser}->set('zero-rows', !$new_val);
$args{options}->{current_group_by_obj}->filter_zeroed_rows($new_val); $args{options}->{current_group_by_obj}->set_filter_zeroed_rows($new_val);
return; return;
} }

View File

@@ -221,7 +221,7 @@ is_deeply(
"...And clears the internal duplicate-checking list" "...And clears the internal duplicate-checking list"
); );
$obj->filter_zeroed_rows(1); $obj->set_filter_zeroed_rows(1);
my $print_output = output( my $print_output = output(
sub { sub {
$obj->print_rows( $obj->print_rows(
@@ -231,7 +231,7 @@ my $print_output = output(
); );
} }
); );
$obj->filter_zeroed_rows(0); $obj->set_filter_zeroed_rows(0);
is( is(
$print_output, $print_output,