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

Function test2

dlib/test/iosockstream.cpp:134–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132// ----------------------------------------------------------------------------------------
133
134 void test2()
135 {
136 dlog << LINFO << "in test2()";
137 serv2 theserv;
138 theserv.set_listening_port(12345);
139 theserv.start_async();
140
141 // wait a little bit to make sure the server has started listening before we try
142 // to connect to it.
143 dlib::sleep(500);
144
145 for (int i = 0; i < 200; ++i)
146 {
147 dlog << LINFO << "i: " << i;
148 print_spinner();
149 iosockstream stream("localhost:12345");
150
151 std::string temp;
152 stream >> temp; DLIB_TEST(temp == "one");
153 stream >> temp; DLIB_TEST(temp == "two");
154 stream >> temp; DLIB_TEST(temp == "three");
155 stream >> temp; DLIB_TEST(temp == "four");
156 stream >> temp; DLIB_TEST(temp == "five");
157 }
158 }
159
160// ----------------------------------------------------------------------------------------
161

Callers 2

perform_testMethod · 0.70
test_regressionFunction · 0.70

Calls 2

print_spinnerFunction · 0.85
sleepFunction · 0.50

Tested by

no test coverage detected