MCPcopy Create free account
hub / github.com/davisking/dlib / do_test6

Function do_test6

dlib/test/bridge.cpp:201–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199 }
200
201 void do_test6()
202 {
203 dlib::pipe<int> in(0), out(300);
204
205 bridge b1(connect_to_ip_and_port("127.0.0.1",testing_port), receive(in));
206 bridge b2(listen_on_port(testing_port), transmit(out));
207
208 for (int i = 0; i < 100; ++i)
209 {
210 int val = i;
211 out.enqueue(val);
212 }
213
214 int val = 10;
215 in.dequeue(val);
216 DLIB_TEST(val == 0);
217 dlib::sleep(100);
218 in.dequeue(val);
219 DLIB_TEST(val == 1);
220 dlib::sleep(100);
221 }
222
223 class test_bridge : public tester
224 {

Callers 1

perform_testMethod · 0.85

Calls 6

receiveFunction · 0.85
transmitFunction · 0.85
listen_on_portClass · 0.50
sleepFunction · 0.50
enqueueMethod · 0.45

Tested by

no test coverage detected