]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - contrib/ntp/tests/libntp/g_numtohost.cpp
Fix a regression with SA-15:24 patch that prevented NIS from
[FreeBSD/releng/10.2.git] / contrib / ntp / tests / libntp / g_numtohost.cpp
1 #include "g_libntptest.h"
2
3 class numtohostTest : public libntptest {
4 };
5
6 TEST_F(numtohostTest, LoopbackNetNonResolve) {
7         /* A loopback address in 127.0.0.0/8 is chosen, and
8          * numtohost() should not try to resolve it unless
9          * it is 127.0.0.1
10          */
11
12         u_int32 input = 127*256*256*256 + 1*256 + 1; // 127.0.1.1
13         
14         EXPECT_STREQ("127.0.1.1", numtohost(htonl(input)));
15 }