1 From c87a112246e0bcbd5c3a8aa484a50c617d710dbf Mon Sep 17 00:00:00 2001
2 From: Philip Withnall <philip.withnall@collabora.co.uk>
3 Date: Fri, 12 Dec 2014 17:31:01 +0000
4 Subject: [PATCH] tests: Eliminate ISO 8601 formatting workaround for dates
6 Follow up to commit 732017e4e5235e28c578cc3367fa0c4548b65495.
8 https://bugzilla.gnome.org/show_bug.cgi?id=739956
10 gdata/tests/calendar.c | 20 ++++++++++----------
11 gdata/tests/general.c | 34 +++++++++++++++++-----------------
12 gdata/tests/tasks.c | 34 +++++++++++++++++-----------------
13 gdata/tests/youtube.c | 16 ++++++++--------
14 4 files changed, 52 insertions(+), 52 deletions(-)
16 diff --git a/gdata/tests/calendar.c b/gdata/tests/calendar.c
17 index bb1d609..c54ddda 100644
18 --- a/gdata/tests/calendar.c
19 +++ b/gdata/tests/calendar.c
20 @@ -620,7 +620,7 @@ test_event_xml (void)
21 "<gCal:guestsCanInviteOthers value='false'/>"
22 "<gCal:guestsCanSeeGuests value='false'/>"
23 "<gCal:anyoneCanAddSelf value='false'/>"
24 - "<gd:when startTime='2009-04-17T15:00:00.000001+00:00' endTime='2009-04-17T17:00:00.000001+00:00'/>"
25 + "<gd:when startTime='2009-04-17T15:00:00Z' endTime='2009-04-17T17:00:00Z'/>"
26 "<gd:who email='john.smith@example.com' "
27 "rel='http://schemas.google.com/g/2005#event.organizer' "
28 "valueString='John Smith\342\200\275'/>"
29 @@ -706,7 +706,7 @@ test_event_xml_dates (void)
30 "<gCal:guestsCanSeeGuests value='false'/>"
31 "<gCal:anyoneCanAddSelf value='false'/>"
32 "<gd:when startTime='2009-04-17'/>"
33 - "<gd:when startTime='2009-04-17T15:00:00.000001+00:00'/>"
34 + "<gd:when startTime='2009-04-17T15:00:00Z'/>"
35 "<gd:when startTime='2009-04-27' endTime='2009-05-06'/>"
38 @@ -934,25 +934,25 @@ test_query_uri (void)
40 /* Check the built query URI with a normal feed URI */
41 query_uri = gdata_query_get_query_uri (GDATA_QUERY (query), "http://example.com");
42 - g_assert_cmpstr (query_uri, ==, "http://example.com?q=q&futureevents=true&orderby=starttime&recurrence-expansion-start=2009-04-17T15:00:00.000001+00:00"
43 - "&recurrence-expansion-end=2010-04-17T15:00:00.000001+00:00&singleevents=true&sortorder=descending"
44 - "&start-min=2009-04-17T15:00:00.000001+00:00&start-max=2010-04-17T15:00:00.000001+00:00&ctz=America%2FLos_Angeles&max-attendees=15"
45 + g_assert_cmpstr (query_uri, ==, "http://example.com?q=q&futureevents=true&orderby=starttime&recurrence-expansion-start=2009-04-17T15:00:00Z"
46 + "&recurrence-expansion-end=2010-04-17T15:00:00Z&singleevents=true&sortorder=descending"
47 + "&start-min=2009-04-17T15:00:00Z&start-max=2010-04-17T15:00:00Z&ctz=America%2FLos_Angeles&max-attendees=15"
51 /* …with a feed URI with a trailing slash */
52 query_uri = gdata_query_get_query_uri (GDATA_QUERY (query), "http://example.com/");
53 - g_assert_cmpstr (query_uri, ==, "http://example.com/?q=q&futureevents=true&orderby=starttime&recurrence-expansion-start=2009-04-17T15:00:00.000001+00:00"
54 - "&recurrence-expansion-end=2010-04-17T15:00:00.000001+00:00&singleevents=true&sortorder=descending"
55 - "&start-min=2009-04-17T15:00:00.000001+00:00&start-max=2010-04-17T15:00:00.000001+00:00&ctz=America%2FLos_Angeles&max-attendees=15"
56 + g_assert_cmpstr (query_uri, ==, "http://example.com/?q=q&futureevents=true&orderby=starttime&recurrence-expansion-start=2009-04-17T15:00:00Z"
57 + "&recurrence-expansion-end=2010-04-17T15:00:00Z&singleevents=true&sortorder=descending"
58 + "&start-min=2009-04-17T15:00:00Z&start-max=2010-04-17T15:00:00Z&ctz=America%2FLos_Angeles&max-attendees=15"
62 /* …with a feed URI with pre-existing arguments */
63 query_uri = gdata_query_get_query_uri (GDATA_QUERY (query), "http://example.com/bar/?test=test&this=that");
64 g_assert_cmpstr (query_uri, ==, "http://example.com/bar/?test=test&this=that&q=q&futureevents=true&orderby=starttime"
65 - "&recurrence-expansion-start=2009-04-17T15:00:00.000001+00:00&recurrence-expansion-end=2010-04-17T15:00:00.000001+00:00"
66 - "&singleevents=true&sortorder=descending&start-min=2009-04-17T15:00:00.000001+00:00&start-max=2010-04-17T15:00:00.000001+00:00"
67 + "&recurrence-expansion-start=2009-04-17T15:00:00Z&recurrence-expansion-end=2010-04-17T15:00:00Z"
68 + "&singleevents=true&sortorder=descending&start-min=2009-04-17T15:00:00Z&start-max=2010-04-17T15:00:00Z"
69 "&ctz=America%2FLos_Angeles&max-attendees=15&showdeleted=true");
72 diff --git a/gdata/tests/general.c b/gdata/tests/general.c
73 index 237a908..f828d2e 100644
74 --- a/gdata/tests/general.c
75 +++ b/gdata/tests/general.c
76 @@ -528,8 +528,8 @@ test_entry_parse_xml (void)
77 "<?xml version='1.0' encoding='UTF-8'?>"
78 "<entry xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005' xmlns:ns='http://example.com/'>"
79 "<title type='text'>Testing unhandled XML</title>"
80 - "<updated>2009-01-25T14:07:37.000001+00:00</updated>"
81 - "<published>2009-01-23T14:06:37.000001+00:00</published>"
82 + "<updated>2009-01-25T14:07:37Z</updated>"
83 + "<published>2009-01-23T14:06:37Z</published>"
84 "<content type='text'>Here we test unhandled XML elements.</content>"
85 "<foobar>Test!</foobar>"
86 "<barfoo shizzle=\"zing\"/>"
87 @@ -569,8 +569,8 @@ test_entry_parse_xml_kind_category (void)
88 "<?xml version='1.0' encoding='UTF-8'?>"
89 "<entry xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005'>"
90 "<title type='text'>Testing kind categories</title>"
91 - "<updated>2009-01-25T14:07:37.000001+00:00</updated>"
92 - "<published>2009-01-23T14:06:37.000001+00:00</published>"
93 + "<updated>2009-01-25T14:07:37Z</updated>"
94 + "<published>2009-01-23T14:06:37Z</published>"
95 "<content type='text'>Here we test kind categories.</content>"
96 "<category term='http://schemas.google.com/docs/2007#file' "
97 "scheme='http://schemas.google.com/g/2005#kind' "
98 @@ -620,7 +620,7 @@ test_entry_parse_json (void)
100 "\"title\":\"A title\","
101 "\"id\":\"some-id\","
102 - "\"updated\":\"2009-01-25T14:07:37.000001+00:00\","
103 + "\"updated\":\"2009-01-25T14:07:37Z\","
104 "\"etag\":\"some-etag\","
105 "\"selfLink\":\"http://example.com/\","
106 "\"kind\":\"kind#kind\","
107 @@ -760,8 +760,8 @@ test_entry_escaping (void)
108 "<entry xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005'>"
109 "<title type='text'>Escaped content & stuff</title>"
110 "<id>http://foo.com/?foo&bar</id>"
111 - "<updated>2010-12-10T17:21:24.000001+00:00</updated>"
112 - "<published>2010-12-10T17:21:24.000001+00:00</published>"
113 + "<updated>2010-12-10T17:21:24Z</updated>"
114 + "<published>2010-12-10T17:21:24Z</published>"
115 "<summary type='text'>Summary & stuff</summary>"
116 "<rights>Free & open source</rights>"
117 "<content type='text'>Content & things.</content>"
118 @@ -1106,7 +1106,7 @@ test_feed_escaping (void)
119 "<feed xmlns='http://www.w3.org/2005/Atom'>"
120 "<title type='text'>Test feed & stuff.</title>"
121 "<id>http://foo.com?foo&bar</id>"
122 - "<updated>2010-12-10T17:49:15.000001+00:00</updated>"
123 + "<updated>2010-12-10T17:49:15Z</updated>"
125 g_object_unref (feed);
127 @@ -1157,28 +1157,28 @@ test_query_dates (void)
129 gdata_query_set_updated_min (query, 1373280114); /* 2013-07-08T10:41:54Z */
130 query_uri = gdata_query_get_query_uri (query, "http://example.com");
131 - g_assert_cmpstr (query_uri, ==, "http://example.com?q=baz&updated-min=2013-07-08T10:41:54.000001+00:00");
132 + g_assert_cmpstr (query_uri, ==, "http://example.com?q=baz&updated-min=2013-07-08T10:41:54Z");
134 gdata_query_set_updated_min (query, -1);
137 gdata_query_set_updated_max (query, 1373280114); /* 2013-07-08T10:41:54Z */
138 query_uri = gdata_query_get_query_uri (query, "http://example.com");
139 - g_assert_cmpstr (query_uri, ==, "http://example.com?q=baz&updated-max=2013-07-08T10:41:54.000001+00:00");
140 + g_assert_cmpstr (query_uri, ==, "http://example.com?q=baz&updated-max=2013-07-08T10:41:54Z");
142 gdata_query_set_updated_max (query, -1);
145 gdata_query_set_published_min (query, 1373280114); /* 2013-07-08T10:41:54Z */
146 query_uri = gdata_query_get_query_uri (query, "http://example.com");
147 - g_assert_cmpstr (query_uri, ==, "http://example.com?q=baz&published-min=2013-07-08T10:41:54.000001+00:00");
148 + g_assert_cmpstr (query_uri, ==, "http://example.com?q=baz&published-min=2013-07-08T10:41:54Z");
150 gdata_query_set_published_min (query, -1);
153 gdata_query_set_published_max (query, 1373280114); /* 2013-07-08T10:41:54Z */
154 query_uri = gdata_query_get_query_uri (query, "http://example.com");
155 - g_assert_cmpstr (query_uri, ==, "http://example.com?q=baz&published-max=2013-07-08T10:41:54.000001+00:00");
156 + g_assert_cmpstr (query_uri, ==, "http://example.com?q=baz&published-max=2013-07-08T10:41:54Z");
158 gdata_query_set_published_max (query, -1);
160 @@ -3127,7 +3127,7 @@ test_gd_reminder (void)
161 gdata_test_assert_xml (reminder,
162 "<?xml version='1.0' encoding='UTF-8'?>"
163 "<gd:reminder xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005' "
164 - "absoluteTime='2005-06-07T00:55:00.000001+00:00' method='alert'/>");
165 + "absoluteTime='2005-06-07T00:55:00Z' method='alert'/>");
166 g_object_unref (reminder);
169 @@ -3218,8 +3218,8 @@ test_gd_when (void)
170 /* Check the outputted XML is the same */
171 gdata_test_assert_xml (when,
172 "<?xml version='1.0' encoding='UTF-8'?>"
173 - "<gd:when xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005' startTime='2005-06-07T01:00:00.000001+00:00' "
174 - "endTime='2005-06-07T02:00:00.000001+00:00'/>");
175 + "<gd:when xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005' startTime='2005-06-07T01:00:00Z' "
176 + "endTime='2005-06-07T02:00:00Z'/>");
177 g_object_unref (when);
179 /* Now parse a time with different information */
180 @@ -3258,7 +3258,7 @@ test_gd_when (void)
181 "<gd:when xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005' startTime='2005-06-06' "
182 "endTime='2005-06-08' valueString='This weekend'>"
183 "<gd:reminder minutes='15'/>"
184 - "<gd:reminder absoluteTime='2005-06-06T00:00:00.000001+00:00' method='alert'/>"
185 + "<gd:reminder absoluteTime='2005-06-06T00:00:00Z' method='alert'/>"
188 g_object_unref (when);
189 @@ -3278,7 +3278,7 @@ test_gd_when_escaping (void)
190 gdata_test_assert_xml (when,
191 "<?xml version='1.0' encoding='UTF-8'?>"
192 "<gd:when xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005' "
193 - "startTime='2005-06-07T01:00:00.000001+00:00' valueString='Value string & stuff!'/>");
194 + "startTime='2005-06-07T01:00:00Z' valueString='Value string & stuff!'/>");
195 g_object_unref (when);
198 diff --git a/gdata/tests/tasks.c b/gdata/tests/tasks.c
199 index 7a5bc7e..7bf3174 100644
200 --- a/gdata/tests/tasks.c
201 +++ b/gdata/tests/tasks.c
202 @@ -122,11 +122,11 @@ test_query_uri (void)
203 g_assert_cmpstr (query_uri, ==,
206 - "&updatedMin=1970-01-01T01:53:09.000001+00:00"
207 - "&completedMin=1970-01-01T01:34:38.000001+00:00"
208 - "&completedMax=1970-01-01T00:20:34.000001+00:00"
209 - "&dueMin=1970-01-01T00:39:05.000001+00:00"
210 - "&dueMax=1970-01-01T00:57:36.000001+00:00"
211 + "&updatedMin=1970-01-01T01:53:09Z"
212 + "&completedMin=1970-01-01T01:34:38Z"
213 + "&completedMax=1970-01-01T00:20:34Z"
214 + "&dueMin=1970-01-01T00:39:05Z"
215 + "&dueMax=1970-01-01T00:57:36Z"
216 "&showCompleted=true"
219 @@ -148,11 +148,11 @@ test_query_uri (void)
220 g_assert_cmpstr (query_uri, ==,
223 - "&updatedMin=1970-01-01T01:53:09.000001+00:00"
224 - "&completedMin=1970-01-01T01:34:38.000001+00:00"
225 - "&completedMax=1970-01-01T00:20:34.000001+00:00"
226 - "&dueMin=1970-01-01T00:39:05.000001+00:00"
227 - "&dueMax=1970-01-01T00:57:36.000001+00:00"
228 + "&updatedMin=1970-01-01T01:53:09Z"
229 + "&completedMin=1970-01-01T01:34:38Z"
230 + "&completedMax=1970-01-01T00:20:34Z"
231 + "&dueMin=1970-01-01T00:39:05Z"
232 + "&dueMax=1970-01-01T00:57:36Z"
233 "&showCompleted=false"
235 "&showHidden=false");
236 @@ -317,8 +317,8 @@ test_task_properties (void)
237 "\"title\": \"some-other-title\","
238 "\"notes\": \"more-notes\","
239 "\"status\": \"completed\","
240 - "\"due\": \"2014-08-30T17:20:00.000001+00:00\","
241 - "\"completed\": \"2014-08-30T17:20:00.000001+00:00\","
242 + "\"due\": \"2014-08-30T17:20:00Z\","
243 + "\"completed\": \"2014-08-30T17:20:00Z\","
247 @@ -332,8 +332,8 @@ test_task_properties (void)
248 "\"title\": \"some-other-title\","
249 "\"notes\": \"more-notes\","
250 "\"status\": \"completed\","
251 - "\"due\": \"2014-08-30T17:20:00.000001+00:00\","
252 - "\"completed\": \"2014-08-30T17:20:00.000001+00:00\","
253 + "\"due\": \"2014-08-30T17:20:00Z\","
254 + "\"completed\": \"2014-08-30T17:20:00Z\","
255 "\"deleted\": false,"
258 @@ -496,14 +496,14 @@ test_task_parser_normal (void)
259 "\"id\": \"some-id\","
260 "\"etag\": \"some-etag\","
261 "\"title\": \"some-title \\\"with quotes\\\"\","
262 - "\"updated\": \"2014-08-30T19:40:00.000001+00:00\","
263 + "\"updated\": \"2014-08-30T19:40:00Z\","
264 "\"selfLink\": \"http://some-uri/\","
265 "\"parent\": \"some-parent-id\","
266 "\"position\": \"some-position\","
267 "\"notes\": \"Some notes!\","
268 "\"status\": \"needsAction\","
269 - "\"due\": \"2014-08-30T20:00:00.000001+00:00\","
270 - "\"completed\": \"2014-08-30T20:10:05.000001+00:00\","
271 + "\"due\": \"2014-08-30T20:00:00Z\","
272 + "\"completed\": \"2014-08-30T20:10:05Z\","
273 "\"deleted\": false,"
275 /* Unhandled for the moment: */
276 diff --git a/gdata/tests/youtube.c b/gdata/tests/youtube.c
277 index a1e070a..1195bc3 100644
278 --- a/gdata/tests/youtube.c
279 +++ b/gdata/tests/youtube.c
280 @@ -967,8 +967,8 @@ test_parsing_yt_recorded (void)
281 "gd:etag='W/\"CEMFSX47eCp7ImA9WxVUGEw.\"'>"
282 "<title type='text'>Judas Priest - Painkiller</title>"
283 "<id>tag:youtube.com,2008:video:JAagedeKdcQ</id>"
284 - "<updated>2009-03-23T12:46:58.000001+00:00</updated>"
285 - "<published>2006-05-16T14:06:37.000001+00:00</published>"
286 + "<updated>2009-03-23T12:46:58Z</updated>"
287 + "<published>2006-05-16T14:06:37Z</published>"
288 "<category term='http://gdata.youtube.com/schemas/2007#video' scheme='http://schemas.google.com/g/2005#kind'/>"
289 "<link href='http://www.youtube.com/watch?v=JAagedeKdcQ' rel='http://www.iana.org/assignments/relation/alternate' type='text/html'/>"
290 "<link href='http://gdata.youtube.com/feeds/api/videos/JAagedeKdcQ?client=ytapi-google-jsdemo' rel='http://www.iana.org/assignments/relation/self' type='application/atom+xml'/>"
291 @@ -1055,8 +1055,8 @@ test_parsing_yt_access_control (void)
292 "gd:etag='W/\"CEMFSX47eCp7ImA9WxVUGEw.\"'>"
293 "<title type='text'>Judas Priest - Painkiller</title>"
294 "<id>tag:youtube.com,2008:video:JAagedeKdcQ</id>"
295 - "<updated>2009-03-23T12:46:58.000001+00:00</updated>"
296 - "<published>2006-05-16T14:06:37.000001+00:00</published>"
297 + "<updated>2009-03-23T12:46:58Z</updated>"
298 + "<published>2006-05-16T14:06:37Z</published>"
299 "<category term='http://gdata.youtube.com/schemas/2007#video' scheme='http://schemas.google.com/g/2005#kind'/>"
300 "<link href='http://www.youtube.com/watch?v=JAagedeKdcQ' rel='http://www.iana.org/assignments/relation/alternate' type='text/html'/>"
301 "<link href='http://gdata.youtube.com/feeds/api/videos/JAagedeKdcQ?client=ytapi-google-jsdemo' rel='http://www.iana.org/assignments/relation/self' type='application/atom+xml'/>"
302 @@ -1255,8 +1255,8 @@ test_parsing_georss_where (void)
303 "xmlns:gml='http://www.opengis.net/gml'>"
304 "<title type='text'>Some video somewhere</title>"
305 "<id>tag:youtube.com,2008:video:JAagedeKdcQ</id>"
306 - "<updated>2009-03-23T12:46:58.000001+00:00</updated>"
307 - "<published>2006-05-16T14:06:37.000001+00:00</published>"
308 + "<updated>2009-03-23T12:46:58Z</updated>"
309 + "<published>2006-05-16T14:06:37Z</published>"
310 "<category term='http://gdata.youtube.com/schemas/2007#video' scheme='http://schemas.google.com/g/2005#kind'/>"
311 "<link href='http://www.youtube.com/watch?v=JAagedeKdcQ' rel='http://www.iana.org/assignments/relation/alternate' type='text/html'/>"
312 "<link href='http://gdata.youtube.com/feeds/api/videos/JAagedeKdcQ?client=ytapi-google-jsdemo' rel='http://www.iana.org/assignments/relation/self' type='application/atom+xml'/>"
313 @@ -1295,8 +1295,8 @@ test_parsing_georss_where (void)
314 "xmlns:gml='http://www.opengis.net/gml'>"
315 "<title type='text'>Some video somewhere</title>"
316 "<id>tag:youtube.com,2008:video:JAagedeKdcQ</id>"
317 - "<updated>2009-03-23T12:46:58.000001+00:00</updated>"
318 - "<published>2006-05-16T14:06:37.000001+00:00</published>"
319 + "<updated>2009-03-23T12:46:58Z</updated>"
320 + "<published>2006-05-16T14:06:37Z</published>"
321 "<category term='http://gdata.youtube.com/schemas/2007#video' scheme='http://schemas.google.com/g/2005#kind'/>"
322 "<link href='http://www.youtube.com/watch?v=JAagedeKdcQ' rel='http://www.iana.org/assignments/relation/alternate' type='text/html'/>"
323 "<link href='http://gdata.youtube.com/feeds/api/videos/JAagedeKdcQ?client=ytapi-google-jsdemo' rel='http://www.iana.org/assignments/relation/self' type='application/atom+xml'/>"