diff options
author | Michael G. Schwern <schwern@pobox.com> | 2001-12-12 16:53:46 -0500 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-12-13 02:48:14 +0000 |
commit | c4fbe2471f42249bd57e1c071c99349d2331aea5 (patch) | |
tree | 04bdcfd3cd648684f746f4102e342ff821c295dc | |
parent | 20dd405caf5525a1659669e686c37f3d71a0ef6e (diff) | |
download | perl-c4fbe2471f42249bd57e1c071c99349d2331aea5.tar.gz |
Re: [PATCH t/test.pl t/op/stat.t lib/Net/hostent.t] Unbail out
Message-ID: <20011213025346.GH25129@blackrider>
p4raw-id: //depot/perl@13668
-rw-r--r-- | lib/Net/hostent.t | 10 | ||||
-rwxr-xr-x | t/op/stat.t | 10 | ||||
-rw-r--r-- | t/test.pl | 6 |
3 files changed, 13 insertions, 13 deletions
diff --git a/lib/Net/hostent.t b/lib/Net/hostent.t index 0a6a79eeda..e82cf85a37 100644 --- a/lib/Net/hostent.t +++ b/lib/Net/hostent.t @@ -20,9 +20,9 @@ BEGIN { BEGIN { use_ok 'Net::hostent' } # Remind me to add this to Test::More. -sub BAILOUT { - print "Bail Out! @_\n"; - exit; +sub DIE { + print "# @_\n"; + exit 1; } # test basic resolution of localhost <-> 127.0.0.1 @@ -30,13 +30,13 @@ use Socket; my $h = gethost('localhost'); ok(defined $h, "gethost('localhost')") || - BAILOUT("Can't continue without working gethost: $!"); + DIE("Can't continue without working gethost: $!"); is( inet_ntoa($h->addr), "127.0.0.1", 'addr from gethost' ); my $i = gethostbyaddr(inet_aton("127.0.0.1")); ok(defined $i, "gethostbyaddr('127.0.0.1')") || - BAILOUT("Can't continue without working gethostbyaddr: $!"); + DIE("Can't continue without working gethostbyaddr: $!"); is( inet_ntoa($i->addr), "127.0.0.1", 'addr from gethostbyaddr' ); diff --git a/t/op/stat.t b/t/op/stat.t index 299972d109..57460fcfd1 100755 --- a/t/op/stat.t +++ b/t/op/stat.t @@ -36,10 +36,10 @@ my $tmpfile_link = $tmpfile.'2'; unlink $tmpfile; -open(FOO, ">$tmpfile") || BAILOUT("Can't open temp test file: $!"); +open(FOO, ">$tmpfile") || DIE("Can't open temp test file: $!"); close FOO; -open(FOO, ">$tmpfile") || BAILOUT("Can't open temp test file: $!"); +open(FOO, ">$tmpfile") || DIE("Can't open temp test file: $!"); my($nlink, $mtime, $ctime) = (stat(FOO))[$NLINK, $MTIME, $CTIME]; SKIP: { @@ -109,13 +109,13 @@ DIAG } # truncate and touch $tmpfile. -open(F, ">$tmpfile") || BAILOUT("Can't open temp test file: $!"); +open(F, ">$tmpfile") || DIE("Can't open temp test file: $!"); close F; ok(-z $tmpfile, '-z on empty file'); ok(! -s $tmpfile, ' and -s'); -open(F, ">$tmpfile") || BAILOUT("Can't open temp test file: $!"); +open(F, ">$tmpfile") || DIE("Can't open temp test file: $!"); print F "hi\n"; close F; @@ -296,7 +296,7 @@ my $Null = File::Spec->devnull; SKIP: { skip "No null device to test with", 1 unless -e $Null; - open(NULL, $Null) or BAIL_OUT("Can't open $Null: $!"); + open(NULL, $Null) or DIE("Can't open $Null: $!"); ok(! -t NULL, 'null device is not a TTY'); close(NULL); } @@ -325,9 +325,9 @@ sub runperl { } -sub BAILOUT { - print STDOUT "Bail out! @_\n"; - exit; +sub DIE { + print STDOUT "# @_\n"; + exit 1; } # A somewhat safer version of the sometimes wrong $^X. |