]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - contrib/ntp/tests/libntp/numtohost.c
MFC r280849,280915-280916,281015-281016,282097,282408,282415,283542,
[FreeBSD/stable/10.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