numtohost.c revision 1.1.1.2
1/*	$NetBSD: numtohost.c,v 1.1.1.2 2015/07/10 13:11:14 christos Exp $	*/
2
3#include "config.h"
4
5#include "ntp_stdlib.h"
6#include "ntp_calendar.h"
7#include "ntp_fp.h"
8
9#include "unity.h"
10
11void 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	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}
21
22