Update of /cvsroot/libsysio/libsysio/tests
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25792/tests
Modified Files:
helper.pm
Log Message:
Check for null return value in helper.pm in order to attempt to give
possibly helpful error returns.
Index: helper.pm
===================================================================
RCS file: /cvsroot/libsysio/libsysio/tests/helper.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -b -B -p -r1.4 -r1.5
--- helper.pm 11 Mar 2004 14:40:53 -0000 1.4
+++ helper.pm 28 Jul 2004 14:58:21 -0000 1.5
@@ -26,7 +26,10 @@ sub print_and_exit
print $cmdfh $cmdstr;
my $res = <$outfh>;
+ if (defined $res) {
chop($res);
+ }
+
print $cmdfh "exit\n";
close $outfh;
@@ -47,7 +50,12 @@ sub send_cmd
print $cmdfh $cmdstr;
my $res = <$outfh>;
+ if (defined $res) {
chop($res);
+ } else {
+ print_and_exit($cmdfh, $outfh, 1, "ERROR! Cmd $cmdstr returned null value!\n");
+ }
+
if ($res ne "0000 ") {
print_and_exit($cmdfh, $outfh, 1, "ERROR! Command $cmd failed with code $res\n");
}
@@ -65,7 +73,11 @@ sub verify_cmd
send_cmd($cmdfh, $outfh, "PRINT", $cmdstr);
my $res = <$outfh>;
+ if (defined $res) {
chop($res);
+ } else {
+ print_and_exit($cmdfh, $outfh, 1, "ERROR! Cmd $cmdstr returned null value!\n");
+ }
if ($res eq "0xffffffff") {
@@ -75,7 +87,12 @@ sub verify_cmd
send_cmd($cmdfh, $outfh, "PRINT", $cmdstr);
my $err = <$outfh>;
+ if (defined $err) {
chop($err);
+ } else {
+ print_and_exit($cmdfh, $outfh, 1, "ERROR! Cmd $cmdstr returned null value!\n");
+ }
+
print_and_exit($cmdfh, $outfh, 1, "ERROR! $cmd returned $err\n");
}
return $res;
|