| 1 | # Before `make install' is performed this script should be runnable with | ||||||||||||||||||||||||||||
| 2 | # `make test'. After `make install' it should work as `perl test.pl' | ||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||
| 4 | ######################### We start with some black magic to print on failure. | ||||||||||||||||||||||||||||
| 5 | # Change 1..1 below to 1..last_test_to_print . | ||||||||||||||||||||||||||||
| 6 | # (It may become useful if the test is moved to ./t subdirectory.) | ||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 1 | ▶ | BEGIN { $| = 1; print "1..3\n"; } | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 1 | ▶ | END {print "not ok 1\n" unless $loaded;} | ||||||||||||||||||||||||||
|
Subroutine
END: called CC=2 SCAR=7.6
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | #use diagnostics; | ||||||||||||||||||||||||||||
| 12 | 1 | ▶ | use Config; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | 1 | ▶ | use NetAddr::IP::InetBase qw( | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | AF_INET | ||||||||||||||||||||||||||||
| 15 | AF_INET6 | ||||||||||||||||||||||||||||
| 16 | fake_AF_INET6 | ||||||||||||||||||||||||||||
| 17 | 1 | ); | |||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 1 | $loaded = 1; | |||||||||||||||||||||||||||
| 20 | 1 | print "ok 1\n"; | |||||||||||||||||||||||||||
| 21 | ######################### End of black magic. | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | # Insert your test code below (better if it prints "ok 13" | ||||||||||||||||||||||||||||
| 24 | # (correspondingly "not ok 13") depending on the success of chunk 13 | ||||||||||||||||||||||||||||
| 25 | # of the test code): | ||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | 1 | $test = 2; | |||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 2 | ▶ | sub ok { | ||||||||||||||||||||||||||
|
Subroutine
ok: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 30 | 2 | print "ok $test\n"; | |||||||||||||||||||||||||||
| 31 | 2 | ++$test; | |||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | ## test 2 - 13 add stuff to buffer | ||||||||||||||||||||||||||||
| 35 | 1 | my $af; | |||||||||||||||||||||||||||
| 36 | 1 | ▶ | print "AF_INET = 2 not found in the Socket library\nnot " | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$af = 2 and $af == 2
MC/DC0%0/2
$af = 2 and $af == 2
$af = 2
$af == 2
Truth table33%1/3
A and B
A= $af = 2B= $af == 2
| |||||||||||||||||||||||||||||
| 37 | unless ($af = AF_INET()) && $af == 2; | ||||||||||||||||||||||||||||
| 38 | 1 | &ok; | |||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | 1 | my $fake = fake_AF_INET6(); | |||||||||||||||||||||||||||
| 41 | 1 | my $af_inet6 = AF_INET6(); | |||||||||||||||||||||||||||
| 42 | 1 | ▶ | my $txt = $fake | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 43 | ? "\n\tSocket does not have AF_INET6, Socket6 not present\n\tguessed AF_INET6 for '$Config{osname}' = $fake\n" | ||||||||||||||||||||||||||||
| 44 | : "\n\tAF_INET6 = $af_inet6 derived from Socket or Socket6\n"; | ||||||||||||||||||||||||||||
| 45 | 1 | print STDERR $txt; | |||||||||||||||||||||||||||
| 46 | 1 | &ok; | |||||||||||||||||||||||||||