@@ -5,7 +5,7 @@ TESTS_DISABLED := bug-asctime bug-asctime_r time tst-mktime2 tst-posixtz \
tst-strftime tst-strptime tst-timezone
ifneq ($(UCLIBC_HAS_XLOCALE),y)
-TESTS_DISABLED += tst-ftime_l
+TESTS_DISABLED += tst-ftime_l tst-wcsftime
endif
CFLAGS_tst-strptime2 := -std=c99
new file mode 100644
@@ -0,0 +1,39 @@
+#include <stdio.h>
+#include <time.h>
+#include <features.h>
+#ifdef __UCLIBC_HAS_WCHAR__
+#include <wchar.h>
+
+int
+main (int argc, char *argv[])
+{
+ wchar_t buf[200];
+ time_t t;
+ struct tm *tp;
+ int result = 0;
+ size_t n;
+
+ time (&t);
+ tp = gmtime (&t);
+
+ n = wcsftime (buf, sizeof (buf) / sizeof (buf[0]),
+ L"%H:%M:%S %Y-%m-%d\n", tp);
+ if (n != 21)
+ result = 1;
+
+ wprintf (L"It is now %ls", buf);
+
+ wcsftime (buf, sizeof (buf) / sizeof (buf[0]), L"%A\n", tp);
+
+ wprintf (L"The weekday is %ls", buf);
+
+ return result;
+}
+
+#else
+int main(void)
+{
+ puts("Test requires WCHAR support; skipping");
+ return 0;
+}
+#endif
deleted file mode 100644
@@ -1,39 +0,0 @@
-#include <stdio.h>
-#include <time.h>
-#include <features.h>
-#ifdef __UCLIBC_HAS_WCHAR__
-#include <wchar.h>
-
-int
-main (int argc, char *argv[])
-{
- wchar_t buf[200];
- time_t t;
- struct tm *tp;
- int result = 0;
- size_t n;
-
- time (&t);
- tp = gmtime (&t);
-
- n = wcsftime (buf, sizeof (buf) / sizeof (buf[0]),
- L"%H:%M:%S %Y-%m-%d\n", tp);
- if (n != 21)
- result = 1;
-
- wprintf (L"It is now %ls", buf);
-
- wcsftime (buf, sizeof (buf) / sizeof (buf[0]), L"%A\n", tp);
-
- wprintf (L"The weekday is %ls", buf);
-
- return result;
-}
-
-#else
-int main(void)
-{
- puts("Test requires WCHAR support; skipping");
- return 0;
-}
-#endif
wcsftime() is only implemented when locale support in uClibc is activated. So test will always fail when locale is deactivated by the user. Rename file name to be consistent with other test file names. Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> --- test/time/Makefile.in | 2 +- test/time/tst-wcsftime.c | 39 +++++++++++++++++++++++++++++++++++++++ test/time/tst_wcsftime.c | 39 --------------------------------------- 3 files changed, 40 insertions(+), 40 deletions(-) create mode 100644 test/time/tst-wcsftime.c delete mode 100644 test/time/tst_wcsftime.c