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