Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libutil Add tests for "12 noon", "12 midnight".



details:   https://anonhg.NetBSD.org/src/rev/80df1767c21a
branches:  trunk
changeset: 352229:80df1767c21a
user:      kre <kre%NetBSD.org@localhost>
date:      Wed Mar 22 01:50:22 2017 +0000

description:
Add tests for "12 noon", "12 midnight".

diffstat:

 tests/lib/libutil/t_parsedate.c |  22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diffs (43 lines):

diff -r 3e5a491d02cf -r 80df1767c21a tests/lib/libutil/t_parsedate.c
--- a/tests/lib/libutil/t_parsedate.c   Wed Mar 22 01:49:36 2017 +0000
+++ b/tests/lib/libutil/t_parsedate.c   Wed Mar 22 01:50:22 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_parsedate.c,v 1.28 2017/03/22 01:00:19 kre Exp $ */
+/* $NetBSD: t_parsedate.c,v 1.29 2017/03/22 01:50:22 kre Exp $ */
 /*-
  * Copyright (c) 2010, 2015 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_parsedate.c,v 1.28 2017/03/22 01:00:19 kre Exp $");
+__RCSID("$NetBSD: t_parsedate.c,v 1.29 2017/03/22 01:50:22 kre Exp $");
 
 #include <atf-c.h>
 #include <errno.h>
@@ -210,6 +210,24 @@
                ANY, ANY, ANY, 12, 0, 0);
 
        /* end 52010 bug tests */
+
+       parsecheck("12 noon", NULL, NULL, localtime_r,
+               ANY, ANY, ANY, 12, 0, 0);
+       parsecheck("12 midnight", NULL, NULL, localtime_r,
+               ANY, ANY, ANY, 0, 0, 0);
+       parsecheck("12 midday", NULL, NULL, localtime_r,        /* unlikely! */
+               ANY, ANY, ANY, 12, 0, 0);
+       parsecheck("12 mn", NULL, NULL, localtime_r,
+               ANY, ANY, ANY, 0, 0, 0);
+
+       parsecheck("12:00 noon", NULL, NULL, localtime_r,
+               ANY, ANY, ANY, 12, 0, 0);
+       parsecheck("12:00 midnight", NULL, NULL, localtime_r,
+               ANY, ANY, ANY, 0, 0, 0);
+       parsecheck("12:00:00 noon", NULL, NULL, localtime_r,
+               ANY, ANY, ANY, 12, 0, 0);
+       parsecheck("12:00:00 midnight", NULL, NULL, localtime_r,
+               ANY, ANY, ANY, 0, 0, 0);
 }
 
 ATF_TC(dsttimes);



Home | Main Index | Thread Index | Old Index