MCPcopy Create free account
hub / github.com/apache/qpid-proton / test_setup

Function test_setup

c/tests/engine_test.cpp:84–108  ·  view source on GitHub ↗

bring up a session and a link between the two connections

Source from the content-addressed store, hash-verified

82
83// bring up a session and a link between the two connections
84static 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)

Callers 1

engine_test.cppFile · 0.85

Calls 11

pn_connection_openFunction · 0.85
pn_sessionFunction · 0.85
pn_session_openFunction · 0.85
pn_link_openFunction · 0.85
process_endpointsFunction · 0.85
pn_session_stateFunction · 0.85
pn_link_stateFunction · 0.85
pn_link_headFunction · 0.85
pn_link_is_receiverFunction · 0.85
pumpFunction · 0.70
pn_senderFunction · 0.50

Tested by

no test coverage detected