xref: /netbsd-src/external/bsd/ntp/dist/tests/libntp/uglydate.c (revision cdfa2a7ef92791ba9db70a584a1d904730e6fb46)
1 /*	$NetBSD: uglydate.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_fp.h"
7 
8 #include "unity.h"
9 
10 void setUp(void);
11 void test_ConstantDateTime(void);
12 
13 
14 void
setUp(void)15 setUp(void)
16 {
17 	init_lib();
18 
19 	return;
20 }
21 
22 void
test_ConstantDateTime(void)23 test_ConstantDateTime(void)
24 {
25 	const u_int32 HALF = 2147483648UL;
26 
27 	l_fp e_time = {{3485080800UL}, HALF}; /* 2010-06-09 14:00:00.5 */
28 
29 	TEST_ASSERT_EQUAL_STRING("3485080800.500000 10:159:14:00:00.500",
30 				 uglydate(&e_time));
31 	return;
32 }
33