diff options
author | Gianfranco Costamagna <costamagna.gianfranco@gmail.com> | 2019-04-27 09:42:24 +0200 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2019-04-29 10:13:57 -0700 |
commit | c0451eae2e7068605033c1afb7f51ec8d331019f (patch) | |
tree | 4e89a502f37ac09dc83148a57c62532f36a4d30f /meta-oe/recipes-support/cpprest | |
parent | b4da295a67865a3eefbdd99cf7de98bbff516205 (diff) | |
download | meta-openembedded-c0451eae2e7068605033c1afb7f51ec8d331019f.tar.gz |
cpprest: update to 2.10.13, drop 32bit build fix upstream
Add back test disables from Debian, they are still needed with the network access disabled
Signed-off-by: Gianfranco Costamagna <locutusofborg@debian.org>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-support/cpprest')
-rw-r--r-- | meta-oe/recipes-support/cpprest/cpprest/1094.patch | 307 | ||||
-rw-r--r-- | meta-oe/recipes-support/cpprest/cpprest/disable-float-tests.patch | 25 | ||||
-rw-r--r-- | meta-oe/recipes-support/cpprest/cpprest/disable-outside-tests.patch | 138 | ||||
-rw-r--r-- | meta-oe/recipes-support/cpprest/cpprest_2.10.13.bb (renamed from meta-oe/recipes-support/cpprest/cpprest_2.10.12.bb) | 7 |
4 files changed, 167 insertions, 310 deletions
diff --git a/meta-oe/recipes-support/cpprest/cpprest/1094.patch b/meta-oe/recipes-support/cpprest/cpprest/1094.patch deleted file mode 100644 index 3daad97f06..0000000000 --- a/meta-oe/recipes-support/cpprest/cpprest/1094.patch +++ /dev/null | |||
@@ -1,307 +0,0 @@ | |||
1 | From d672de675a16e5ab9efcf783705cbd171f38188e Mon Sep 17 00:00:00 2001 | ||
2 | From: "Billy O'Neal (VC LIBS)" <bion@microsoft.com> | ||
3 | Date: Thu, 28 Mar 2019 15:17:12 -0700 | ||
4 | Subject: [PATCH] Avoid tripping over 32 bit time_t mistakes. | ||
5 | |||
6 | Resolves https://github.com/Microsoft/cpprestsdk/issues/1090 | ||
7 | --- | ||
8 | Release/src/utilities/asyncrt_utils.cpp | 30 ++--- | ||
9 | Release/tests/functional/utils/datetime.cpp | 140 ++++++++++---------- | ||
10 | 2 files changed, 84 insertions(+), 86 deletions(-) | ||
11 | |||
12 | diff --git a/Release/src/utilities/asyncrt_utils.cpp b/Release/src/utilities/asyncrt_utils.cpp | ||
13 | index 4a692e5fa..986b64bb7 100644 | ||
14 | --- a/Release/src/utilities/asyncrt_utils.cpp | ||
15 | +++ b/Release/src/utilities/asyncrt_utils.cpp | ||
16 | @@ -618,7 +618,7 @@ std::string __cdecl conversions::to_utf8string(const utf16string& value) { retur | ||
17 | |||
18 | utf16string __cdecl conversions::to_utf16string(const std::string& value) { return utf8_to_utf16(value); } | ||
19 | |||
20 | -static const uint64_t ntToUnixOffsetSeconds = 11644473600U; // diff between windows and unix epochs (seconds) | ||
21 | +static const int64_t ntToUnixOffsetSeconds = 11644473600; // diff between windows and unix epochs (seconds) | ||
22 | |||
23 | datetime __cdecl datetime::utc_now() | ||
24 | { | ||
25 | @@ -634,10 +634,10 @@ datetime __cdecl datetime::utc_now() | ||
26 | #else // LINUX | ||
27 | struct timeval time; | ||
28 | gettimeofday(&time, nullptr); | ||
29 | - uint64_t result = ntToUnixOffsetSeconds + time.tv_sec; | ||
30 | + int64_t result = ntToUnixOffsetSeconds + time.tv_sec; | ||
31 | result *= _secondTicks; // convert to 10e-7 | ||
32 | result += time.tv_usec * 10; // convert and add microseconds, 10e-6 to 10e-7 | ||
33 | - return datetime(result); | ||
34 | + return datetime(static_cast<interval_type>(result)); | ||
35 | #endif | ||
36 | } | ||
37 | |||
38 | @@ -646,7 +646,7 @@ static const char monthNames[] = "Jan\0Feb\0Mar\0Apr\0May\0Jun\0Jul\0Aug\0Sep\0O | ||
39 | |||
40 | utility::string_t datetime::to_string(date_format format) const | ||
41 | { | ||
42 | - const uint64_t input = m_interval / _secondTicks; // convert to seconds | ||
43 | + const int64_t input = static_cast<int64_t>(m_interval / _secondTicks); // convert to seconds | ||
44 | const int frac_sec = static_cast<int>(m_interval % _secondTicks); | ||
45 | const time_t time = static_cast<time_t>(input - ntToUnixOffsetSeconds); | ||
46 | struct tm t; | ||
47 | @@ -797,22 +797,20 @@ static int atoi2(const CharT* str) | ||
48 | return (static_cast<unsigned char>(str[0]) - '0') * 10 + (static_cast<unsigned char>(str[1]) - '0'); | ||
49 | } | ||
50 | |||
51 | -static const time_t maxTimeT = sizeof(time_t) == 4 ? (time_t)INT_MAX : (time_t)LLONG_MAX; | ||
52 | - | ||
53 | -static time_t timezone_adjust(time_t result, unsigned char chSign, int adjustHours, int adjustMinutes) | ||
54 | +static int64_t timezone_adjust(int64_t result, unsigned char chSign, int adjustHours, int adjustMinutes) | ||
55 | { | ||
56 | if (adjustHours > 23) | ||
57 | { | ||
58 | - return (time_t)-1; | ||
59 | + return -1; | ||
60 | } | ||
61 | |||
62 | // adjustMinutes > 59 is impossible due to digit 5 check | ||
63 | const int tzAdjust = adjustMinutes * 60 + adjustHours * 60 * 60; | ||
64 | if (chSign == '-') | ||
65 | { | ||
66 | - if (maxTimeT - result < tzAdjust) | ||
67 | + if (INT64_MAX - result < tzAdjust) | ||
68 | { | ||
69 | - return (time_t)-1; | ||
70 | + return -1; | ||
71 | } | ||
72 | |||
73 | result += tzAdjust; | ||
74 | @@ -821,7 +819,7 @@ static time_t timezone_adjust(time_t result, unsigned char chSign, int adjustHou | ||
75 | { | ||
76 | if (tzAdjust > result) | ||
77 | { | ||
78 | - return (time_t)-1; | ||
79 | + return -1; | ||
80 | } | ||
81 | |||
82 | result -= tzAdjust; | ||
83 | @@ -830,10 +828,10 @@ static time_t timezone_adjust(time_t result, unsigned char chSign, int adjustHou | ||
84 | return result; | ||
85 | } | ||
86 | |||
87 | -static time_t make_gm_time(struct tm* t) | ||
88 | +static int64_t make_gm_time(struct tm* t) | ||
89 | { | ||
90 | #ifdef _MSC_VER | ||
91 | - return _mkgmtime(t); | ||
92 | + return static_cast<int64_t>(_mkgmtime(t)); | ||
93 | #elif (defined(ANDROID) || defined(__ANDROID__)) | ||
94 | // HACK: The (nonportable?) POSIX function timegm is not available in | ||
95 | // bionic. As a workaround[1][2], we set the C library timezone to | ||
96 | @@ -867,9 +865,9 @@ static time_t make_gm_time(struct tm* t) | ||
97 | unsetenv("TZ"); | ||
98 | } | ||
99 | } | ||
100 | - return time; | ||
101 | + return static_cast<int64_t>(time); | ||
102 | #else // ^^^ ANDROID // Other POSIX platforms vvv | ||
103 | - return timegm(t); | ||
104 | + return static_cast<int64_t>(timegm(t)); | ||
105 | #endif // _MSC_VER | ||
106 | } | ||
107 | |||
108 | @@ -916,7 +914,7 @@ zone = "UT" / "GMT" ; Universal Time | ||
109 | datetime __cdecl datetime::from_string(const utility::string_t& dateString, date_format format) | ||
110 | { | ||
111 | datetime result; | ||
112 | - time_t seconds; | ||
113 | + int64_t seconds; | ||
114 | uint64_t frac_sec = 0; | ||
115 | struct tm t{}; | ||
116 | auto str = dateString.c_str(); | ||
117 | diff --git a/Release/tests/functional/utils/datetime.cpp b/Release/tests/functional/utils/datetime.cpp | ||
118 | index ae7f7a5e4..acd6fddb0 100644 | ||
119 | --- a/Release/tests/functional/utils/datetime.cpp | ||
120 | +++ b/Release/tests/functional/utils/datetime.cpp | ||
121 | @@ -133,75 +133,77 @@ SUITE(datetime) | ||
122 | |||
123 | TEST(parsing_time_rfc1123_accepts_each_day) | ||
124 | { | ||
125 | - TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 00:00:00 GMT"), (time_t) 0); | ||
126 | - TestRfc1123IsTimeT(_XPLATSTR("Fri, 02 Jan 1970 00:00:00 GMT"), (time_t) 86400 * 1); | ||
127 | - TestRfc1123IsTimeT(_XPLATSTR("Sat, 03 Jan 1970 00:00:00 GMT"), (time_t) 86400 * 2); | ||
128 | - TestRfc1123IsTimeT(_XPLATSTR("Sun, 04 Jan 1970 00:00:00 GMT"), (time_t) 86400 * 3); | ||
129 | - TestRfc1123IsTimeT(_XPLATSTR("Mon, 05 Jan 1970 00:00:00 GMT"), (time_t) 86400 * 4); | ||
130 | - TestRfc1123IsTimeT(_XPLATSTR("Tue, 06 Jan 1970 00:00:00 GMT"), (time_t) 86400 * 5); | ||
131 | - TestRfc1123IsTimeT(_XPLATSTR("Wed, 07 Jan 1970 00:00:00 GMT"), (time_t) 86400 * 6); | ||
132 | + TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 00:00:00 GMT"), (time_t)0); | ||
133 | + TestRfc1123IsTimeT(_XPLATSTR("Fri, 02 Jan 1970 00:00:00 GMT"), (time_t)86400 * 1); | ||
134 | + TestRfc1123IsTimeT(_XPLATSTR("Sat, 03 Jan 1970 00:00:00 GMT"), (time_t)86400 * 2); | ||
135 | + TestRfc1123IsTimeT(_XPLATSTR("Sun, 04 Jan 1970 00:00:00 GMT"), (time_t)86400 * 3); | ||
136 | + TestRfc1123IsTimeT(_XPLATSTR("Mon, 05 Jan 1970 00:00:00 GMT"), (time_t)86400 * 4); | ||
137 | + TestRfc1123IsTimeT(_XPLATSTR("Tue, 06 Jan 1970 00:00:00 GMT"), (time_t)86400 * 5); | ||
138 | + TestRfc1123IsTimeT(_XPLATSTR("Wed, 07 Jan 1970 00:00:00 GMT"), (time_t)86400 * 6); | ||
139 | } | ||
140 | |||
141 | TEST(parsing_time_rfc1123_boundary_cases) | ||
142 | { | ||
143 | - TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 00:00:00 GMT"), (time_t) 0); | ||
144 | - TestRfc1123IsTimeT(_XPLATSTR("19 Jan 2038 03:14:06 GMT"), (time_t) INT_MAX - 1); | ||
145 | -#ifndef _USE_32BIT_TIME_T | ||
146 | - TestRfc1123IsTimeT(_XPLATSTR("19 Jan 2038 03:13:07 -0001"), (time_t) INT_MAX); | ||
147 | - TestRfc1123IsTimeT(_XPLATSTR("19 Jan 2038 03:14:07 -0000"), (time_t) INT_MAX); | ||
148 | -#endif // _USE_32BIT_TIME_T | ||
149 | - TestRfc1123IsTimeT(_XPLATSTR("14 Jan 2019 23:16:21 +0000"), (time_t) 1547507781); | ||
150 | - TestRfc1123IsTimeT(_XPLATSTR("14 Jan 2019 23:16:21 -0001"), (time_t) 1547507841); | ||
151 | - TestRfc1123IsTimeT(_XPLATSTR("14 Jan 2019 23:16:21 +0001"), (time_t) 1547507721); | ||
152 | - TestRfc1123IsTimeT(_XPLATSTR("14 Jan 2019 23:16:21 -0100"), (time_t) 1547511381); | ||
153 | - TestRfc1123IsTimeT(_XPLATSTR("14 Jan 2019 23:16:21 +0100"), (time_t) 1547504181); | ||
154 | + TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 00:00:00 GMT"), (time_t)0); | ||
155 | + TestRfc1123IsTimeT(_XPLATSTR("19 Jan 2038 03:14:06 GMT"), (time_t)INT_MAX - 1); | ||
156 | + if (sizeof(time_t) == 8) | ||
157 | + { | ||
158 | + TestRfc1123IsTimeT(_XPLATSTR("19 Jan 2038 03:13:07 -0001"), (time_t)INT_MAX); | ||
159 | + TestRfc1123IsTimeT(_XPLATSTR("19 Jan 2038 03:14:07 -0000"), (time_t)INT_MAX); | ||
160 | + } | ||
161 | + TestRfc1123IsTimeT(_XPLATSTR("14 Jan 2019 23:16:21 +0000"), (time_t)1547507781); | ||
162 | + TestRfc1123IsTimeT(_XPLATSTR("14 Jan 2019 23:16:21 -0001"), (time_t)1547507841); | ||
163 | + TestRfc1123IsTimeT(_XPLATSTR("14 Jan 2019 23:16:21 +0001"), (time_t)1547507721); | ||
164 | + TestRfc1123IsTimeT(_XPLATSTR("14 Jan 2019 23:16:21 -0100"), (time_t)1547511381); | ||
165 | + TestRfc1123IsTimeT(_XPLATSTR("14 Jan 2019 23:16:21 +0100"), (time_t)1547504181); | ||
166 | } | ||
167 | |||
168 | TEST(parsing_time_rfc1123_uses_each_field) | ||
169 | { | ||
170 | - TestRfc1123IsTimeT(_XPLATSTR("02 Jan 1970 00:00:00 GMT"), (time_t) 86400); | ||
171 | - TestRfc1123IsTimeT(_XPLATSTR("12 Jan 1970 00:00:00 GMT"), (time_t) 950400); | ||
172 | - TestRfc1123IsTimeT(_XPLATSTR("01 Feb 1970 00:00:00 GMT"), (time_t) 2678400); | ||
173 | - TestRfc1123IsTimeT(_XPLATSTR("01 Jan 2000 00:00:00 GMT"), (time_t) 946684800); | ||
174 | -#ifndef _USE_32BIT_TIME_T | ||
175 | - TestRfc1123IsTimeT(_XPLATSTR("01 Jan 2100 00:00:00 GMT"), (time_t) 4102444800); | ||
176 | -#endif // _USE_32BIT_TIME_T | ||
177 | - TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1990 00:00:00 GMT"), (time_t) 631152000); | ||
178 | - TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1971 00:00:00 GMT"), (time_t) 31536000); | ||
179 | - TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 10:00:00 GMT"), (time_t) 36000); | ||
180 | - TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 01:00:00 GMT"), (time_t) 3600); | ||
181 | - TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 00:10:00 GMT"), (time_t) 600); | ||
182 | - TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 00:01:00 GMT"), (time_t) 60); | ||
183 | - TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 00:00:10 GMT"), (time_t) 10); | ||
184 | - TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 00:00:01 GMT"), (time_t) 1); | ||
185 | - TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 10:00:00 GMT"), (time_t) 36000); | ||
186 | - TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 02:00:00 PST"), (time_t) 36000); | ||
187 | - TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 03:00:00 PDT"), (time_t) 36000); | ||
188 | - TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 03:00:00 MST"), (time_t) 36000); | ||
189 | - TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 04:00:00 MDT"), (time_t) 36000); | ||
190 | - TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 04:00:00 CST"), (time_t) 36000); | ||
191 | - TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 05:00:00 CDT"), (time_t) 36000); | ||
192 | - TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 05:00:00 EST"), (time_t) 36000); | ||
193 | - TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 06:00:00 EDT"), (time_t) 36000); | ||
194 | - TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 06:00:00 -0400"), (time_t) 36000); | ||
195 | - TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 05:59:00 -0401"), (time_t) 36000); | ||
196 | + TestRfc1123IsTimeT(_XPLATSTR("02 Jan 1970 00:00:00 GMT"), (time_t)86400); | ||
197 | + TestRfc1123IsTimeT(_XPLATSTR("12 Jan 1970 00:00:00 GMT"), (time_t)950400); | ||
198 | + TestRfc1123IsTimeT(_XPLATSTR("01 Feb 1970 00:00:00 GMT"), (time_t)2678400); | ||
199 | + TestRfc1123IsTimeT(_XPLATSTR("01 Jan 2000 00:00:00 GMT"), (time_t)946684800); | ||
200 | + if (sizeof(time_t) == 8) | ||
201 | + { | ||
202 | + TestRfc1123IsTimeT(_XPLATSTR("01 Jan 2100 00:00:00 GMT"), (time_t)4102444800); | ||
203 | + } | ||
204 | + TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1990 00:00:00 GMT"), (time_t)631152000); | ||
205 | + TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1971 00:00:00 GMT"), (time_t)31536000); | ||
206 | + TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 10:00:00 GMT"), (time_t)36000); | ||
207 | + TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 01:00:00 GMT"), (time_t)3600); | ||
208 | + TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 00:10:00 GMT"), (time_t)600); | ||
209 | + TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 00:01:00 GMT"), (time_t)60); | ||
210 | + TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 00:00:10 GMT"), (time_t)10); | ||
211 | + TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 00:00:01 GMT"), (time_t)1); | ||
212 | + TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 10:00:00 GMT"), (time_t)36000); | ||
213 | + TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 02:00:00 PST"), (time_t)36000); | ||
214 | + TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 03:00:00 PDT"), (time_t)36000); | ||
215 | + TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 03:00:00 MST"), (time_t)36000); | ||
216 | + TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 04:00:00 MDT"), (time_t)36000); | ||
217 | + TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 04:00:00 CST"), (time_t)36000); | ||
218 | + TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 05:00:00 CDT"), (time_t)36000); | ||
219 | + TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 05:00:00 EST"), (time_t)36000); | ||
220 | + TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 06:00:00 EDT"), (time_t)36000); | ||
221 | + TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 06:00:00 -0400"), (time_t)36000); | ||
222 | + TestRfc1123IsTimeT(_XPLATSTR("01 Jan 1970 05:59:00 -0401"), (time_t)36000); | ||
223 | } | ||
224 | |||
225 | TEST(parsing_time_rfc1123_max_days) | ||
226 | { | ||
227 | - TestRfc1123IsTimeT(_XPLATSTR("31 Jan 1970 00:00:00 GMT"), (time_t) 2592000); | ||
228 | - TestRfc1123IsTimeT(_XPLATSTR("28 Feb 2019 00:00:00 GMT"), (time_t) 1551312000); // non leap year allows feb 28 | ||
229 | - TestRfc1123IsTimeT(_XPLATSTR("29 Feb 2020 00:00:00 GMT"), (time_t) 1582934400); // leap year allows feb 29 | ||
230 | - TestRfc1123IsTimeT(_XPLATSTR("31 Mar 1970 00:00:00 GMT"), (time_t) 7689600); | ||
231 | - TestRfc1123IsTimeT(_XPLATSTR("30 Apr 1970 00:00:00 GMT"), (time_t) 10281600); | ||
232 | - TestRfc1123IsTimeT(_XPLATSTR("31 May 1970 00:00:00 GMT"), (time_t) 12960000); | ||
233 | - TestRfc1123IsTimeT(_XPLATSTR("30 Jun 1970 00:00:00 GMT"), (time_t) 15552000); | ||
234 | - TestRfc1123IsTimeT(_XPLATSTR("31 Jul 1970 00:00:00 GMT"), (time_t) 18230400); | ||
235 | - TestRfc1123IsTimeT(_XPLATSTR("31 Aug 1970 00:00:00 GMT"), (time_t) 20908800); | ||
236 | - TestRfc1123IsTimeT(_XPLATSTR("30 Sep 1970 00:00:00 GMT"), (time_t) 23500800); | ||
237 | - TestRfc1123IsTimeT(_XPLATSTR("31 Oct 1970 00:00:00 GMT"), (time_t) 26179200); | ||
238 | - TestRfc1123IsTimeT(_XPLATSTR("30 Nov 1970 00:00:00 GMT"), (time_t) 28771200); | ||
239 | - TestRfc1123IsTimeT(_XPLATSTR("31 Dec 1970 00:00:00 GMT"), (time_t) 31449600); | ||
240 | + TestRfc1123IsTimeT(_XPLATSTR("31 Jan 1970 00:00:00 GMT"), (time_t)2592000); | ||
241 | + TestRfc1123IsTimeT(_XPLATSTR("28 Feb 2019 00:00:00 GMT"), (time_t)1551312000); // non leap year allows feb 28 | ||
242 | + TestRfc1123IsTimeT(_XPLATSTR("29 Feb 2020 00:00:00 GMT"), (time_t)1582934400); // leap year allows feb 29 | ||
243 | + TestRfc1123IsTimeT(_XPLATSTR("31 Mar 1970 00:00:00 GMT"), (time_t)7689600); | ||
244 | + TestRfc1123IsTimeT(_XPLATSTR("30 Apr 1970 00:00:00 GMT"), (time_t)10281600); | ||
245 | + TestRfc1123IsTimeT(_XPLATSTR("31 May 1970 00:00:00 GMT"), (time_t)12960000); | ||
246 | + TestRfc1123IsTimeT(_XPLATSTR("30 Jun 1970 00:00:00 GMT"), (time_t)15552000); | ||
247 | + TestRfc1123IsTimeT(_XPLATSTR("31 Jul 1970 00:00:00 GMT"), (time_t)18230400); | ||
248 | + TestRfc1123IsTimeT(_XPLATSTR("31 Aug 1970 00:00:00 GMT"), (time_t)20908800); | ||
249 | + TestRfc1123IsTimeT(_XPLATSTR("30 Sep 1970 00:00:00 GMT"), (time_t)23500800); | ||
250 | + TestRfc1123IsTimeT(_XPLATSTR("31 Oct 1970 00:00:00 GMT"), (time_t)26179200); | ||
251 | + TestRfc1123IsTimeT(_XPLATSTR("30 Nov 1970 00:00:00 GMT"), (time_t)28771200); | ||
252 | + TestRfc1123IsTimeT(_XPLATSTR("31 Dec 1970 00:00:00 GMT"), (time_t)31449600); | ||
253 | } | ||
254 | |||
255 | TEST(parsing_time_rfc1123_invalid_cases) | ||
256 | @@ -266,7 +268,7 @@ SUITE(datetime) | ||
257 | _XPLATSTR("Thu, 01 Jan 1970 00:00:00 G"), | ||
258 | _XPLATSTR("Thu, 01 Jan 1970 00:00:00 GM"), | ||
259 | _XPLATSTR("Fri, 01 Jan 1970 00:00:00 GMT"), // wrong day | ||
260 | - _XPLATSTR("01 Jan 4970 00:00:00 GMT"), // year too big | ||
261 | + _XPLATSTR("01 Jan 4970 00:00:00 GMT"), // year too big | ||
262 | _XPLATSTR("01 Jan 3001 00:00:00 GMT"), | ||
263 | _XPLATSTR("01 Xxx 1971 00:00:00 GMT"), // month bad | ||
264 | _XPLATSTR("00 Jan 1971 00:00:00 GMT"), // day too small | ||
265 | @@ -288,8 +290,8 @@ SUITE(datetime) | ||
266 | _XPLATSTR("01 Jan 1971 00:60:00 GMT"), // minute too big | ||
267 | _XPLATSTR("01 Jan 1971 00:00:70 GMT"), // second too big | ||
268 | _XPLATSTR("01 Jan 1971 00:00:61 GMT"), | ||
269 | - _XPLATSTR("01 Jan 1969 00:00:00 GMT"), // underflow | ||
270 | - _XPLATSTR("01 Jan 1969 00:00:00 CEST"), // bad tz | ||
271 | + _XPLATSTR("01 Jan 1969 00:00:00 GMT"), // underflow | ||
272 | + _XPLATSTR("01 Jan 1969 00:00:00 CEST"), // bad tz | ||
273 | _XPLATSTR("01 Jan 1970 00:00:00 +2400"), // bad tzoffsets | ||
274 | _XPLATSTR("01 Jan 1970 00:00:00 -3000"), | ||
275 | _XPLATSTR("01 Jan 1970 00:00:00 +2160"), | ||
276 | @@ -309,11 +311,12 @@ SUITE(datetime) | ||
277 | // boundary cases: | ||
278 | TestDateTimeRoundtrip(_XPLATSTR("1970-01-01T00:00:00Z")); // epoch | ||
279 | TestDateTimeRoundtrip(_XPLATSTR("2038-01-19T03:14:06+00:00"), _XPLATSTR("2038-01-19T03:14:06Z")); // INT_MAX - 1 | ||
280 | -#ifndef _USE_32BIT_TIME_T | ||
281 | - TestDateTimeRoundtrip(_XPLATSTR("2038-01-19T03:13:07-00:01"), | ||
282 | - _XPLATSTR("2038-01-19T03:14:07Z")); // INT_MAX after subtacting 1 | ||
283 | - TestDateTimeRoundtrip(_XPLATSTR("2038-01-19T03:14:07-00:00"), _XPLATSTR("2038-01-19T03:14:07Z")); | ||
284 | -#endif // _USE_32BIT_TIME_T | ||
285 | + if (sizeof(time_t) == 8) | ||
286 | + { | ||
287 | + TestDateTimeRoundtrip(_XPLATSTR("2038-01-19T03:13:07-00:01"), | ||
288 | + _XPLATSTR("2038-01-19T03:14:07Z")); // INT_MAX after subtacting 1 | ||
289 | + TestDateTimeRoundtrip(_XPLATSTR("2038-01-19T03:14:07-00:00"), _XPLATSTR("2038-01-19T03:14:07Z")); | ||
290 | + } | ||
291 | } | ||
292 | |||
293 | TEST(parsing_time_iso8601_uses_each_timezone_digit) | ||
294 | @@ -456,11 +459,8 @@ SUITE(datetime) | ||
295 | _XPLATSTR("1971-01-01T00:60:00Z"), // minute too big | ||
296 | _XPLATSTR("1971-01-01T00:00:70Z"), // second too big | ||
297 | _XPLATSTR("1971-01-01T00:00:61Z"), | ||
298 | - _XPLATSTR("1969-01-01T00:00:00Z"), // underflow | ||
299 | -#ifdef _USE_32BIT_TIME_T | ||
300 | - _XPLATSTR("3000-01-01T00:00:01Z"), // overflow | ||
301 | -#endif | ||
302 | - _XPLATSTR("3001-01-01T00:00:00Z"), | ||
303 | + _XPLATSTR("1969-01-01T00:00:00Z"), // underflow | ||
304 | + _XPLATSTR("3001-01-01T00:00:00Z"), // overflow | ||
305 | _XPLATSTR("1970-01-01T00:00:00+00:01"), // time zone underflow | ||
306 | // _XPLATSTR("1970-01-01T00:00:00.Z"), // accepted as invalid timezone above | ||
307 | _XPLATSTR("1970-01-01T00:00:00+24:00"), // bad tzoffsets | ||
diff --git a/meta-oe/recipes-support/cpprest/cpprest/disable-float-tests.patch b/meta-oe/recipes-support/cpprest/cpprest/disable-float-tests.patch new file mode 100644 index 0000000000..3ff7f0dd31 --- /dev/null +++ b/meta-oe/recipes-support/cpprest/cpprest/disable-float-tests.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | Description: new toolchain might have increased the float precision | ||
2 | Author: Gianfranco Costamagna <locutusofborg@debian.org> | ||
3 | Last-Update: 2017-10-28 | ||
4 | Forwarded: https://github.com/Microsoft/cpprestsdk/issues/576 | ||
5 | |||
6 | Index: cpprest/Release/tests/functional/streams/istream_tests.cpp | ||
7 | =================================================================== | ||
8 | --- cpprest.orig/Release/tests/functional/streams/istream_tests.cpp | ||
9 | +++ cpprest/Release/tests/functional/streams/istream_tests.cpp | ||
10 | @@ -1297,6 +1297,7 @@ | ||
11 | void compare_double(double expected, double actual) { compare_floating(expected, actual, DBL_EPSILON); } | ||
12 | void compare_float(float expected, float actual) { compare_floating(expected, actual, FLT_EPSILON); } | ||
13 | |||
14 | + /* | ||
15 | TEST(extract_floating_point) | ||
16 | { | ||
17 | std::string test_string; | ||
18 | @@ -1343,6 +1344,7 @@ | ||
19 | if (expected == 0) VERIFY_ARE_EQUAL(1 / expected, 1 / actual); | ||
20 | } while (!std_istream.eof()); | ||
21 | } | ||
22 | + */ | ||
23 | |||
24 | TEST(extract_floating_point_with_exceptions) | ||
25 | { | ||
diff --git a/meta-oe/recipes-support/cpprest/cpprest/disable-outside-tests.patch b/meta-oe/recipes-support/cpprest/cpprest/disable-outside-tests.patch new file mode 100644 index 0000000000..5232e2a1d8 --- /dev/null +++ b/meta-oe/recipes-support/cpprest/cpprest/disable-outside-tests.patch | |||
@@ -0,0 +1,138 @@ | |||
1 | Description: Debian forbids calls to external websites. | ||
2 | |||
3 | Author: Gianfranco Costamagna <locutus@debian.org> | ||
4 | Origin: Debian | ||
5 | Forwarded: not-needed | ||
6 | Reviewed-By: Gianfranco Costamagna <locutusofborg@debian.org> | ||
7 | Last-Update: 2015-11-25 | ||
8 | |||
9 | Index: cpprest/Release/tests/functional/http/client/CMakeLists.txt | ||
10 | =================================================================== | ||
11 | --- cpprest.orig/Release/tests/functional/http/client/CMakeLists.txt | ||
12 | +++ cpprest/Release/tests/functional/http/client/CMakeLists.txt | ||
13 | @@ -12,7 +12,6 @@ | ||
14 | multiple_requests.cpp | ||
15 | oauth1_tests.cpp | ||
16 | oauth2_tests.cpp | ||
17 | - outside_tests.cpp | ||
18 | pipeline_stage_tests.cpp | ||
19 | progress_handler_tests.cpp | ||
20 | proxy_tests.cpp | ||
21 | Index: cpprest/Release/tests/functional/http/client/authentication_tests.cpp | ||
22 | =================================================================== | ||
23 | --- cpprest.orig/Release/tests/functional/http/client/authentication_tests.cpp | ||
24 | +++ cpprest/Release/tests/functional/http/client/authentication_tests.cpp | ||
25 | @@ -675,9 +675,9 @@ | ||
26 | VERIFY_ARE_EQUAL(return_code, response.status_code()); | ||
27 | } | ||
28 | |||
29 | - TEST(auth_no_data) { auth_test_impl(false); } | ||
30 | + //TEST(auth_no_data) { auth_test_impl(false); } | ||
31 | |||
32 | - TEST(unsuccessful_auth_with_basic_cred) { auth_test_impl(true); } | ||
33 | + //TEST(unsuccessful_auth_with_basic_cred) { auth_test_impl(true); } | ||
34 | |||
35 | TEST_FIXTURE(uri_address, set_user_options_asio_http) | ||
36 | { | ||
37 | @@ -695,6 +695,7 @@ | ||
38 | VERIFY_ARE_EQUAL(200, response.status_code()); | ||
39 | } | ||
40 | |||
41 | + /* | ||
42 | TEST_FIXTURE(uri_address, set_user_options_asio_https) | ||
43 | { | ||
44 | handle_timeout([] { | ||
45 | @@ -714,6 +715,7 @@ | ||
46 | VERIFY_IS_FALSE(v.empty()); | ||
47 | }); | ||
48 | } | ||
49 | + */ | ||
50 | |||
51 | #endif | ||
52 | |||
53 | Index: cpprest/Release/tests/functional/websockets/client/authentication_tests.cpp | ||
54 | =================================================================== | ||
55 | --- cpprest.orig/Release/tests/functional/websockets/client/authentication_tests.cpp | ||
56 | +++ cpprest/Release/tests/functional/websockets/client/authentication_tests.cpp | ||
57 | @@ -93,6 +93,7 @@ | ||
58 | return false; | ||
59 | } | ||
60 | |||
61 | + /* | ||
62 | TEST(ssl_test) | ||
63 | { | ||
64 | websocket_client client; | ||
65 | @@ -127,6 +128,7 @@ | ||
66 | throw; | ||
67 | } | ||
68 | } | ||
69 | + */ | ||
70 | |||
71 | // These tests are specific to our websocketpp based implementation. | ||
72 | #if !defined(__cplusplus_winrt) | ||
73 | @@ -159,12 +161,14 @@ | ||
74 | } | ||
75 | } | ||
76 | |||
77 | + /* | ||
78 | // Test specifically for server SignalR team hit interesting cases with. | ||
79 | TEST(sni_with_older_server_test) | ||
80 | { | ||
81 | websocket_client client; | ||
82 | sni_test_impl(client); | ||
83 | } | ||
84 | + */ | ||
85 | |||
86 | // WinRT doesn't expose option for disabling. | ||
87 | // No stable server is available to reliably test this. | ||
88 | @@ -194,6 +198,7 @@ | ||
89 | } | ||
90 | } | ||
91 | |||
92 | + /* | ||
93 | // Winrt doesn't allow explicitly setting server host for SNI. | ||
94 | TEST(sni_explicit_hostname) | ||
95 | { | ||
96 | @@ -204,6 +209,7 @@ | ||
97 | websocket_client client(config); | ||
98 | sni_test_impl(client); | ||
99 | } | ||
100 | + */ | ||
101 | |||
102 | void handshake_error_test_impl(const ::utility::string_t& host) | ||
103 | { | ||
104 | @@ -225,11 +231,11 @@ | ||
105 | } | ||
106 | } | ||
107 | |||
108 | - TEST(self_signed_cert) { handshake_error_test_impl(U("wss://self-signed.badssl.com/")); } | ||
109 | + //TEST(self_signed_cert) { handshake_error_test_impl(U("wss://self-signed.badssl.com/")); } | ||
110 | |||
111 | - TEST(hostname_mismatch) { handshake_error_test_impl(U("wss://wrong.host.badssl.com/")); } | ||
112 | + //TEST(hostname_mismatch) { handshake_error_test_impl(U("wss://wrong.host.badssl.com/")); } | ||
113 | |||
114 | - TEST(cert_expired) { handshake_error_test_impl(U("wss://expired.badssl.com/")); } | ||
115 | + //TEST(cert_expired) { handshake_error_test_impl(U("wss://expired.badssl.com/")); } | ||
116 | |||
117 | #endif | ||
118 | |||
119 | Index: cpprest/Release/tests/functional/http/client/connections_and_errors.cpp | ||
120 | =================================================================== | ||
121 | --- cpprest.orig/Release/tests/functional/http/client/connections_and_errors.cpp | ||
122 | +++ cpprest/Release/tests/functional/http/client/connections_and_errors.cpp | ||
123 | @@ -406,6 +406,7 @@ | ||
124 | } | ||
125 | #endif | ||
126 | |||
127 | + /* | ||
128 | // Try to connect to a server on a closed port and cancel the operation. | ||
129 | TEST_FIXTURE(uri_address, cancel_bad_port) | ||
130 | { | ||
131 | @@ -437,6 +438,7 @@ | ||
132 | |||
133 | VERIFY_THROWS_HTTP_ERROR_CODE(t.get(), std::errc::operation_canceled); | ||
134 | } | ||
135 | + */ | ||
136 | |||
137 | } // SUITE(connections_and_errors) | ||
138 | |||
diff --git a/meta-oe/recipes-support/cpprest/cpprest_2.10.12.bb b/meta-oe/recipes-support/cpprest/cpprest_2.10.13.bb index 67edf56912..1b1265fe35 100644 --- a/meta-oe/recipes-support/cpprest/cpprest_2.10.12.bb +++ b/meta-oe/recipes-support/cpprest/cpprest_2.10.13.bb | |||
@@ -8,10 +8,11 @@ DEPENDS = "openssl websocketpp zlib boost brotli" | |||
8 | EXTRA_OECMAKE = "-DCPPREST_EXPORT_DIR=cmake -DCPPREST_EXCLUDE_BROTLI=OFF" | 8 | EXTRA_OECMAKE = "-DCPPREST_EXPORT_DIR=cmake -DCPPREST_EXCLUDE_BROTLI=OFF" |
9 | 9 | ||
10 | SRC_URI = "git://github.com/Microsoft/cpprestsdk.git;protocol=https;branch=master \ | 10 | SRC_URI = "git://github.com/Microsoft/cpprestsdk.git;protocol=https;branch=master \ |
11 | file://1094.patch " | 11 | file://disable-float-tests.patch \ |
12 | file://disable-outside-tests.patch " | ||
12 | 13 | ||
13 | # tag 2.10.12 | 14 | # tag 2.10.13 |
14 | SRCREV= "d4fb1cf7f7d22c12e2e442ba5a5e98d09b0a28ab" | 15 | SRCREV= "9d8f544001cb74544de6dc8c565592f7e2626d6e" |
15 | 16 | ||
16 | S = "${WORKDIR}/git" | 17 | S = "${WORKDIR}/git" |
17 | 18 | ||