diff --git a/tests/lib/libc/time/t_strptime.c b/tests/lib/libc/time/t_strptime.c index 8f3f9b7dfe66..cfe56a600003 100644 --- a/tests/lib/libc/time/t_strptime.c +++ b/tests/lib/libc/time/t_strptime.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_strptime.c,v 1.4 2015/04/22 13:15:30 ginsbach Exp $ */ +/* $NetBSD: t_strptime.c,v 1.5 2015/04/28 16:06:09 ginsbach Exp $ */ /*- * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_strptime.c,v 1.4 2015/04/22 13:15:30 ginsbach Exp $"); +__RCSID("$NetBSD: t_strptime.c,v 1.5 2015/04/28 16:06:09 ginsbach Exp $"); #include @@ -158,6 +158,28 @@ ATF_TC_BODY(day, tc) h_fail("SaturDay", "%OA"); } +ATF_TC(hour); + +ATF_TC_HEAD(hour, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Checks strptime(3) hour conversions [IH]"); +} + +ATF_TC_BODY(hour, tc) +{ + + h_fail("00", "%I"); + h_fail("13", "%I"); + + h_pass("00", "%H", 2, -1, -1, 0, -1, -1, -1, -1, -1); + h_pass("12", "%H", 2, -1, -1, 12, -1, -1, -1, -1, -1); + h_pass("23", "%H", 2, -1, -1, 23, -1, -1, -1, -1, -1); + h_fail("24", "%H"); +} + + ATF_TC(month); ATF_TC_HEAD(month, tc) @@ -274,6 +296,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, common); ATF_TP_ADD_TC(tp, day); + ATF_TP_ADD_TC(tp, hour); ATF_TP_ADD_TC(tp, month); ATF_TP_ADD_TC(tp, seconds); ATF_TP_ADD_TC(tp, year);