fix an incorrect assumption in the connfail tests, thanks CPANTesters
Apocalypse
13 years ago
56 | 56 | # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0! |
57 | 57 | # The default PoCo::Server::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :( |
58 | 58 | my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ]; |
59 | ||
60 | # Since this test purposefully sends garbage, we expect a connection reset by peer | |
61 | # not ok 7 - Got SERVER read error 104: Connection reset by peer | |
62 | ||
63 | # TODO are there other "errors" that is harmless? | |
64 | 59 | $error = "Normal disconnection" unless $error; |
65 | my $msg = "Got SERVER $syscall error $errno: $error"; | |
66 | unless ( $syscall eq 'read' and $errno == 104 ) { | |
67 | fail( $msg ); | |
68 | } else { | |
69 | diag( $msg ) if $ENV{TEST_VERBOSE}; | |
70 | } | |
60 | diag( "Got SERVER $syscall error $errno: $error" ) if $ENV{TEST_VERBOSE}; | |
71 | 61 | }, |
72 | 62 | ); |
73 | 63 | |
107 | 97 | # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0! |
108 | 98 | # The default PoCo::Client::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :( |
109 | 99 | my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ]; |
110 | ||
111 | # TODO are there other "errors" that is harmless? | |
112 | 100 | $error = "Normal disconnection" unless $error; |
113 | my $msg = "Got CLIENT $syscall error $errno: $error"; | |
114 | unless ( $syscall eq 'read' and $errno == 0 ) { | |
115 | fail( $msg ); | |
116 | } else { | |
117 | diag( $msg ) if $ENV{TEST_VERBOSE}; | |
118 | } | |
101 | diag( "Got CLIENT $syscall error $errno: $error" ) if $ENV{TEST_VERBOSE}; | |
119 | 102 | }, |
120 | 103 | ); |
121 | 104 |
77 | 77 | # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0! |
78 | 78 | # The default PoCo::Server::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :( |
79 | 79 | my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ]; |
80 | ||
81 | # Since this test purposefully sends garbage, we expect a connection reset by peer | |
82 | # not ok 7 - Got SERVER read error 104: Connection reset by peer | |
83 | ||
84 | # TODO are there other "errors" that is harmless? | |
85 | 80 | $error = "Normal disconnection" unless $error; |
86 | my $msg = "Got SERVER $syscall error $errno: $error"; | |
87 | unless ( $syscall eq 'read' and $errno == 104 ) { | |
88 | fail( $msg ); | |
89 | } else { | |
90 | diag( $msg ) if $ENV{TEST_VERBOSE}; | |
91 | } | |
81 | diag( "Got SERVER $syscall error $errno: $error" ) if $ENV{TEST_VERBOSE}; | |
92 | 82 | }, |
93 | 83 | ); |
94 | 84 | |
114 | 104 | # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0! |
115 | 105 | # The default PoCo::Client::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :( |
116 | 106 | my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ]; |
117 | ||
118 | # Since this test purposefully sends garbage, we expect a connection reset by peer | |
119 | # not ok 7 - Got SERVER read error 104: Connection reset by peer | |
120 | ||
121 | # TODO are there other "errors" that is harmless? | |
122 | 107 | $error = "Normal disconnection" unless $error; |
123 | my $msg = "Got CLIENT $syscall error $errno: $error"; | |
124 | unless ( $syscall eq 'read' and $errno == 104 ) { | |
125 | fail( $msg ); | |
126 | } else { | |
127 | diag( $msg ) if $ENV{TEST_VERBOSE}; | |
128 | } | |
108 | diag( "Got CLIENT $syscall error $errno: $error" ) if $ENV{TEST_VERBOSE}; | |
129 | 109 | }, |
130 | 110 | ); |
131 | 111 |