Page MenuHomeFreeBSD

D17546.id49093.diff
No OneTemporary

D17546.id49093.diff

Index: contrib/netbsd-tests/lib/libc/time/t_strptime.c
===================================================================
--- contrib/netbsd-tests/lib/libc/time/t_strptime.c
+++ contrib/netbsd-tests/lib/libc/time/t_strptime.c
@@ -99,6 +99,11 @@
#endif
}
+/*
+ * Here and below: timezone conversions are extensions, differing
+ * between implementations; skip tests.
+ */
+#ifndef __FreeBSD__
static struct {
const char *name;
long offs;
@@ -216,6 +221,7 @@
for (size_t i = 0; i < __arraycount(zt); i++)
ztest1(zt[i].name, fmt, zt[i].offs);
}
+#endif
ATF_TC(common);
@@ -228,10 +234,6 @@
ATF_TC_BODY(common, tc)
{
-#ifdef __FreeBSD__
- atf_tc_expect_fail("There are various issues with strptime on FreeBSD");
-#endif
-
h_pass("Tue Jan 20 23:27:46 1998", "%a %b %d %T %Y",
24, 46, 27, 23, 20, 0, 98, 2, 19);
h_pass("Tue Jan 20 23:27:46 1998", "%a %b %d %H:%M:%S %Y",
@@ -305,6 +307,10 @@
#else
h_pass("SaturDay", "%OA", 8, -1, -1, -1, -1, -1, -1, 6, -1);
#endif
+
+#ifdef __FreeBSD__
+ h_fail("00", "%d");
+#endif
}
ATF_TC(hour);
@@ -313,7 +319,11 @@
{
atf_tc_set_md_var(tc, "descr",
+#ifdef __FreeBSD__
+ "Checks strptime(3) hour conversions [IHl]");
+#else
"Checks strptime(3) hour conversions [IH]");
+#endif
}
ATF_TC_BODY(hour, tc)
@@ -321,6 +331,10 @@
h_fail("00", "%I");
h_fail("13", "%I");
+#ifdef __FreeBSD__
+ h_fail("00", "%l");
+ h_fail("13", "%l");
+#endif
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);
@@ -413,7 +427,18 @@
h_pass("0", "%S", 1, 0, -1, -1, -1, -1, -1, -1, -1);
h_pass("59", "%S", 2, 59, -1, -1, -1, -1, -1, -1, -1);
h_pass("60", "%S", 2, 60, -1, -1, -1, -1, -1, -1, -1);
+#ifdef __FreeBSD__
+ /*
+ * (Much) older versions of the standard (up to the Issue 6) allowed for
+ * [0;61] range in %S conversion for double-leap seconds, and it's
+ * apparently what NetBSD and glibc are expecting, however current
+ * version defines allowed values to be [0;60], and that is what our
+ * strptime() implementation expects.
+ */
+ h_fail("61", "%S");
+#else
h_pass("61", "%S", 2, 61, -1, -1, -1, -1, -1, -1, -1);
+#endif
h_fail("62", "%S");
}
@@ -440,6 +465,7 @@
h_pass("1980", "%EY", 4, -1, -1, -1, -1, -1, 80, -1, -1);
}
+#ifndef __FreeBSD__
ATF_TC(zone);
ATF_TC_HEAD(zone, tc)
@@ -469,6 +495,7 @@
{
ztest("%z");
}
+#endif
ATF_TP_ADD_TCS(tp)
{
@@ -479,8 +506,10 @@
ATF_TP_ADD_TC(tp, month);
ATF_TP_ADD_TC(tp, seconds);
ATF_TP_ADD_TC(tp, year);
+#ifndef __FreeBSD__
ATF_TP_ADD_TC(tp, zone);
ATF_TP_ADD_TC(tp, Zone);
+#endif
return atf_no_error();
}
Index: lib/libc/tests/Makefile
===================================================================
--- lib/libc/tests/Makefile
+++ lib/libc/tests/Makefile
@@ -20,6 +20,7 @@
TESTS_SUBDIRS+= string
TESTS_SUBDIRS+= sys
TESTS_SUBDIRS+= termios
+TESTS_SUBDIRS+= time
TESTS_SUBDIRS+= tls
TESTS_SUBDIRS+= ttyio

File Metadata

Mime Type
text/plain
Expires
Thu, Mar 19, 11:40 PM (16 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29985435
Default Alt Text
D17546.id49093.diff (2 KB)

Event Timeline