mirror of
https://github.com/opnsense/src.git
synced 2026-04-27 09:06:49 -04:00
ntp 4.2.8p5 Reviewed by: cy, roberto Relnotes: yes Differential Revision: https://reviews.freebsd.org/D4828
36 lines
591 B
C
36 lines
591 B
C
#include "config.h"
|
|
|
|
#include "ntp_stdlib.h"
|
|
#include "ntp_fp.h"
|
|
|
|
#include "unity.h"
|
|
|
|
void setUp(void);
|
|
void test_Address(void);
|
|
void test_Netmask(void);
|
|
|
|
|
|
void
|
|
setUp(void)
|
|
{
|
|
init_lib();
|
|
|
|
return;
|
|
}
|
|
|
|
|
|
void
|
|
test_Address(void) {
|
|
const 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
|
|
const u_int32 hostOrder = 255UL*256UL*256UL*256UL + 255UL*256UL*256UL + 255UL*256UL;
|
|
const u_int32 input = htonl(hostOrder);
|
|
|
|
TEST_ASSERT_EQUAL_STRING("255.255.255.0", numtoa(input));
|
|
}
|