MCPcopy Create free account
hub / github.com/catboost/catboost / TestNetworkResolutionError

Method TestNetworkResolutionError

util/network/socket_ut.cpp:74–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74void TSockTest::TestNetworkResolutionError() {
75 TString errMsg;
76 try {
77 TNetworkAddress addr("", 0);
78 } catch (const TNetworkResolutionError& e) {
79 errMsg = e.what();
80 }
81
82 if (errMsg.empty()) {
83 return; // on Windows getaddrinfo("", 0, ...) returns "OK"
84 }
85
86 int expectedErr = EAI_NONAME;
87 TString expectedErrMsg = gai_strerror(expectedErr);
88 if (errMsg.find(expectedErrMsg) == TString::npos) {
89 UNIT_FAIL("TNetworkResolutionError contains\nInvalid msg: " + errMsg + "\nExpected msg: " + expectedErrMsg + "\n");
90 }
91}
92
93void TSockTest::TestNetworkResolutionErrorMessage() {
94#ifdef _unix_

Callers

nothing calls this directly

Calls 3

whatMethod · 0.45
emptyMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected