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

Method TestIpFromString

util/network/ip_ut.cpp:28–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26UNIT_TEST_SUITE_REGISTRATION(TSysIpTest);
27
28void TSysIpTest::TestIpFromString() {
29 const char* ipStr[] = {"192.168.0.1", "87.255.18.167", "255.255.0.31", "188.225.124.255"};
30 ui8 ipArr[][4] = {{192, 168, 0, 1}, {87, 255, 18, 167}, {255, 255, 0, 31}, {188, 225, 124, 255}};
31
32 for (size_t i = 0; i < Y_ARRAY_SIZE(ipStr); ++i) {
33 const ui32 ip = IpFromString(ipStr[i]);
34
35 UNIT_ASSERT(memcmp(&ip, ipArr[i], sizeof(ui32)) == 0);
36 }
37}
38
39void TSysIpTest::TestIpFromString2() {
40 IpFromString("XXXXXXWXW");

Callers

nothing calls this directly

Calls 2

IpFromStringFunction · 0.85
memcmpFunction · 0.85

Tested by

no test coverage detected