mirror of
https://github.com/Stichting-MINIX-Research-Foundation/netbsd.git
synced 2025-08-08 21:49:06 -04:00
34 lines
641 B
C
34 lines
641 B
C
/* $NetBSD: numtoa.c,v 1.1.1.2 2015/07/10 13:11:14 christos Exp $ */
|
|
|
|
#include "config.h"
|
|
|
|
#include "ntp_stdlib.h"
|
|
#include "ntp_calendar.h"
|
|
#include "ntp_fp.h"
|
|
|
|
#include "unity.h"
|
|
|
|
|
|
void setUp(void)
|
|
{
|
|
}
|
|
|
|
void tearDown(void)
|
|
{
|
|
}
|
|
|
|
void test_Address(void) {
|
|
u_int32 input = htonl(3221225472UL+512UL+1UL); // 192.0.2.1
|
|
|
|
TEST_ASSERT_EQUAL_STRING("192.0.2.1", numtoa(input));
|
|
}
|
|
|
|
void test_Netmask(void) {
|
|
// 255.255.255.0
|
|
u_int32 hostOrder = 255UL*256UL*256UL*256UL + 255UL*256UL*256UL + 255UL*256UL;
|
|
u_int32 input = htonl(hostOrder);
|
|
|
|
TEST_ASSERT_EQUAL_STRING("255.255.255.0", numtoa(input));
|
|
}
|
|
|