1 /* marshalling-test.c generated by valac 0.48.11, the Vala compiler
2  * generated from marshalling-test.vala, do not modify */
3 
4 /* marshalling-test.vala
5  *
6  * Copyright © 2011 Michal Hruby <michal.mhr@gmail.com>
7  * Copyright © 2011 Canonical Ltd.
8  *             By Siegfried-A. Gevatter <siegfried.gevatter@collabora.co.uk>
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU Lesser General Public License as published by
12  * the Free Software Foundation, either version 2.1 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
22  *
23  */
24 
25 #include <stdlib.h>
26 #include <string.h>
27 #include <glib.h>
28 #include "zeitgeist-datamodel.h"
29 
30 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
31 #define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
32 #define _g_ptr_array_unref0(var) ((var == NULL) ? NULL : (var = (g_ptr_array_unref (var), NULL)))
33 #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
34 #define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
35 #define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
36 #define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
37 #define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
38 
39 gint _vala_main (gchar** argv,
40                  gint argv_length1);
41 void subject_test (void);
42 static void _subject_test_gtest_func (void);
43 void event_test (void);
44 static void _event_test_gtest_func (void);
45 void events_test (void);
46 static void _events_test_gtest_func (void);
47 void timerange_test (void);
48 static void _timerange_test_gtest_func (void);
49 void corrupt_events_test (void);
50 static void _corrupt_events_test_gtest_func (void);
51 void corrupt_subjects_test (void);
52 static void _corrupt_subjects_test_gtest_func (void);
53 void corrupt_timerange_test (void);
54 static void _corrupt_timerange_test_gtest_func (void);
55 ZeitgeistSubject* create_subject (void);
56 ZeitgeistEvent* create_event (void);
57 static void _g_object_unref0_ (gpointer var);
58 static void _vala_array_destroy (gpointer array,
59                           gint array_length,
60                           GDestroyNotify destroy_func);
61 static void _vala_array_free (gpointer array,
62                        gint array_length,
63                        GDestroyNotify destroy_func);
64 
65 static void
_subject_test_gtest_func(void)66 _subject_test_gtest_func (void)
67 {
68 #line 29 "marshalling-test.vala"
69 	subject_test ();
70 #line 71 "marshalling-test.c"
71 }
72 
73 static void
_event_test_gtest_func(void)74 _event_test_gtest_func (void)
75 {
76 #line 30 "marshalling-test.vala"
77 	event_test ();
78 #line 79 "marshalling-test.c"
79 }
80 
81 static void
_events_test_gtest_func(void)82 _events_test_gtest_func (void)
83 {
84 #line 31 "marshalling-test.vala"
85 	events_test ();
86 #line 87 "marshalling-test.c"
87 }
88 
89 static void
_timerange_test_gtest_func(void)90 _timerange_test_gtest_func (void)
91 {
92 #line 32 "marshalling-test.vala"
93 	timerange_test ();
94 #line 95 "marshalling-test.c"
95 }
96 
97 static void
_corrupt_events_test_gtest_func(void)98 _corrupt_events_test_gtest_func (void)
99 {
100 #line 33 "marshalling-test.vala"
101 	corrupt_events_test ();
102 #line 103 "marshalling-test.c"
103 }
104 
105 static void
_corrupt_subjects_test_gtest_func(void)106 _corrupt_subjects_test_gtest_func (void)
107 {
108 #line 34 "marshalling-test.vala"
109 	corrupt_subjects_test ();
110 #line 111 "marshalling-test.c"
111 }
112 
113 static void
_corrupt_timerange_test_gtest_func(void)114 _corrupt_timerange_test_gtest_func (void)
115 {
116 #line 35 "marshalling-test.vala"
117 	corrupt_timerange_test ();
118 #line 119 "marshalling-test.c"
119 }
120 
121 gint
_vala_main(gchar ** argv,gint argv_length1)122 _vala_main (gchar** argv,
123             gint argv_length1)
124 {
125 	gint result = 0;
126 #line 27 "marshalling-test.vala"
127 	g_test_init ((gint*) (&argv_length1), &argv, NULL);
128 #line 29 "marshalling-test.vala"
129 	g_test_add_func ("/Marshalling/subjects", _subject_test_gtest_func);
130 #line 30 "marshalling-test.vala"
131 	g_test_add_func ("/Marshalling/event", _event_test_gtest_func);
132 #line 31 "marshalling-test.vala"
133 	g_test_add_func ("/Marshalling/events", _events_test_gtest_func);
134 #line 32 "marshalling-test.vala"
135 	g_test_add_func ("/Marshalling/timerange", _timerange_test_gtest_func);
136 #line 33 "marshalling-test.vala"
137 	g_test_add_func ("/Marshalling/corrupt_events", _corrupt_events_test_gtest_func);
138 #line 34 "marshalling-test.vala"
139 	g_test_add_func ("/Marshalling/corrupt_subjects", _corrupt_subjects_test_gtest_func);
140 #line 35 "marshalling-test.vala"
141 	g_test_add_func ("/Marshalling/corrupt_timerange", _corrupt_timerange_test_gtest_func);
142 #line 37 "marshalling-test.vala"
143 	result = g_test_run ();
144 #line 37 "marshalling-test.vala"
145 	return result;
146 #line 147 "marshalling-test.c"
147 }
148 
149 int
main(int argc,char ** argv)150 main (int argc,
151       char ** argv)
152 {
153 #line 25 "marshalling-test.vala"
154 	return _vala_main (argv, argc);
155 #line 156 "marshalling-test.c"
156 }
157 
158 ZeitgeistSubject*
create_subject(void)159 create_subject (void)
160 {
161 	ZeitgeistSubject* s = NULL;
162 	ZeitgeistSubject* _tmp0_;
163 	ZeitgeistSubject* result = NULL;
164 #line 42 "marshalling-test.vala"
165 	_tmp0_ = zeitgeist_subject_new ();
166 #line 42 "marshalling-test.vala"
167 	s = _tmp0_;
168 #line 43 "marshalling-test.vala"
169 	zeitgeist_subject_set_uri (s, "scheme:///uri");
170 #line 44 "marshalling-test.vala"
171 	zeitgeist_subject_set_interpretation (s, "subject_interpretation_uri");
172 #line 45 "marshalling-test.vala"
173 	zeitgeist_subject_set_manifestation (s, "subject_manifestation_uri");
174 #line 46 "marshalling-test.vala"
175 	zeitgeist_subject_set_mimetype (s, "text/plain");
176 #line 47 "marshalling-test.vala"
177 	zeitgeist_subject_set_origin (s, "scheme:///");
178 #line 48 "marshalling-test.vala"
179 	zeitgeist_subject_set_text (s, "Human readable text");
180 #line 49 "marshalling-test.vala"
181 	zeitgeist_subject_set_storage (s, "");
182 #line 50 "marshalling-test.vala"
183 	zeitgeist_subject_set_current_uri (s, "scheme:///uri");
184 #line 52 "marshalling-test.vala"
185 	result = s;
186 #line 52 "marshalling-test.vala"
187 	return result;
188 #line 189 "marshalling-test.c"
189 }
190 
191 ZeitgeistEvent*
create_event(void)192 create_event (void)
193 {
194 	ZeitgeistEvent* e = NULL;
195 	ZeitgeistEvent* _tmp0_;
196 	ZeitgeistEvent* result = NULL;
197 #line 57 "marshalling-test.vala"
198 	_tmp0_ = zeitgeist_event_new ();
199 #line 57 "marshalling-test.vala"
200 	e = _tmp0_;
201 #line 58 "marshalling-test.vala"
202 	zeitgeist_event_set_id (e, (guint32) 1234);
203 #line 59 "marshalling-test.vala"
204 	zeitgeist_event_set_timestamp (e, (gint64) 1234567890L);
205 #line 60 "marshalling-test.vala"
206 	zeitgeist_event_set_interpretation (e, "interpretation_uri");
207 #line 61 "marshalling-test.vala"
208 	zeitgeist_event_set_manifestation (e, "manifestation_uri");
209 #line 62 "marshalling-test.vala"
210 	zeitgeist_event_set_actor (e, "test.desktop");
211 #line 63 "marshalling-test.vala"
212 	zeitgeist_event_set_origin (e, "source");
213 #line 65 "marshalling-test.vala"
214 	result = e;
215 #line 65 "marshalling-test.vala"
216 	return result;
217 #line 218 "marshalling-test.c"
218 }
219 
220 void
subject_test(void)221 subject_test (void)
222 {
223 	GError* _inner_error0_ = NULL;
224 	{
225 		gint i = 0;
226 #line 70 "marshalling-test.vala"
227 		i = 0;
228 #line 229 "marshalling-test.c"
229 		{
230 			gboolean _tmp0_ = FALSE;
231 #line 70 "marshalling-test.vala"
232 			_tmp0_ = TRUE;
233 #line 70 "marshalling-test.vala"
234 			while (TRUE) {
235 #line 236 "marshalling-test.c"
236 				GVariant* vsubject = NULL;
237 				ZeitgeistSubject* _tmp2_;
238 				ZeitgeistSubject* _tmp3_;
239 				GVariant* _tmp4_;
240 				GVariant* _tmp5_;
241 				ZeitgeistSubject* subject = NULL;
242 				GVariant* _tmp6_;
243 				ZeitgeistSubject* _tmp7_;
244 				ZeitgeistSubject* _tmp8_;
245 #line 70 "marshalling-test.vala"
246 				if (!_tmp0_) {
247 #line 248 "marshalling-test.c"
248 					gint _tmp1_;
249 #line 70 "marshalling-test.vala"
250 					_tmp1_ = i;
251 #line 70 "marshalling-test.vala"
252 					i = _tmp1_ + 1;
253 #line 254 "marshalling-test.c"
254 				}
255 #line 70 "marshalling-test.vala"
256 				_tmp0_ = FALSE;
257 #line 70 "marshalling-test.vala"
258 				if (!(i < 1000)) {
259 #line 70 "marshalling-test.vala"
260 					break;
261 #line 262 "marshalling-test.c"
262 				}
263 #line 72 "marshalling-test.vala"
264 				_tmp2_ = create_subject ();
265 #line 72 "marshalling-test.vala"
266 				_tmp3_ = _tmp2_;
267 #line 72 "marshalling-test.vala"
268 				_tmp4_ = zeitgeist_subject_to_variant (_tmp3_);
269 #line 72 "marshalling-test.vala"
270 				_tmp5_ = _tmp4_;
271 #line 72 "marshalling-test.vala"
272 				_g_object_unref0 (_tmp3_);
273 #line 72 "marshalling-test.vala"
274 				vsubject = _tmp5_;
275 #line 73 "marshalling-test.vala"
276 				_tmp6_ = vsubject;
277 #line 73 "marshalling-test.vala"
278 				_tmp7_ = zeitgeist_subject_new_from_variant (_tmp6_, &_inner_error0_);
279 #line 73 "marshalling-test.vala"
280 				subject = _tmp7_;
281 #line 73 "marshalling-test.vala"
282 				if (G_UNLIKELY (_inner_error0_ != NULL)) {
283 #line 73 "marshalling-test.vala"
284 					_g_variant_unref0 (vsubject);
285 #line 73 "marshalling-test.vala"
286 					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
287 #line 73 "marshalling-test.vala"
288 					g_clear_error (&_inner_error0_);
289 #line 73 "marshalling-test.vala"
290 					return;
291 #line 292 "marshalling-test.c"
292 				}
293 #line 74 "marshalling-test.vala"
294 				_tmp8_ = subject;
295 #line 74 "marshalling-test.vala"
296 				g_warn_if_fail (_tmp8_ != NULL);
297 #line 70 "marshalling-test.vala"
298 				_g_object_unref0 (subject);
299 #line 70 "marshalling-test.vala"
300 				_g_variant_unref0 (vsubject);
301 #line 302 "marshalling-test.c"
302 			}
303 		}
304 	}
305 }
306 
307 void
event_test(void)308 event_test (void)
309 {
310 	GError* _inner_error0_ = NULL;
311 	{
312 		gint i = 0;
313 #line 80 "marshalling-test.vala"
314 		i = 0;
315 #line 316 "marshalling-test.c"
316 		{
317 			gboolean _tmp0_ = FALSE;
318 #line 80 "marshalling-test.vala"
319 			_tmp0_ = TRUE;
320 #line 80 "marshalling-test.vala"
321 			while (TRUE) {
322 #line 323 "marshalling-test.c"
323 				GVariant* vevent = NULL;
324 				ZeitgeistEvent* _tmp2_;
325 				ZeitgeistEvent* _tmp3_;
326 				GVariant* _tmp4_;
327 				GVariant* _tmp5_;
328 				ZeitgeistEvent* event = NULL;
329 				GVariant* _tmp6_;
330 				ZeitgeistEvent* _tmp7_;
331 				ZeitgeistEvent* _tmp8_;
332 #line 80 "marshalling-test.vala"
333 				if (!_tmp0_) {
334 #line 335 "marshalling-test.c"
335 					gint _tmp1_;
336 #line 80 "marshalling-test.vala"
337 					_tmp1_ = i;
338 #line 80 "marshalling-test.vala"
339 					i = _tmp1_ + 1;
340 #line 341 "marshalling-test.c"
341 				}
342 #line 80 "marshalling-test.vala"
343 				_tmp0_ = FALSE;
344 #line 80 "marshalling-test.vala"
345 				if (!(i < 1000)) {
346 #line 80 "marshalling-test.vala"
347 					break;
348 #line 349 "marshalling-test.c"
349 				}
350 #line 82 "marshalling-test.vala"
351 				_tmp2_ = create_event ();
352 #line 82 "marshalling-test.vala"
353 				_tmp3_ = _tmp2_;
354 #line 82 "marshalling-test.vala"
355 				_tmp4_ = zeitgeist_event_to_variant (_tmp3_);
356 #line 82 "marshalling-test.vala"
357 				_tmp5_ = _tmp4_;
358 #line 82 "marshalling-test.vala"
359 				_g_object_unref0 (_tmp3_);
360 #line 82 "marshalling-test.vala"
361 				vevent = _tmp5_;
362 #line 83 "marshalling-test.vala"
363 				_tmp6_ = vevent;
364 #line 83 "marshalling-test.vala"
365 				_tmp7_ = zeitgeist_event_new_from_variant (_tmp6_, &_inner_error0_);
366 #line 83 "marshalling-test.vala"
367 				event = _tmp7_;
368 #line 83 "marshalling-test.vala"
369 				if (G_UNLIKELY (_inner_error0_ != NULL)) {
370 #line 83 "marshalling-test.vala"
371 					_g_variant_unref0 (vevent);
372 #line 83 "marshalling-test.vala"
373 					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
374 #line 83 "marshalling-test.vala"
375 					g_clear_error (&_inner_error0_);
376 #line 83 "marshalling-test.vala"
377 					return;
378 #line 379 "marshalling-test.c"
379 				}
380 #line 84 "marshalling-test.vala"
381 				_tmp8_ = event;
382 #line 84 "marshalling-test.vala"
383 				g_warn_if_fail (_tmp8_ != NULL);
384 #line 80 "marshalling-test.vala"
385 				_g_object_unref0 (event);
386 #line 80 "marshalling-test.vala"
387 				_g_variant_unref0 (vevent);
388 #line 389 "marshalling-test.c"
389 			}
390 		}
391 	}
392 }
393 
394 static void
_g_object_unref0_(gpointer var)395 _g_object_unref0_ (gpointer var)
396 {
397 #line 90 "marshalling-test.vala"
398 	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
399 #line 400 "marshalling-test.c"
400 }
401 
402 static gpointer
_g_object_ref0(gpointer self)403 _g_object_ref0 (gpointer self)
404 {
405 #line 95 "marshalling-test.vala"
406 	return self ? g_object_ref (self) : NULL;
407 #line 408 "marshalling-test.c"
408 }
409 
410 static gint
g_ptr_array_get_length(GPtrArray * self)411 g_ptr_array_get_length (GPtrArray* self)
412 {
413 	gint result;
414 #line 5303 "glib-2.0.vapi"
415 	g_return_val_if_fail (self != NULL, 0);
416 #line 5303 "glib-2.0.vapi"
417 	result = (gint) self->len;
418 #line 5303 "glib-2.0.vapi"
419 	return result;
420 #line 421 "marshalling-test.c"
421 }
422 
423 static void
g_ptr_array_set_length(GPtrArray * self,gint value)424 g_ptr_array_set_length (GPtrArray* self,
425                         gint value)
426 {
427 #line 5304 "glib-2.0.vapi"
428 	g_return_if_fail (self != NULL);
429 #line 5304 "glib-2.0.vapi"
430 	g_ptr_array_set_size (self, value);
431 #line 432 "marshalling-test.c"
432 }
433 
434 void
events_test(void)435 events_test (void)
436 {
437 	GPtrArray* events = NULL;
438 	GPtrArray* _tmp0_;
439 	GVariant* vevents = NULL;
440 	GPtrArray* _tmp10_;
441 	GVariant* _tmp11_;
442 	GPtrArray* demarshalled = NULL;
443 	GPtrArray* _tmp12_;
444 	gint _tmp13_;
445 	gint _tmp14_;
446 	GError* _inner_error0_ = NULL;
447 #line 90 "marshalling-test.vala"
448 	_tmp0_ = g_ptr_array_new_full ((guint) 0, _g_object_unref0_);
449 #line 90 "marshalling-test.vala"
450 	events = _tmp0_;
451 #line 452 "marshalling-test.c"
452 	{
453 		gint i = 0;
454 #line 91 "marshalling-test.vala"
455 		i = 0;
456 #line 457 "marshalling-test.c"
457 		{
458 			gboolean _tmp1_ = FALSE;
459 #line 91 "marshalling-test.vala"
460 			_tmp1_ = TRUE;
461 #line 91 "marshalling-test.vala"
462 			while (TRUE) {
463 #line 464 "marshalling-test.c"
464 				ZeitgeistEvent* e = NULL;
465 				ZeitgeistEvent* _tmp3_;
466 				ZeitgeistEvent* _tmp4_;
467 				ZeitgeistSubject* _tmp5_;
468 				ZeitgeistSubject* _tmp6_;
469 				GPtrArray* _tmp7_;
470 				ZeitgeistEvent* _tmp8_;
471 				ZeitgeistEvent* _tmp9_;
472 #line 91 "marshalling-test.vala"
473 				if (!_tmp1_) {
474 #line 475 "marshalling-test.c"
475 					gint _tmp2_;
476 #line 91 "marshalling-test.vala"
477 					_tmp2_ = i;
478 #line 91 "marshalling-test.vala"
479 					i = _tmp2_ + 1;
480 #line 481 "marshalling-test.c"
481 				}
482 #line 91 "marshalling-test.vala"
483 				_tmp1_ = FALSE;
484 #line 91 "marshalling-test.vala"
485 				if (!(i < 1000)) {
486 #line 91 "marshalling-test.vala"
487 					break;
488 #line 489 "marshalling-test.c"
489 				}
490 #line 93 "marshalling-test.vala"
491 				_tmp3_ = create_event ();
492 #line 93 "marshalling-test.vala"
493 				e = _tmp3_;
494 #line 94 "marshalling-test.vala"
495 				_tmp4_ = e;
496 #line 94 "marshalling-test.vala"
497 				_tmp5_ = create_subject ();
498 #line 94 "marshalling-test.vala"
499 				_tmp6_ = _tmp5_;
500 #line 94 "marshalling-test.vala"
501 				zeitgeist_event_add_subject (_tmp4_, _tmp6_);
502 #line 94 "marshalling-test.vala"
503 				_g_object_unref0 (_tmp6_);
504 #line 95 "marshalling-test.vala"
505 				_tmp7_ = events;
506 #line 95 "marshalling-test.vala"
507 				_tmp8_ = e;
508 #line 95 "marshalling-test.vala"
509 				_tmp9_ = _g_object_ref0 (_tmp8_);
510 #line 95 "marshalling-test.vala"
511 				g_ptr_array_add (_tmp7_, _tmp9_);
512 #line 91 "marshalling-test.vala"
513 				_g_object_unref0 (e);
514 #line 515 "marshalling-test.c"
515 			}
516 		}
517 	}
518 #line 98 "marshalling-test.vala"
519 	_tmp10_ = events;
520 #line 98 "marshalling-test.vala"
521 	_tmp11_ = zeitgeist_events_to_variant (_tmp10_);
522 #line 98 "marshalling-test.vala"
523 	vevents = _tmp11_;
524 #line 100 "marshalling-test.vala"
525 	_tmp12_ = zeitgeist_events_from_variant (vevents, &_inner_error0_);
526 #line 100 "marshalling-test.vala"
527 	demarshalled = _tmp12_;
528 #line 100 "marshalling-test.vala"
529 	if (G_UNLIKELY (_inner_error0_ != NULL)) {
530 #line 100 "marshalling-test.vala"
531 		_g_variant_unref0 (vevents);
532 #line 100 "marshalling-test.vala"
533 		_g_ptr_array_unref0 (events);
534 #line 100 "marshalling-test.vala"
535 		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
536 #line 100 "marshalling-test.vala"
537 		g_clear_error (&_inner_error0_);
538 #line 100 "marshalling-test.vala"
539 		return;
540 #line 541 "marshalling-test.c"
541 	}
542 #line 101 "marshalling-test.vala"
543 	_tmp13_ = g_ptr_array_get_length (demarshalled);
544 #line 101 "marshalling-test.vala"
545 	_tmp14_ = _tmp13_;
546 #line 101 "marshalling-test.vala"
547 	g_assert_cmpint (_tmp14_, ==, 1000);
548 #line 88 "marshalling-test.vala"
549 	_g_ptr_array_unref0 (demarshalled);
550 #line 88 "marshalling-test.vala"
551 	_g_variant_unref0 (vevents);
552 #line 88 "marshalling-test.vala"
553 	_g_ptr_array_unref0 (events);
554 #line 555 "marshalling-test.c"
555 }
556 
557 void
timerange_test(void)558 timerange_test (void)
559 {
560 	GError* _inner_error0_ = NULL;
561 	{
562 		gint64 i = 0LL;
563 #line 106 "marshalling-test.vala"
564 		i = (gint64) 0;
565 #line 566 "marshalling-test.c"
566 		{
567 			gboolean _tmp0_ = FALSE;
568 #line 106 "marshalling-test.vala"
569 			_tmp0_ = TRUE;
570 #line 106 "marshalling-test.vala"
571 			while (TRUE) {
572 #line 573 "marshalling-test.c"
573 				GVariant* v = NULL;
574 				GVariant* _tmp2_;
575 				ZeitgeistTimeRange* timerange = NULL;
576 				GVariant* _tmp3_;
577 				ZeitgeistTimeRange* _tmp4_;
578 				ZeitgeistTimeRange* _tmp5_;
579 				gint64 _tmp6_;
580 				gint64 _tmp7_;
581 				ZeitgeistTimeRange* _tmp8_;
582 				gint64 _tmp9_;
583 				gint64 _tmp10_;
584 #line 106 "marshalling-test.vala"
585 				if (!_tmp0_) {
586 #line 587 "marshalling-test.c"
587 					gint64 _tmp1_;
588 #line 106 "marshalling-test.vala"
589 					_tmp1_ = i;
590 #line 106 "marshalling-test.vala"
591 					i = _tmp1_ + 1;
592 #line 593 "marshalling-test.c"
593 				}
594 #line 106 "marshalling-test.vala"
595 				_tmp0_ = FALSE;
596 #line 106 "marshalling-test.vala"
597 				if (!(i < ((gint64) 1000))) {
598 #line 106 "marshalling-test.vala"
599 					break;
600 #line 601 "marshalling-test.c"
601 				}
602 #line 108 "marshalling-test.vala"
603 				_tmp2_ = g_variant_new ("(xx)", i, i + 42, NULL);
604 #line 108 "marshalling-test.vala"
605 				g_variant_ref_sink (_tmp2_);
606 #line 108 "marshalling-test.vala"
607 				v = _tmp2_;
608 #line 109 "marshalling-test.vala"
609 				_tmp3_ = v;
610 #line 109 "marshalling-test.vala"
611 				_tmp4_ = zeitgeist_time_range_new_from_variant (_tmp3_, &_inner_error0_);
612 #line 109 "marshalling-test.vala"
613 				timerange = _tmp4_;
614 #line 109 "marshalling-test.vala"
615 				if (G_UNLIKELY (_inner_error0_ != NULL)) {
616 #line 109 "marshalling-test.vala"
617 					_g_variant_unref0 (v);
618 #line 109 "marshalling-test.vala"
619 					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
620 #line 109 "marshalling-test.vala"
621 					g_clear_error (&_inner_error0_);
622 #line 109 "marshalling-test.vala"
623 					return;
624 #line 625 "marshalling-test.c"
625 				}
626 #line 110 "marshalling-test.vala"
627 				_tmp5_ = timerange;
628 #line 110 "marshalling-test.vala"
629 				_tmp6_ = zeitgeist_time_range_get_start (_tmp5_);
630 #line 110 "marshalling-test.vala"
631 				_tmp7_ = _tmp6_;
632 #line 110 "marshalling-test.vala"
633 				g_assert_cmpint ((gint) _tmp7_, ==, (gint) i);
634 #line 111 "marshalling-test.vala"
635 				_tmp8_ = timerange;
636 #line 111 "marshalling-test.vala"
637 				_tmp9_ = zeitgeist_time_range_get_end (_tmp8_);
638 #line 111 "marshalling-test.vala"
639 				_tmp10_ = _tmp9_;
640 #line 111 "marshalling-test.vala"
641 				g_assert_cmpint ((gint) _tmp10_, ==, ((gint) i) + 42);
642 #line 106 "marshalling-test.vala"
643 				_g_object_unref0 (timerange);
644 #line 106 "marshalling-test.vala"
645 				_g_variant_unref0 (v);
646 #line 647 "marshalling-test.c"
647 			}
648 		}
649 	}
650 }
651 
652 void
corrupt_events_test(void)653 corrupt_events_test (void)
654 {
655 	GVariant* v = NULL;
656 	GVariant* _tmp0_;
657 	gboolean error_thrown = FALSE;
658 	GError* _inner_error0_ = NULL;
659 #line 118 "marshalling-test.vala"
660 	_tmp0_ = g_variant_new ("(s)", "Zeitgeist is so awesome", NULL);
661 #line 118 "marshalling-test.vala"
662 	g_variant_ref_sink (_tmp0_);
663 #line 118 "marshalling-test.vala"
664 	v = _tmp0_;
665 #line 119 "marshalling-test.vala"
666 	error_thrown = FALSE;
667 #line 668 "marshalling-test.c"
668 	{
669 		ZeitgeistEvent* _tmp1_;
670 		ZeitgeistEvent* _tmp2_;
671 #line 122 "marshalling-test.vala"
672 		_tmp1_ = zeitgeist_event_new_from_variant (v, &_inner_error0_);
673 #line 122 "marshalling-test.vala"
674 		_tmp2_ = _tmp1_;
675 #line 122 "marshalling-test.vala"
676 		_g_object_unref0 (_tmp2_);
677 #line 122 "marshalling-test.vala"
678 		if (G_UNLIKELY (_inner_error0_ != NULL)) {
679 #line 122 "marshalling-test.vala"
680 			if (g_error_matches (_inner_error0_, ZEITGEIST_DATA_MODEL_ERROR, ZEITGEIST_DATA_MODEL_ERROR_INVALID_SIGNATURE)) {
681 #line 682 "marshalling-test.c"
682 				goto __catch0_zeitgeist_data_model_error_invalid_signature;
683 			}
684 			goto __finally0;
685 		}
686 	}
687 	goto __finally0;
688 	__catch0_zeitgeist_data_model_error_invalid_signature:
689 	{
690 #line 120 "marshalling-test.vala"
691 		g_clear_error (&_inner_error0_);
692 #line 125 "marshalling-test.vala"
693 		error_thrown = TRUE;
694 #line 695 "marshalling-test.c"
695 	}
696 	__finally0:
697 #line 120 "marshalling-test.vala"
698 	if (G_UNLIKELY (_inner_error0_ != NULL)) {
699 #line 120 "marshalling-test.vala"
700 		_g_variant_unref0 (v);
701 #line 120 "marshalling-test.vala"
702 		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
703 #line 120 "marshalling-test.vala"
704 		g_clear_error (&_inner_error0_);
705 #line 120 "marshalling-test.vala"
706 		return;
707 #line 708 "marshalling-test.c"
708 	}
709 #line 127 "marshalling-test.vala"
710 	_vala_assert (error_thrown, "error_thrown");
711 #line 115 "marshalling-test.vala"
712 	_g_variant_unref0 (v);
713 #line 714 "marshalling-test.c"
714 }
715 
716 void
corrupt_subjects_test(void)717 corrupt_subjects_test (void)
718 {
719 	GVariant* v = NULL;
720 	gchar** arr = NULL;
721 	gint arr_length1 = 0;
722 	gint _arr_size_ = 0;
723 	gboolean error_thrown = FALSE;
724 	gchar* _tmp0_;
725 	gchar* _tmp1_;
726 	gchar* _tmp2_;
727 	gchar* _tmp3_;
728 	gchar* _tmp4_;
729 	gchar* _tmp5_;
730 	gchar* _tmp6_;
731 	gchar* _tmp7_;
732 	gchar** _tmp8_;
733 	gchar** _tmp9_;
734 	gint _tmp9__length1;
735 	GVariant* _tmp10_;
736 	GVariant* _tmp11_;
737 	ZeitgeistSubject* _tmp12_;
738 	ZeitgeistSubject* _tmp13_;
739 	gchar* _tmp14_;
740 	gchar* _tmp15_;
741 	gchar* _tmp16_;
742 	gchar* _tmp17_;
743 	gchar* _tmp18_;
744 	gchar* _tmp19_;
745 	gchar* _tmp20_;
746 	gchar** _tmp21_;
747 	gchar** _tmp22_;
748 	gint _tmp22__length1;
749 	GVariant* _tmp23_;
750 	GVariant* _tmp24_;
751 	ZeitgeistSubject* _tmp25_;
752 	ZeitgeistSubject* _tmp26_;
753 	gchar* _tmp27_;
754 	gchar* _tmp28_;
755 	gchar* _tmp29_;
756 	gchar* _tmp30_;
757 	gchar* _tmp31_;
758 	gchar* _tmp32_;
759 	gchar** _tmp33_;
760 	gchar** _tmp34_;
761 	gint _tmp34__length1;
762 	GVariant* _tmp35_;
763 	GVariant* _tmp40_;
764 	GError* _inner_error0_ = NULL;
765 #line 137 "marshalling-test.vala"
766 	_tmp0_ = g_strdup ("uri");
767 #line 137 "marshalling-test.vala"
768 	_tmp1_ = g_strdup ("interpretation");
769 #line 137 "marshalling-test.vala"
770 	_tmp2_ = g_strdup ("manifestation");
771 #line 137 "marshalling-test.vala"
772 	_tmp3_ = g_strdup ("origin");
773 #line 137 "marshalling-test.vala"
774 	_tmp4_ = g_strdup ("mimetype");
775 #line 137 "marshalling-test.vala"
776 	_tmp5_ = g_strdup ("text");
777 #line 137 "marshalling-test.vala"
778 	_tmp6_ = g_strdup ("storage");
779 #line 137 "marshalling-test.vala"
780 	_tmp7_ = g_strdup ("current_uri");
781 #line 137 "marshalling-test.vala"
782 	_tmp8_ = g_new0 (gchar*, 8 + 1);
783 #line 137 "marshalling-test.vala"
784 	_tmp8_[0] = _tmp0_;
785 #line 137 "marshalling-test.vala"
786 	_tmp8_[1] = _tmp1_;
787 #line 137 "marshalling-test.vala"
788 	_tmp8_[2] = _tmp2_;
789 #line 137 "marshalling-test.vala"
790 	_tmp8_[3] = _tmp3_;
791 #line 137 "marshalling-test.vala"
792 	_tmp8_[4] = _tmp4_;
793 #line 137 "marshalling-test.vala"
794 	_tmp8_[5] = _tmp5_;
795 #line 137 "marshalling-test.vala"
796 	_tmp8_[6] = _tmp6_;
797 #line 137 "marshalling-test.vala"
798 	_tmp8_[7] = _tmp7_;
799 #line 137 "marshalling-test.vala"
800 	arr = (_vala_array_free (arr, arr_length1, (GDestroyNotify) g_free), NULL);
801 #line 137 "marshalling-test.vala"
802 	arr = _tmp8_;
803 #line 137 "marshalling-test.vala"
804 	arr_length1 = 8;
805 #line 137 "marshalling-test.vala"
806 	_arr_size_ = arr_length1;
807 #line 139 "marshalling-test.vala"
808 	_tmp9_ = arr;
809 #line 139 "marshalling-test.vala"
810 	_tmp9__length1 = arr_length1;
811 #line 139 "marshalling-test.vala"
812 	_tmp10_ = g_variant_new_strv (_tmp9_, _tmp9__length1);
813 #line 139 "marshalling-test.vala"
814 	g_variant_ref_sink (_tmp10_);
815 #line 139 "marshalling-test.vala"
816 	_g_variant_unref0 (v);
817 #line 139 "marshalling-test.vala"
818 	v = _tmp10_;
819 #line 140 "marshalling-test.vala"
820 	_tmp11_ = v;
821 #line 140 "marshalling-test.vala"
822 	_tmp12_ = zeitgeist_subject_new_from_variant (_tmp11_, &_inner_error0_);
823 #line 140 "marshalling-test.vala"
824 	_tmp13_ = _tmp12_;
825 #line 140 "marshalling-test.vala"
826 	_g_object_unref0 (_tmp13_);
827 #line 140 "marshalling-test.vala"
828 	if (G_UNLIKELY (_inner_error0_ != NULL)) {
829 #line 140 "marshalling-test.vala"
830 		arr = (_vala_array_free (arr, arr_length1, (GDestroyNotify) g_free), NULL);
831 #line 140 "marshalling-test.vala"
832 		_g_variant_unref0 (v);
833 #line 140 "marshalling-test.vala"
834 		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
835 #line 140 "marshalling-test.vala"
836 		g_clear_error (&_inner_error0_);
837 #line 140 "marshalling-test.vala"
838 		return;
839 #line 840 "marshalling-test.c"
840 	}
841 #line 143 "marshalling-test.vala"
842 	_tmp14_ = g_strdup ("uri");
843 #line 143 "marshalling-test.vala"
844 	_tmp15_ = g_strdup ("interpretation");
845 #line 143 "marshalling-test.vala"
846 	_tmp16_ = g_strdup ("manifestation");
847 #line 143 "marshalling-test.vala"
848 	_tmp17_ = g_strdup ("origin");
849 #line 143 "marshalling-test.vala"
850 	_tmp18_ = g_strdup ("mimetype");
851 #line 143 "marshalling-test.vala"
852 	_tmp19_ = g_strdup ("text");
853 #line 143 "marshalling-test.vala"
854 	_tmp20_ = g_strdup ("storage");
855 #line 143 "marshalling-test.vala"
856 	_tmp21_ = g_new0 (gchar*, 7 + 1);
857 #line 143 "marshalling-test.vala"
858 	_tmp21_[0] = _tmp14_;
859 #line 143 "marshalling-test.vala"
860 	_tmp21_[1] = _tmp15_;
861 #line 143 "marshalling-test.vala"
862 	_tmp21_[2] = _tmp16_;
863 #line 143 "marshalling-test.vala"
864 	_tmp21_[3] = _tmp17_;
865 #line 143 "marshalling-test.vala"
866 	_tmp21_[4] = _tmp18_;
867 #line 143 "marshalling-test.vala"
868 	_tmp21_[5] = _tmp19_;
869 #line 143 "marshalling-test.vala"
870 	_tmp21_[6] = _tmp20_;
871 #line 143 "marshalling-test.vala"
872 	arr = (_vala_array_free (arr, arr_length1, (GDestroyNotify) g_free), NULL);
873 #line 143 "marshalling-test.vala"
874 	arr = _tmp21_;
875 #line 143 "marshalling-test.vala"
876 	arr_length1 = 7;
877 #line 143 "marshalling-test.vala"
878 	_arr_size_ = arr_length1;
879 #line 145 "marshalling-test.vala"
880 	_tmp22_ = arr;
881 #line 145 "marshalling-test.vala"
882 	_tmp22__length1 = arr_length1;
883 #line 145 "marshalling-test.vala"
884 	_tmp23_ = g_variant_new_strv (_tmp22_, _tmp22__length1);
885 #line 145 "marshalling-test.vala"
886 	g_variant_ref_sink (_tmp23_);
887 #line 145 "marshalling-test.vala"
888 	_g_variant_unref0 (v);
889 #line 145 "marshalling-test.vala"
890 	v = _tmp23_;
891 #line 146 "marshalling-test.vala"
892 	_tmp24_ = v;
893 #line 146 "marshalling-test.vala"
894 	_tmp25_ = zeitgeist_subject_new_from_variant (_tmp24_, &_inner_error0_);
895 #line 146 "marshalling-test.vala"
896 	_tmp26_ = _tmp25_;
897 #line 146 "marshalling-test.vala"
898 	_g_object_unref0 (_tmp26_);
899 #line 146 "marshalling-test.vala"
900 	if (G_UNLIKELY (_inner_error0_ != NULL)) {
901 #line 146 "marshalling-test.vala"
902 		arr = (_vala_array_free (arr, arr_length1, (GDestroyNotify) g_free), NULL);
903 #line 146 "marshalling-test.vala"
904 		_g_variant_unref0 (v);
905 #line 146 "marshalling-test.vala"
906 		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
907 #line 146 "marshalling-test.vala"
908 		g_clear_error (&_inner_error0_);
909 #line 146 "marshalling-test.vala"
910 		return;
911 #line 912 "marshalling-test.c"
912 	}
913 #line 149 "marshalling-test.vala"
914 	_tmp27_ = g_strdup ("uri");
915 #line 149 "marshalling-test.vala"
916 	_tmp28_ = g_strdup ("interpretation");
917 #line 149 "marshalling-test.vala"
918 	_tmp29_ = g_strdup ("manifestation");
919 #line 149 "marshalling-test.vala"
920 	_tmp30_ = g_strdup ("origin");
921 #line 149 "marshalling-test.vala"
922 	_tmp31_ = g_strdup ("mimetype");
923 #line 149 "marshalling-test.vala"
924 	_tmp32_ = g_strdup ("text");
925 #line 149 "marshalling-test.vala"
926 	_tmp33_ = g_new0 (gchar*, 6 + 1);
927 #line 149 "marshalling-test.vala"
928 	_tmp33_[0] = _tmp27_;
929 #line 149 "marshalling-test.vala"
930 	_tmp33_[1] = _tmp28_;
931 #line 149 "marshalling-test.vala"
932 	_tmp33_[2] = _tmp29_;
933 #line 149 "marshalling-test.vala"
934 	_tmp33_[3] = _tmp30_;
935 #line 149 "marshalling-test.vala"
936 	_tmp33_[4] = _tmp31_;
937 #line 149 "marshalling-test.vala"
938 	_tmp33_[5] = _tmp32_;
939 #line 149 "marshalling-test.vala"
940 	arr = (_vala_array_free (arr, arr_length1, (GDestroyNotify) g_free), NULL);
941 #line 149 "marshalling-test.vala"
942 	arr = _tmp33_;
943 #line 149 "marshalling-test.vala"
944 	arr_length1 = 6;
945 #line 149 "marshalling-test.vala"
946 	_arr_size_ = arr_length1;
947 #line 151 "marshalling-test.vala"
948 	_tmp34_ = arr;
949 #line 151 "marshalling-test.vala"
950 	_tmp34__length1 = arr_length1;
951 #line 151 "marshalling-test.vala"
952 	_tmp35_ = g_variant_new_strv (_tmp34_, _tmp34__length1);
953 #line 151 "marshalling-test.vala"
954 	g_variant_ref_sink (_tmp35_);
955 #line 151 "marshalling-test.vala"
956 	_g_variant_unref0 (v);
957 #line 151 "marshalling-test.vala"
958 	v = _tmp35_;
959 #line 152 "marshalling-test.vala"
960 	error_thrown = FALSE;
961 #line 962 "marshalling-test.c"
962 	{
963 		GVariant* _tmp36_;
964 		ZeitgeistSubject* _tmp37_;
965 		ZeitgeistSubject* _tmp38_;
966 #line 155 "marshalling-test.vala"
967 		_tmp36_ = v;
968 #line 155 "marshalling-test.vala"
969 		_tmp37_ = zeitgeist_subject_new_from_variant (_tmp36_, &_inner_error0_);
970 #line 155 "marshalling-test.vala"
971 		_tmp38_ = _tmp37_;
972 #line 155 "marshalling-test.vala"
973 		_g_object_unref0 (_tmp38_);
974 #line 155 "marshalling-test.vala"
975 		if (G_UNLIKELY (_inner_error0_ != NULL)) {
976 #line 155 "marshalling-test.vala"
977 			if (_inner_error0_->domain == ZEITGEIST_DATA_MODEL_ERROR) {
978 #line 979 "marshalling-test.c"
979 				goto __catch0_zeitgeist_data_model_error;
980 			}
981 #line 155 "marshalling-test.vala"
982 			arr = (_vala_array_free (arr, arr_length1, (GDestroyNotify) g_free), NULL);
983 #line 155 "marshalling-test.vala"
984 			_g_variant_unref0 (v);
985 #line 155 "marshalling-test.vala"
986 			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
987 #line 155 "marshalling-test.vala"
988 			g_clear_error (&_inner_error0_);
989 #line 155 "marshalling-test.vala"
990 			return;
991 #line 992 "marshalling-test.c"
992 		}
993 	}
994 	goto __finally0;
995 	__catch0_zeitgeist_data_model_error:
996 	{
997 		GError* err = NULL;
998 		GError* _tmp39_;
999 #line 153 "marshalling-test.vala"
1000 		err = _inner_error0_;
1001 #line 153 "marshalling-test.vala"
1002 		_inner_error0_ = NULL;
1003 #line 159 "marshalling-test.vala"
1004 		_tmp39_ = err;
1005 #line 159 "marshalling-test.vala"
1006 		_vala_assert (g_error_matches (_tmp39_, ZEITGEIST_DATA_MODEL_ERROR, ZEITGEIST_DATA_MODEL_ERROR_INVALID_SIGNATURE), "err is DataModelError.INVALID_SIGNATURE");
1007 #line 160 "marshalling-test.vala"
1008 		error_thrown = TRUE;
1009 #line 153 "marshalling-test.vala"
1010 		_g_error_free0 (err);
1011 #line 1012 "marshalling-test.c"
1012 	}
1013 	__finally0:
1014 #line 153 "marshalling-test.vala"
1015 	if (G_UNLIKELY (_inner_error0_ != NULL)) {
1016 #line 153 "marshalling-test.vala"
1017 		arr = (_vala_array_free (arr, arr_length1, (GDestroyNotify) g_free), NULL);
1018 #line 153 "marshalling-test.vala"
1019 		_g_variant_unref0 (v);
1020 #line 153 "marshalling-test.vala"
1021 		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
1022 #line 153 "marshalling-test.vala"
1023 		g_clear_error (&_inner_error0_);
1024 #line 153 "marshalling-test.vala"
1025 		return;
1026 #line 1027 "marshalling-test.c"
1027 	}
1028 #line 162 "marshalling-test.vala"
1029 	_vala_assert (error_thrown, "error_thrown");
1030 #line 165 "marshalling-test.vala"
1031 	_tmp40_ = g_variant_new ("(x)", 42, NULL);
1032 #line 165 "marshalling-test.vala"
1033 	g_variant_ref_sink (_tmp40_);
1034 #line 165 "marshalling-test.vala"
1035 	_g_variant_unref0 (v);
1036 #line 165 "marshalling-test.vala"
1037 	v = _tmp40_;
1038 #line 166 "marshalling-test.vala"
1039 	error_thrown = FALSE;
1040 #line 1041 "marshalling-test.c"
1041 	{
1042 		GVariant* _tmp41_;
1043 		ZeitgeistSubject* _tmp42_;
1044 		ZeitgeistSubject* _tmp43_;
1045 #line 169 "marshalling-test.vala"
1046 		_tmp41_ = v;
1047 #line 169 "marshalling-test.vala"
1048 		_tmp42_ = zeitgeist_subject_new_from_variant (_tmp41_, &_inner_error0_);
1049 #line 169 "marshalling-test.vala"
1050 		_tmp43_ = _tmp42_;
1051 #line 169 "marshalling-test.vala"
1052 		_g_object_unref0 (_tmp43_);
1053 #line 169 "marshalling-test.vala"
1054 		if (G_UNLIKELY (_inner_error0_ != NULL)) {
1055 #line 169 "marshalling-test.vala"
1056 			if (g_error_matches (_inner_error0_, ZEITGEIST_DATA_MODEL_ERROR, ZEITGEIST_DATA_MODEL_ERROR_INVALID_SIGNATURE)) {
1057 #line 1058 "marshalling-test.c"
1058 				goto __catch1_zeitgeist_data_model_error_invalid_signature;
1059 			}
1060 			goto __finally1;
1061 		}
1062 	}
1063 	goto __finally1;
1064 	__catch1_zeitgeist_data_model_error_invalid_signature:
1065 	{
1066 #line 167 "marshalling-test.vala"
1067 		g_clear_error (&_inner_error0_);
1068 #line 173 "marshalling-test.vala"
1069 		error_thrown = TRUE;
1070 #line 1071 "marshalling-test.c"
1071 	}
1072 	__finally1:
1073 #line 167 "marshalling-test.vala"
1074 	if (G_UNLIKELY (_inner_error0_ != NULL)) {
1075 #line 167 "marshalling-test.vala"
1076 		arr = (_vala_array_free (arr, arr_length1, (GDestroyNotify) g_free), NULL);
1077 #line 167 "marshalling-test.vala"
1078 		_g_variant_unref0 (v);
1079 #line 167 "marshalling-test.vala"
1080 		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
1081 #line 167 "marshalling-test.vala"
1082 		g_clear_error (&_inner_error0_);
1083 #line 167 "marshalling-test.vala"
1084 		return;
1085 #line 1086 "marshalling-test.c"
1086 	}
1087 #line 175 "marshalling-test.vala"
1088 	_vala_assert (error_thrown, "error_thrown");
1089 #line 130 "marshalling-test.vala"
1090 	arr = (_vala_array_free (arr, arr_length1, (GDestroyNotify) g_free), NULL);
1091 #line 130 "marshalling-test.vala"
1092 	_g_variant_unref0 (v);
1093 #line 1094 "marshalling-test.c"
1094 }
1095 
1096 void
corrupt_timerange_test(void)1097 corrupt_timerange_test (void)
1098 {
1099 	GVariant* v = NULL;
1100 	GVariant* _tmp0_;
1101 	gboolean error_thrown = FALSE;
1102 	GError* _inner_error0_ = NULL;
1103 #line 180 "marshalling-test.vala"
1104 	_tmp0_ = g_variant_new ("(s)", "oh noes, what is this?", NULL);
1105 #line 180 "marshalling-test.vala"
1106 	g_variant_ref_sink (_tmp0_);
1107 #line 180 "marshalling-test.vala"
1108 	v = _tmp0_;
1109 #line 181 "marshalling-test.vala"
1110 	error_thrown = FALSE;
1111 #line 1112 "marshalling-test.c"
1112 	{
1113 		ZeitgeistTimeRange* _tmp1_;
1114 		ZeitgeistTimeRange* _tmp2_;
1115 #line 184 "marshalling-test.vala"
1116 		_tmp1_ = zeitgeist_time_range_new_from_variant (v, &_inner_error0_);
1117 #line 184 "marshalling-test.vala"
1118 		_tmp2_ = _tmp1_;
1119 #line 184 "marshalling-test.vala"
1120 		_g_object_unref0 (_tmp2_);
1121 #line 184 "marshalling-test.vala"
1122 		if (G_UNLIKELY (_inner_error0_ != NULL)) {
1123 #line 184 "marshalling-test.vala"
1124 			if (g_error_matches (_inner_error0_, ZEITGEIST_DATA_MODEL_ERROR, ZEITGEIST_DATA_MODEL_ERROR_INVALID_SIGNATURE)) {
1125 #line 1126 "marshalling-test.c"
1126 				goto __catch0_zeitgeist_data_model_error_invalid_signature;
1127 			}
1128 			goto __finally0;
1129 		}
1130 	}
1131 	goto __finally0;
1132 	__catch0_zeitgeist_data_model_error_invalid_signature:
1133 	{
1134 #line 182 "marshalling-test.vala"
1135 		g_clear_error (&_inner_error0_);
1136 #line 188 "marshalling-test.vala"
1137 		error_thrown = TRUE;
1138 #line 1139 "marshalling-test.c"
1139 	}
1140 	__finally0:
1141 #line 182 "marshalling-test.vala"
1142 	if (G_UNLIKELY (_inner_error0_ != NULL)) {
1143 #line 182 "marshalling-test.vala"
1144 		_g_variant_unref0 (v);
1145 #line 182 "marshalling-test.vala"
1146 		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
1147 #line 182 "marshalling-test.vala"
1148 		g_clear_error (&_inner_error0_);
1149 #line 182 "marshalling-test.vala"
1150 		return;
1151 #line 1152 "marshalling-test.c"
1152 	}
1153 #line 178 "marshalling-test.vala"
1154 	_g_variant_unref0 (v);
1155 #line 1156 "marshalling-test.c"
1156 }
1157 
1158 static void
_vala_array_destroy(gpointer array,gint array_length,GDestroyNotify destroy_func)1159 _vala_array_destroy (gpointer array,
1160                      gint array_length,
1161                      GDestroyNotify destroy_func)
1162 {
1163 	if ((array != NULL) && (destroy_func != NULL)) {
1164 		gint i;
1165 		for (i = 0; i < array_length; i = i + 1) {
1166 			if (((gpointer*) array)[i] != NULL) {
1167 				destroy_func (((gpointer*) array)[i]);
1168 			}
1169 		}
1170 	}
1171 }
1172 
1173 static void
_vala_array_free(gpointer array,gint array_length,GDestroyNotify destroy_func)1174 _vala_array_free (gpointer array,
1175                   gint array_length,
1176                   GDestroyNotify destroy_func)
1177 {
1178 	_vala_array_destroy (array, array_length, destroy_func);
1179 	g_free (array);
1180 }
1181 
1182