summaryrefslogtreecommitdiff
path: root/toolchain/uclibc/patches/0.9.34-git/0001-test-disable-test-when-UCLIBC_HAS_XLOCALE-is-n.patch
blob: a13769281bb382aafe92db7fddcc0f8f17d041b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
From 7f42d10dfdfe506df0c6b4850a16da7d2ce8293a Mon Sep 17 00:00:00 2001
From: Waldemar Brodkorb <wbx@openadk.org>
Date: Thu, 28 Aug 2014 14:09:51 +0200
Subject: [PATCH 1/2] test: disable test when UCLIBC_HAS_XLOCALE is n

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

diff --git a/test/time/Makefile.in b/test/time/Makefile.in
index 05f73a4..3f1d1a1 100644
--- a/test/time/Makefile.in
+++ b/test/time/Makefile.in
@@ -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
diff --git a/test/time/tst-wcsftime.c b/test/time/tst-wcsftime.c
new file mode 100644
index 0000000..6e35f1e
--- /dev/null
+++ b/test/time/tst-wcsftime.c
@@ -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
diff --git a/test/time/tst_wcsftime.c b/test/time/tst_wcsftime.c
deleted file mode 100644
index 6e35f1e..0000000
--- a/test/time/tst_wcsftime.c
+++ /dev/null
@@ -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
-- 
1.8.5.2 (Apple Git-48)