]> xenbits.xensource.com Git - people/royger/osstest.git/commitdiff
resource allocation: PropCompareBase: Break out _get_val
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 4 Jul 2018 10:41:22 +0000 (11:41 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Wed, 11 Jul 2018 14:55:03 +0000 (15:55 +0100)
This is going to make defaulting etc. a bit easier.

No functional change.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Roger Pau Monné <royger@FreeBSD.org>
Osstest/ResourceCondition/PropCompareBase.pm

index 5306bb8858c0c3583c8f7ae7a05e56699307e75c..abd2640b5acd3dbe4abb2922d208d00be2f18a77 100644 (file)
@@ -44,7 +44,7 @@ sub new {
     }, $class;
 }
 
-sub check {
+sub _get_val ($$$) {
     my ($pc, $restype, $resname) = @_;
 
     # Using _cached avoids needing to worry about $dbh_tests being
@@ -57,9 +57,14 @@ END
 
     my $row= $hpropq->fetchrow_arrayref();
     $hpropq->finish();
+    
+    my $v = $row->[0];
+    return $v;
+}
 
-    my $propval = $row->[0];
-
+sub check {
+    my ($pc, $restype, $resname) = @_;
+    my $propval = $pc->_get_val($restype, $resname);
     return $pc->_check($propval);
 }