diff mbox

[OSSTEST,03/26] TestSupport: Produce stack trace for undef tfileex

Message ID 1473084154-396-4-git-send-email-ian.jackson@eu.citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ian Jackson Sept. 5, 2016, 2:02 p.m. UTC
Use `confess' to see where an undef $rfile came from.  I think there
will probably be lots more of this pattern.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 Osstest/TestSupport.pm | 3 +++
 1 file changed, 3 insertions(+)
diff mbox

Patch

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index d0d6ef3..a6ab18f 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -31,6 +31,7 @@  use Osstest::Logtailer;
 use File::Copy;
 use File::Basename;
 use IO::Handle;
+use Carp;
 
 BEGIN {
     use Exporter ();
@@ -523,6 +524,8 @@  sub teditfileex {
     my $code= pop @_;
     my ($ho,$rfile,$lleaf,$rdest) = @_;
 
+    confess unless defined $rfile;
+
     if (!defined $rdest) {
         $rdest= $rfile;
     }