xref: /netbsd-src/external/bsd/ntp/dist/tests/sandbox/uglydate.c (revision cdfa2a7ef92791ba9db70a584a1d904730e6fb46)
1 /*	$NetBSD: uglydate.c,v 1.2 2020/05/25 20:47:37 christos Exp $	*/
2 
3 #include "config.h"
4 #include "ntp_fp.h"
5 #include "unity.h"
6 
7 #include "ntp_stdlib.h"
8 
9 //#include "libntptest.h"
10 
11 void setUp(void);
12 void test_ConstantDateTime(void);
13 
14 
15 void
setUp(void)16 setUp(void)
17 {
18 	init_lib();
19 
20 	return;
21 }
22 
23 
24 void
test_ConstantDateTime(void)25 test_ConstantDateTime(void)
26 {
27 	const u_int32 HALF = 2147483648UL;
28 
29 	l_fp e_time = {{3485080800UL}, HALF}; // 2010-06-09 14:00:00.5
30 
31 	TEST_ASSERT_EQUAL_STRING("3485080800.500000 10:159:14:00:00.500",
32 				 uglydate(&e_time));
33 }
34