bring up a session and a link between the two connections
| 82 | |
| 83 | // bring up a session and a link between the two connections |
| 84 | static void test_setup(pn_connection_t *c1, pn_transport_t *t1, |
| 85 | pn_connection_t *c2, pn_transport_t *t2) { |
| 86 | pn_connection_open(c1); |
| 87 | pn_connection_open(c2); |
| 88 | |
| 89 | pn_session_t *s1 = pn_session(c1); |
| 90 | pn_session_open(s1); |
| 91 | |
| 92 | pn_link_t *tx = pn_sender(s1, "sender"); |
| 93 | pn_link_open(tx); |
| 94 | |
| 95 | while (pump(t1, t2)) { |
| 96 | process_endpoints(c1); |
| 97 | process_endpoints(c2); |
| 98 | } |
| 99 | |
| 100 | // session and link should be up, c2 should have a receiver link: |
| 101 | |
| 102 | REQUIRE(pn_session_state(s1) == (PN_LOCAL_ACTIVE | PN_REMOTE_ACTIVE)); |
| 103 | REQUIRE(pn_link_state(tx) == (PN_LOCAL_ACTIVE | PN_REMOTE_ACTIVE)); |
| 104 | |
| 105 | pn_link_t *rx = pn_link_head(c2, (PN_LOCAL_ACTIVE | PN_REMOTE_ACTIVE)); |
| 106 | REQUIRE(rx); |
| 107 | REQUIRE(pn_link_is_receiver(rx)); |
| 108 | } |
| 109 | |
| 110 | // test that free'ing the connection should free all contained |
| 111 | // resources (session, links, deliveries) |
no test coverage detected