| 143 | }; |
| 144 | |
| 145 | int test_user_context() { |
| 146 | |
| 147 | std::string recv_address("127.0.0.1:0/test"); |
| 148 | test_server recv(recv_address); |
| 149 | proton::container c(recv); |
| 150 | std::thread thread_recv([&c]() -> void { c.run(); }); |
| 151 | |
| 152 | // wait until listener is ready |
| 153 | std::unique_lock<std::mutex> lk(m); |
| 154 | cv.wait(lk, [] { return listener_ready; }); |
| 155 | |
| 156 | std::string send_address = |
| 157 | "127.0.0.1:" + std::to_string(listener_port) + "/test"; |
| 158 | test_client send(send_address); |
| 159 | proton::container(send).run(); |
| 160 | thread_recv.join(); |
| 161 | |
| 162 | return 0; |
| 163 | } |
| 164 | |
| 165 | int main(int argc, char **argv) { |
| 166 | int failed = 0; |