MCPcopy Create free account
hub / github.com/apache/brpc / concurrent_proc

Function concurrent_proc

test/endpoint_unittest.cpp:465–481  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

463}
464
465void concurrent_proc(void* p) {
466 for (int i = 0; i < 10000; ++i) {
467 butil::EndPoint ep;
468 std::string str("127.0.0.1:8080");
469 ASSERT_EQ(0, butil::str2endpoint(str.c_str(), &ep));
470 ASSERT_EQ(str, butil::endpoint2str(ep).c_str());
471
472 str.assign("[::1]:8080");
473 ASSERT_EQ(0, butil::str2endpoint(str.c_str(), &ep));
474 ASSERT_EQ(str, butil::endpoint2str(ep).c_str());
475
476 str.assign("unix:test.sock");
477 ASSERT_EQ(0, butil::str2endpoint(str.c_str(), &ep));
478 ASSERT_EQ(str, butil::endpoint2str(ep).c_str());
479 }
480 *(int*)p = 1;
481}
482
483TEST(EndPointTest, endpoint_concurrency) {
484 const int T = 5;

Callers 1

TESTFunction · 0.85

Calls 4

str2endpointFunction · 0.85
endpoint2strFunction · 0.85
c_strMethod · 0.45
assignMethod · 0.45

Tested by

no test coverage detected