xref: /netbsd-src/external/bsd/ntp/dist/tests/libntp/prettydate.c (revision cdfa2a7ef92791ba9db70a584a1d904730e6fb46)
1 /*	$NetBSD: prettydate.c,v 1.2 2020/05/25 20:47:36 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 
11 void setUp(void);
12 void test_ConstantDate(void);
13 
14 
15 void
setUp(void)16 setUp(void)
17 {
18 	init_lib();
19 
20 	return;
21 }
22 
23 
24 void
test_ConstantDate(void)25 test_ConstantDate(void) {
26 	const u_int32 HALF = 2147483648UL;
27 
28 	l_fp e_time = {{3485080800UL}, HALF}; /* 2010-06-09 14:00:00.5 */
29 
30 	TEST_ASSERT_EQUAL_STRING("cfba1ce0.80000000  Wed, Jun  9 2010 14:00:00.500",
31 		gmprettydate(&e_time));
32 	return;
33 }
34