| 72 | } |
| 73 | |
| 74 | void 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 | |
| 93 | void TSockTest::TestNetworkResolutionErrorMessage() { |
| 94 | #ifdef _unix_ |