| 202 | } |
| 203 | |
| 204 | int test_container_bad_address() { |
| 205 | // Listen on a bad address, check for leaks |
| 206 | // Regression test for https://issues.apache.org/jira/browse/PROTON-1217 |
| 207 | |
| 208 | proton::container c; |
| 209 | // Default fixed-option listener. Valgrind for leaks. |
| 210 | c.listen("999.666.999.666:0"); |
| 211 | c.run(); |
| 212 | // Dummy listener. |
| 213 | test_listen_handler l; |
| 214 | test_handler h2("999.999.999.666", proton::connection_options()); |
| 215 | c.listen("999.666.999.666:0", l); |
| 216 | c.run(); |
| 217 | ASSERT(!l.on_open_); |
| 218 | ASSERT(!l.on_accept_); |
| 219 | ASSERT(l.on_close_); |
| 220 | ASSERT(!l.on_error_.empty()); // proton:io: Name or service not known |
| 221 | return 0; |
| 222 | } |
| 223 | |
| 224 | class stop_tester : public proton::messaging_handler { |
| 225 | proton::listener listener; |
no test coverage detected