]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - contrib/ntp/tests/libntp/numtohost.c
Upgrade NTP to 4.2.8p4.
[FreeBSD/releng/10.2.git] / contrib / ntp / tests / libntp / numtohost.c
1 #include "config.h"
2
3 #include "ntp_stdlib.h"
4 #include "ntp_fp.h"
5
6 #include "unity.h"
7
8 void test_LoopbackNetNonResolve(void);
9
10 void
11 test_LoopbackNetNonResolve(void) {
12         /* A loopback address in 127.0.0.0/8 is chosen, and
13          * numtohost() should not try to resolve it unless
14          * it is 127.0.0.1
15          */
16
17         const u_int32 input = 127*256*256*256 + 1*256 + 1; // 127.0.1.1
18         
19         TEST_ASSERT_EQUAL_STRING("127.0.1.1", numtohost(htonl(input)));
20 }