@@ -2026,9 +2026,9 @@ test_xml(void)
2026
2026
int status ;
2027
2027
ut_unit * unit1 ;
2028
2028
ut_unit * unit2 ;
2029
- cv_converter * converter ;
2030
- char * spec ;
2031
- ut_unit * unit ;
2029
+ cv_converter * converter ;
2030
+ char * spec ;
2031
+ ut_unit * unit ;
2032
2032
2033
2033
ut_set_error_message_handler (ut_write_to_stderr );
2034
2034
xmlSystem = ut_read_xml (xmlPath );
@@ -2280,6 +2280,29 @@ test_mm2_day2_divide(void)
2280
2280
ut_free_system (xmlSystem );
2281
2281
}
2282
2282
2283
+
2284
+ test_timeResolution (void )
2285
+ {
2286
+ ut_system * xmlSystem ;
2287
+
2288
+ ut_set_error_message_handler (ut_write_to_stderr );
2289
+ xmlSystem = ut_read_xml (xmlPath );
2290
+ CU_ASSERT_PTR_NOT_NULL_FATAL (xmlSystem );
2291
+
2292
+ // Maximum temporal resolution:
2293
+ const char string [] = "day since 2001-01-01 00:00:00.000000000 UTC" ;
2294
+ ut_unit * unit = ut_parse (xmlSystem , string , UT_ASCII );
2295
+ CU_ASSERT_PTR_NOT_NULL_FATAL (unit );
2296
+
2297
+ char buf [128 ];
2298
+ int len = ut_format (unit , buf , sizeof (buf ), UT_ASCII | UT_NAMES );
2299
+ CU_ASSERT_NOT_EQUAL_FATAL (len , -1 );
2300
+ printf ("test_timeResolution() unit=\"%s\"" , buf );
2301
+ CU_ASSERT_STRING_EQUAL (buf , string );
2302
+
2303
+ ut_free (unit );
2304
+ }
2305
+
2283
2306
int
2284
2307
main (
2285
2308
const int argc ,
@@ -2331,6 +2354,7 @@ main(
2331
2354
CU_ADD_TEST (testSuite , test_parsing );
2332
2355
CU_ADD_TEST (testSuite , test_visitor );
2333
2356
CU_ADD_TEST (testSuite , test_xml );
2357
+ CU_ADD_TEST (testSuite , test_timeResolution );
2334
2358
/*
2335
2359
*/
2336
2360
0 commit comments