/* marshalling-test.c generated by valac 0.20.1, the Vala compiler
 * generated from marshalling-test.vala, do not modify */

/* marshalling-test.vala
 *
 * Copyright © 2011 Michal Hruby <michal.mhr@gmail.com>
 * Copyright © 2011 Canonical Ltd.
 *             By Siegfried-A. Gevatter <siegfried.gevatter@collabora.co.uk>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 2.1 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include "zeitgeist-datamodel.h"

#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
#define _g_ptr_array_unref0(var) ((var == NULL) ? NULL : (var = (g_ptr_array_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);



gint _vala_main (gchar** argv, int argv_length1);
void subject_test (void);
static void _subject_test_gtest_func (void);
void event_test (void);
static void _event_test_gtest_func (void);
void events_test (void);
static void _events_test_gtest_func (void);
void timerange_test (void);
static void _timerange_test_gtest_func (void);
void corrupt_events_test (void);
static void _corrupt_events_test_gtest_func (void);
void corrupt_subjects_test (void);
static void _corrupt_subjects_test_gtest_func (void);
void corrupt_timerange_test (void);
static void _corrupt_timerange_test_gtest_func (void);
ZeitgeistSubject* create_subject (void);
ZeitgeistEvent* create_event (void);
static void _g_object_unref0_ (gpointer var);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);


static void _subject_test_gtest_func (void) {
#line 29 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	subject_test ();
#line 65 "marshalling-test.c"
}


static void _event_test_gtest_func (void) {
#line 30 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	event_test ();
#line 72 "marshalling-test.c"
}


static void _events_test_gtest_func (void) {
#line 31 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	events_test ();
#line 79 "marshalling-test.c"
}


static void _timerange_test_gtest_func (void) {
#line 32 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	timerange_test ();
#line 86 "marshalling-test.c"
}


static void _corrupt_events_test_gtest_func (void) {
#line 33 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	corrupt_events_test ();
#line 93 "marshalling-test.c"
}


static void _corrupt_subjects_test_gtest_func (void) {
#line 34 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	corrupt_subjects_test ();
#line 100 "marshalling-test.c"
}


static void _corrupt_timerange_test_gtest_func (void) {
#line 35 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	corrupt_timerange_test ();
#line 107 "marshalling-test.c"
}


gint _vala_main (gchar** argv, int argv_length1) {
	gint result = 0;
	gint _tmp0_ = 0;
#line 27 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	g_test_init (&argv_length1, &argv, NULL);
#line 29 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	g_test_add_func ("/Marshalling/subjects", _subject_test_gtest_func);
#line 30 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	g_test_add_func ("/Marshalling/event", _event_test_gtest_func);
#line 31 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	g_test_add_func ("/Marshalling/events", _events_test_gtest_func);
#line 32 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	g_test_add_func ("/Marshalling/timerange", _timerange_test_gtest_func);
#line 33 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	g_test_add_func ("/Marshalling/corrupt_events", _corrupt_events_test_gtest_func);
#line 34 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	g_test_add_func ("/Marshalling/corrupt_subjects", _corrupt_subjects_test_gtest_func);
#line 35 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	g_test_add_func ("/Marshalling/corrupt_timerange", _corrupt_timerange_test_gtest_func);
#line 37 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp0_ = g_test_run ();
#line 37 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	result = _tmp0_;
#line 37 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	return result;
#line 136 "marshalling-test.c"
}


int main (int argc, char ** argv) {
#line 25 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	g_type_init ();
#line 25 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	return _vala_main (argv, argc);
#line 145 "marshalling-test.c"
}


ZeitgeistSubject* create_subject (void) {
	ZeitgeistSubject* result = NULL;
	ZeitgeistSubject* _tmp0_;
	ZeitgeistSubject* s;
#line 42 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp0_ = zeitgeist_subject_new ();
#line 42 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	s = _tmp0_;
#line 43 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	zeitgeist_subject_set_uri (s, "scheme:///uri");
#line 44 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	zeitgeist_subject_set_interpretation (s, "subject_interpretation_uri");
#line 45 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	zeitgeist_subject_set_manifestation (s, "subject_manifestation_uri");
#line 46 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	zeitgeist_subject_set_mimetype (s, "text/plain");
#line 47 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	zeitgeist_subject_set_origin (s, "scheme:///");
#line 48 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	zeitgeist_subject_set_text (s, "Human readable text");
#line 49 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	zeitgeist_subject_set_storage (s, "");
#line 50 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	zeitgeist_subject_set_current_uri (s, "scheme:///uri");
#line 52 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	result = s;
#line 52 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	return result;
#line 177 "marshalling-test.c"
}


ZeitgeistEvent* create_event (void) {
	ZeitgeistEvent* result = NULL;
	ZeitgeistEvent* _tmp0_;
	ZeitgeistEvent* e;
#line 57 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp0_ = zeitgeist_event_new ();
#line 57 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	e = _tmp0_;
#line 58 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	zeitgeist_event_set_id (e, (guint32) 1234);
#line 59 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	zeitgeist_event_set_timestamp (e, (gint64) 1234567890L);
#line 60 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	zeitgeist_event_set_interpretation (e, "interpretation_uri");
#line 61 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	zeitgeist_event_set_manifestation (e, "manifestation_uri");
#line 62 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	zeitgeist_event_set_actor (e, "test.desktop");
#line 63 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	zeitgeist_event_set_origin (e, "source");
#line 65 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	result = e;
#line 65 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	return result;
#line 205 "marshalling-test.c"
}


void subject_test (void) {
	GError * _inner_error_ = NULL;
	{
		gint i;
#line 70 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		i = 0;
#line 215 "marshalling-test.c"
		{
			gboolean _tmp0_;
#line 70 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
			_tmp0_ = TRUE;
#line 70 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
			while (TRUE) {
#line 222 "marshalling-test.c"
				gboolean _tmp1_;
				gint _tmp3_;
				ZeitgeistSubject* _tmp4_ = NULL;
				ZeitgeistSubject* _tmp5_;
				GVariant* _tmp6_ = NULL;
				GVariant* _tmp7_;
				GVariant* vsubject;
				GVariant* _tmp8_;
				ZeitgeistSubject* _tmp9_;
				ZeitgeistSubject* subject;
				ZeitgeistSubject* _tmp10_;
#line 70 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp1_ = _tmp0_;
#line 70 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				if (!_tmp1_) {
#line 238 "marshalling-test.c"
					gint _tmp2_;
#line 70 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
					_tmp2_ = i;
#line 70 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
					i = _tmp2_ + 1;
#line 244 "marshalling-test.c"
				}
#line 70 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp0_ = FALSE;
#line 70 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp3_ = i;
#line 70 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				if (!(_tmp3_ < 1000)) {
#line 70 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
					break;
#line 254 "marshalling-test.c"
				}
#line 72 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp4_ = create_subject ();
#line 72 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp5_ = _tmp4_;
#line 72 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp6_ = zeitgeist_subject_to_variant (_tmp5_);
#line 72 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp7_ = _tmp6_;
#line 72 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_g_object_unref0 (_tmp5_);
#line 72 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				vsubject = _tmp7_;
#line 73 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp8_ = vsubject;
#line 73 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp9_ = zeitgeist_subject_new_from_variant (_tmp8_, &_inner_error_);
#line 73 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				subject = _tmp9_;
#line 73 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				if (_inner_error_ != NULL) {
#line 73 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
					_g_variant_unref0 (vsubject);
#line 73 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 73 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
					g_clear_error (&_inner_error_);
#line 73 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
					return;
#line 284 "marshalling-test.c"
				}
#line 74 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp10_ = subject;
#line 74 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				g_warn_if_fail (_tmp10_ != NULL);
#line 70 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_g_object_unref0 (subject);
#line 70 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_g_variant_unref0 (vsubject);
#line 294 "marshalling-test.c"
			}
		}
	}
}


void event_test (void) {
	GError * _inner_error_ = NULL;
	{
		gint i;
#line 80 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		i = 0;
#line 307 "marshalling-test.c"
		{
			gboolean _tmp0_;
#line 80 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
			_tmp0_ = TRUE;
#line 80 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
			while (TRUE) {
#line 314 "marshalling-test.c"
				gboolean _tmp1_;
				gint _tmp3_;
				ZeitgeistEvent* _tmp4_ = NULL;
				ZeitgeistEvent* _tmp5_;
				GVariant* _tmp6_ = NULL;
				GVariant* _tmp7_;
				GVariant* vevent;
				GVariant* _tmp8_;
				ZeitgeistEvent* _tmp9_;
				ZeitgeistEvent* event;
				ZeitgeistEvent* _tmp10_;
#line 80 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp1_ = _tmp0_;
#line 80 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				if (!_tmp1_) {
#line 330 "marshalling-test.c"
					gint _tmp2_;
#line 80 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
					_tmp2_ = i;
#line 80 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
					i = _tmp2_ + 1;
#line 336 "marshalling-test.c"
				}
#line 80 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp0_ = FALSE;
#line 80 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp3_ = i;
#line 80 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				if (!(_tmp3_ < 1000)) {
#line 80 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
					break;
#line 346 "marshalling-test.c"
				}
#line 82 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp4_ = create_event ();
#line 82 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp5_ = _tmp4_;
#line 82 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp6_ = zeitgeist_event_to_variant (_tmp5_);
#line 82 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp7_ = _tmp6_;
#line 82 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_g_object_unref0 (_tmp5_);
#line 82 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				vevent = _tmp7_;
#line 83 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp8_ = vevent;
#line 83 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp9_ = zeitgeist_event_new_from_variant (_tmp8_, &_inner_error_);
#line 83 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				event = _tmp9_;
#line 83 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				if (_inner_error_ != NULL) {
#line 83 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
					_g_variant_unref0 (vevent);
#line 83 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 83 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
					g_clear_error (&_inner_error_);
#line 83 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
					return;
#line 376 "marshalling-test.c"
				}
#line 84 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp10_ = event;
#line 84 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				g_warn_if_fail (_tmp10_ != NULL);
#line 80 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_g_object_unref0 (event);
#line 80 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_g_variant_unref0 (vevent);
#line 386 "marshalling-test.c"
			}
		}
	}
}


static void _g_object_unref0_ (gpointer var) {
#line 90 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
#line 396 "marshalling-test.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 95 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	return self ? g_object_ref (self) : NULL;
#line 403 "marshalling-test.c"
}


static gint g_ptr_array_get_length (GPtrArray* self) {
	gint result;
	guint _tmp0_;
#line 4095 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, 0);
#line 4095 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
	_tmp0_ = self->len;
#line 4095 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
	result = (gint) _tmp0_;
#line 4095 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
	return result;
#line 418 "marshalling-test.c"
}


static void g_ptr_array_set_length (GPtrArray* self, gint value) {
	gint _tmp0_;
#line 4096 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
	g_return_if_fail (self != NULL);
#line 4096 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
	_tmp0_ = value;
#line 4096 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
	g_ptr_array_set_size (self, _tmp0_);
#line 430 "marshalling-test.c"
}


void events_test (void) {
	GPtrArray* _tmp0_;
	GPtrArray* events;
	GPtrArray* _tmp12_;
	GVariant* _tmp13_ = NULL;
	GVariant* vevents;
	GPtrArray* _tmp14_ = NULL;
	GPtrArray* demarshalled;
	gint _tmp15_;
	gint _tmp16_;
	GError * _inner_error_ = NULL;
#line 90 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp0_ = g_ptr_array_new_with_free_func (_g_object_unref0_);
#line 90 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	events = _tmp0_;
#line 449 "marshalling-test.c"
	{
		gint i;
#line 91 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		i = 0;
#line 454 "marshalling-test.c"
		{
			gboolean _tmp1_;
#line 91 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
			_tmp1_ = TRUE;
#line 91 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
			while (TRUE) {
#line 461 "marshalling-test.c"
				gboolean _tmp2_;
				gint _tmp4_;
				ZeitgeistEvent* _tmp5_ = NULL;
				ZeitgeistEvent* e;
				ZeitgeistEvent* _tmp6_;
				ZeitgeistSubject* _tmp7_ = NULL;
				ZeitgeistSubject* _tmp8_;
				GPtrArray* _tmp9_;
				ZeitgeistEvent* _tmp10_;
				ZeitgeistEvent* _tmp11_;
#line 91 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp2_ = _tmp1_;
#line 91 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				if (!_tmp2_) {
#line 476 "marshalling-test.c"
					gint _tmp3_;
#line 91 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
					_tmp3_ = i;
#line 91 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
					i = _tmp3_ + 1;
#line 482 "marshalling-test.c"
				}
#line 91 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp1_ = FALSE;
#line 91 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp4_ = i;
#line 91 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				if (!(_tmp4_ < 1000)) {
#line 91 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
					break;
#line 492 "marshalling-test.c"
				}
#line 93 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp5_ = create_event ();
#line 93 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				e = _tmp5_;
#line 94 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp6_ = e;
#line 94 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp7_ = create_subject ();
#line 94 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp8_ = _tmp7_;
#line 94 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				zeitgeist_event_add_subject (_tmp6_, _tmp8_);
#line 94 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_g_object_unref0 (_tmp8_);
#line 95 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp9_ = events;
#line 95 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp10_ = e;
#line 95 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp11_ = _g_object_ref0 (_tmp10_);
#line 95 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				g_ptr_array_add (_tmp9_, _tmp11_);
#line 91 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_g_object_unref0 (e);
#line 518 "marshalling-test.c"
			}
		}
	}
#line 98 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp12_ = events;
#line 98 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp13_ = zeitgeist_events_to_variant (_tmp12_);
#line 98 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	vevents = _tmp13_;
#line 100 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp14_ = zeitgeist_events_from_variant (vevents, &_inner_error_);
#line 100 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	demarshalled = _tmp14_;
#line 100 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	if (_inner_error_ != NULL) {
#line 100 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		_g_variant_unref0 (vevents);
#line 100 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		_g_ptr_array_unref0 (events);
#line 100 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 100 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		g_clear_error (&_inner_error_);
#line 100 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		return;
#line 544 "marshalling-test.c"
	}
#line 101 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp15_ = g_ptr_array_get_length (demarshalled);
#line 101 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp16_ = _tmp15_;
#line 101 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	g_assert_cmpint (_tmp16_, ==, 1000);
#line 88 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_g_ptr_array_unref0 (demarshalled);
#line 88 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_g_variant_unref0 (vevents);
#line 88 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_g_ptr_array_unref0 (events);
#line 558 "marshalling-test.c"
}


void timerange_test (void) {
	GError * _inner_error_ = NULL;
	{
		gint64 i;
#line 106 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		i = (gint64) 0;
#line 568 "marshalling-test.c"
		{
			gboolean _tmp0_;
#line 106 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
			_tmp0_ = TRUE;
#line 106 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
			while (TRUE) {
#line 575 "marshalling-test.c"
				gboolean _tmp1_;
				gint64 _tmp3_;
				gint64 _tmp4_;
				gint64 _tmp5_;
				GVariant* _tmp6_;
				GVariant* v;
				GVariant* _tmp7_;
				ZeitgeistTimeRange* _tmp8_;
				ZeitgeistTimeRange* timerange;
				ZeitgeistTimeRange* _tmp9_;
				gint64 _tmp10_;
				gint64 _tmp11_;
				gint64 _tmp12_;
				ZeitgeistTimeRange* _tmp13_;
				gint64 _tmp14_;
				gint64 _tmp15_;
				gint64 _tmp16_;
#line 106 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp1_ = _tmp0_;
#line 106 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				if (!_tmp1_) {
#line 597 "marshalling-test.c"
					gint64 _tmp2_;
#line 106 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
					_tmp2_ = i;
#line 106 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
					i = _tmp2_ + 1;
#line 603 "marshalling-test.c"
				}
#line 106 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp0_ = FALSE;
#line 106 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp3_ = i;
#line 106 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				if (!(_tmp3_ < ((gint64) 1000))) {
#line 106 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
					break;
#line 613 "marshalling-test.c"
				}
#line 108 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp4_ = i;
#line 108 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp5_ = i;
#line 108 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp6_ = g_variant_new ("(xx)", _tmp4_, _tmp5_ + 42, NULL);
#line 108 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				g_variant_ref_sink (_tmp6_);
#line 108 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				v = _tmp6_;
#line 109 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp7_ = v;
#line 109 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp8_ = zeitgeist_time_range_new_from_variant (_tmp7_, &_inner_error_);
#line 109 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				timerange = _tmp8_;
#line 109 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				if (_inner_error_ != NULL) {
#line 109 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
					_g_variant_unref0 (v);
#line 109 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 109 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
					g_clear_error (&_inner_error_);
#line 109 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
					return;
#line 641 "marshalling-test.c"
				}
#line 110 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp9_ = timerange;
#line 110 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp10_ = zeitgeist_time_range_get_start (_tmp9_);
#line 110 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp11_ = _tmp10_;
#line 110 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp12_ = i;
#line 110 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				g_assert_cmpint ((gint) _tmp11_, ==, (gint) _tmp12_);
#line 111 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp13_ = timerange;
#line 111 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp14_ = zeitgeist_time_range_get_end (_tmp13_);
#line 111 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp15_ = _tmp14_;
#line 111 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_tmp16_ = i;
#line 111 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				g_assert_cmpint ((gint) _tmp15_, ==, ((gint) _tmp16_) + 42);
#line 106 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_g_object_unref0 (timerange);
#line 106 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
				_g_variant_unref0 (v);
#line 667 "marshalling-test.c"
			}
		}
	}
}


void corrupt_events_test (void) {
	GVariant* _tmp0_;
	GVariant* v;
	gboolean error_thrown;
	gboolean _tmp3_;
	GError * _inner_error_ = NULL;
#line 118 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp0_ = g_variant_new ("(s)", "Zeitgeist is so awesome", NULL);
#line 118 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	g_variant_ref_sink (_tmp0_);
#line 118 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	v = _tmp0_;
#line 119 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	error_thrown = FALSE;
#line 688 "marshalling-test.c"
	{
		ZeitgeistEvent* _tmp1_;
		ZeitgeistEvent* _tmp2_;
#line 122 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		_tmp1_ = zeitgeist_event_new_from_variant (v, &_inner_error_);
#line 122 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		_tmp2_ = _tmp1_;
#line 122 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		_g_object_unref0 (_tmp2_);
#line 122 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		if (_inner_error_ != NULL) {
#line 122 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
			if (g_error_matches (_inner_error_, ZEITGEIST_DATA_MODEL_ERROR, ZEITGEIST_DATA_MODEL_ERROR_INVALID_SIGNATURE)) {
#line 702 "marshalling-test.c"
				goto __catch0_zeitgeist_data_model_error_invalid_signature;
			}
			goto __finally0;
		}
	}
	goto __finally0;
	__catch0_zeitgeist_data_model_error_invalid_signature:
	{
		GError* err = NULL;
#line 120 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		err = _inner_error_;
#line 120 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		_inner_error_ = NULL;
#line 125 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		error_thrown = TRUE;
#line 120 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		_g_error_free0 (err);
#line 720 "marshalling-test.c"
	}
	__finally0:
#line 120 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	if (_inner_error_ != NULL) {
#line 120 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		_g_variant_unref0 (v);
#line 120 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 120 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		g_clear_error (&_inner_error_);
#line 120 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		return;
#line 733 "marshalling-test.c"
	}
#line 127 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp3_ = error_thrown;
#line 127 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_vala_assert (_tmp3_, "error_thrown");
#line 115 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_g_variant_unref0 (v);
#line 741 "marshalling-test.c"
}


void corrupt_subjects_test (void) {
	GVariant* v = NULL;
	gchar** arr = NULL;
	gint arr_length1 = 0;
	gint _arr_size_ = 0;
	gboolean error_thrown = FALSE;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar** _tmp8_ = NULL;
	gchar** _tmp9_;
	gint _tmp9__length1;
	GVariant* _tmp10_;
	GVariant* _tmp11_;
	ZeitgeistSubject* _tmp12_;
	ZeitgeistSubject* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	gchar** _tmp21_ = NULL;
	gchar** _tmp22_;
	gint _tmp22__length1;
	GVariant* _tmp23_;
	GVariant* _tmp24_;
	ZeitgeistSubject* _tmp25_;
	ZeitgeistSubject* _tmp26_;
	gchar* _tmp27_;
	gchar* _tmp28_;
	gchar* _tmp29_;
	gchar* _tmp30_;
	gchar* _tmp31_;
	gchar* _tmp32_;
	gchar** _tmp33_ = NULL;
	gchar** _tmp34_;
	gint _tmp34__length1;
	GVariant* _tmp35_;
	gboolean _tmp40_;
	GVariant* _tmp41_;
	gboolean _tmp45_;
	GError * _inner_error_ = NULL;
#line 137 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp0_ = g_strdup ("uri");
#line 137 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp1_ = g_strdup ("interpretation");
#line 137 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp2_ = g_strdup ("manifestation");
#line 137 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp3_ = g_strdup ("origin");
#line 137 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp4_ = g_strdup ("mimetype");
#line 137 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp5_ = g_strdup ("text");
#line 137 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp6_ = g_strdup ("storage");
#line 137 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp7_ = g_strdup ("current_uri");
#line 137 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp8_ = g_new0 (gchar*, 8 + 1);
#line 137 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp8_[0] = _tmp0_;
#line 137 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp8_[1] = _tmp1_;
#line 137 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp8_[2] = _tmp2_;
#line 137 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp8_[3] = _tmp3_;
#line 137 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp8_[4] = _tmp4_;
#line 137 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp8_[5] = _tmp5_;
#line 137 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp8_[6] = _tmp6_;
#line 137 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp8_[7] = _tmp7_;
#line 137 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	arr = (_vala_array_free (arr, arr_length1, (GDestroyNotify) g_free), NULL);
#line 137 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	arr = _tmp8_;
#line 137 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	arr_length1 = 8;
#line 137 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_arr_size_ = arr_length1;
#line 139 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp9_ = arr;
#line 139 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp9__length1 = arr_length1;
#line 139 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp10_ = g_variant_new_strv (_tmp9_, _tmp9__length1);
#line 139 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	g_variant_ref_sink (_tmp10_);
#line 139 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_g_variant_unref0 (v);
#line 139 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	v = _tmp10_;
#line 140 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp11_ = v;
#line 140 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp12_ = zeitgeist_subject_new_from_variant (_tmp11_, &_inner_error_);
#line 140 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp13_ = _tmp12_;
#line 140 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_g_object_unref0 (_tmp13_);
#line 140 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	if (_inner_error_ != NULL) {
#line 140 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		arr = (_vala_array_free (arr, arr_length1, (GDestroyNotify) g_free), NULL);
#line 140 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		_g_variant_unref0 (v);
#line 140 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 140 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		g_clear_error (&_inner_error_);
#line 140 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		return;
#line 868 "marshalling-test.c"
	}
#line 143 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp14_ = g_strdup ("uri");
#line 143 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp15_ = g_strdup ("interpretation");
#line 143 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp16_ = g_strdup ("manifestation");
#line 143 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp17_ = g_strdup ("origin");
#line 143 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp18_ = g_strdup ("mimetype");
#line 143 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp19_ = g_strdup ("text");
#line 143 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp20_ = g_strdup ("storage");
#line 143 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp21_ = g_new0 (gchar*, 7 + 1);
#line 143 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp21_[0] = _tmp14_;
#line 143 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp21_[1] = _tmp15_;
#line 143 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp21_[2] = _tmp16_;
#line 143 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp21_[3] = _tmp17_;
#line 143 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp21_[4] = _tmp18_;
#line 143 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp21_[5] = _tmp19_;
#line 143 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp21_[6] = _tmp20_;
#line 143 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	arr = (_vala_array_free (arr, arr_length1, (GDestroyNotify) g_free), NULL);
#line 143 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	arr = _tmp21_;
#line 143 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	arr_length1 = 7;
#line 143 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_arr_size_ = arr_length1;
#line 145 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp22_ = arr;
#line 145 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp22__length1 = arr_length1;
#line 145 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp23_ = g_variant_new_strv (_tmp22_, _tmp22__length1);
#line 145 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	g_variant_ref_sink (_tmp23_);
#line 145 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_g_variant_unref0 (v);
#line 145 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	v = _tmp23_;
#line 146 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp24_ = v;
#line 146 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp25_ = zeitgeist_subject_new_from_variant (_tmp24_, &_inner_error_);
#line 146 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp26_ = _tmp25_;
#line 146 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_g_object_unref0 (_tmp26_);
#line 146 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	if (_inner_error_ != NULL) {
#line 146 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		arr = (_vala_array_free (arr, arr_length1, (GDestroyNotify) g_free), NULL);
#line 146 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		_g_variant_unref0 (v);
#line 146 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 146 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		g_clear_error (&_inner_error_);
#line 146 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		return;
#line 940 "marshalling-test.c"
	}
#line 149 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp27_ = g_strdup ("uri");
#line 149 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp28_ = g_strdup ("interpretation");
#line 149 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp29_ = g_strdup ("manifestation");
#line 149 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp30_ = g_strdup ("origin");
#line 149 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp31_ = g_strdup ("mimetype");
#line 149 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp32_ = g_strdup ("text");
#line 149 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp33_ = g_new0 (gchar*, 6 + 1);
#line 149 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp33_[0] = _tmp27_;
#line 149 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp33_[1] = _tmp28_;
#line 149 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp33_[2] = _tmp29_;
#line 149 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp33_[3] = _tmp30_;
#line 149 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp33_[4] = _tmp31_;
#line 149 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp33_[5] = _tmp32_;
#line 149 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	arr = (_vala_array_free (arr, arr_length1, (GDestroyNotify) g_free), NULL);
#line 149 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	arr = _tmp33_;
#line 149 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	arr_length1 = 6;
#line 149 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_arr_size_ = arr_length1;
#line 151 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp34_ = arr;
#line 151 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp34__length1 = arr_length1;
#line 151 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp35_ = g_variant_new_strv (_tmp34_, _tmp34__length1);
#line 151 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	g_variant_ref_sink (_tmp35_);
#line 151 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_g_variant_unref0 (v);
#line 151 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	v = _tmp35_;
#line 152 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	error_thrown = FALSE;
#line 990 "marshalling-test.c"
	{
		GVariant* _tmp36_;
		ZeitgeistSubject* _tmp37_;
		ZeitgeistSubject* _tmp38_;
#line 155 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		_tmp36_ = v;
#line 155 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		_tmp37_ = zeitgeist_subject_new_from_variant (_tmp36_, &_inner_error_);
#line 155 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		_tmp38_ = _tmp37_;
#line 155 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		_g_object_unref0 (_tmp38_);
#line 155 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		if (_inner_error_ != NULL) {
#line 155 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
			if (_inner_error_->domain == ZEITGEIST_DATA_MODEL_ERROR) {
#line 1007 "marshalling-test.c"
				goto __catch1_zeitgeist_data_model_error;
			}
#line 155 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
			arr = (_vala_array_free (arr, arr_length1, (GDestroyNotify) g_free), NULL);
#line 155 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
			_g_variant_unref0 (v);
#line 155 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 155 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
			g_clear_error (&_inner_error_);
#line 155 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
			return;
#line 1020 "marshalling-test.c"
		}
	}
	goto __finally1;
	__catch1_zeitgeist_data_model_error:
	{
		GError* err = NULL;
		GError* _tmp39_;
#line 153 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		err = _inner_error_;
#line 153 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		_inner_error_ = NULL;
#line 159 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		_tmp39_ = err;
#line 159 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		_vala_assert (g_error_matches (_tmp39_, ZEITGEIST_DATA_MODEL_ERROR, ZEITGEIST_DATA_MODEL_ERROR_INVALID_SIGNATURE), "err is DataModelError.INVALID_SIGNATURE");
#line 160 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		error_thrown = TRUE;
#line 153 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		_g_error_free0 (err);
#line 1040 "marshalling-test.c"
	}
	__finally1:
#line 153 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	if (_inner_error_ != NULL) {
#line 153 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		arr = (_vala_array_free (arr, arr_length1, (GDestroyNotify) g_free), NULL);
#line 153 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		_g_variant_unref0 (v);
#line 153 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 153 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		g_clear_error (&_inner_error_);
#line 153 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		return;
#line 1055 "marshalling-test.c"
	}
#line 162 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp40_ = error_thrown;
#line 162 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_vala_assert (_tmp40_, "error_thrown");
#line 165 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp41_ = g_variant_new ("(x)", 42, NULL);
#line 165 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	g_variant_ref_sink (_tmp41_);
#line 165 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_g_variant_unref0 (v);
#line 165 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	v = _tmp41_;
#line 166 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	error_thrown = FALSE;
#line 1071 "marshalling-test.c"
	{
		GVariant* _tmp42_;
		ZeitgeistSubject* _tmp43_;
		ZeitgeistSubject* _tmp44_;
#line 169 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		_tmp42_ = v;
#line 169 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		_tmp43_ = zeitgeist_subject_new_from_variant (_tmp42_, &_inner_error_);
#line 169 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		_tmp44_ = _tmp43_;
#line 169 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		_g_object_unref0 (_tmp44_);
#line 169 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		if (_inner_error_ != NULL) {
#line 169 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
			if (g_error_matches (_inner_error_, ZEITGEIST_DATA_MODEL_ERROR, ZEITGEIST_DATA_MODEL_ERROR_INVALID_SIGNATURE)) {
#line 1088 "marshalling-test.c"
				goto __catch2_zeitgeist_data_model_error_invalid_signature;
			}
			goto __finally2;
		}
	}
	goto __finally2;
	__catch2_zeitgeist_data_model_error_invalid_signature:
	{
		GError* err = NULL;
#line 167 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		err = _inner_error_;
#line 167 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		_inner_error_ = NULL;
#line 173 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		error_thrown = TRUE;
#line 167 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		_g_error_free0 (err);
#line 1106 "marshalling-test.c"
	}
	__finally2:
#line 167 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	if (_inner_error_ != NULL) {
#line 167 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		arr = (_vala_array_free (arr, arr_length1, (GDestroyNotify) g_free), NULL);
#line 167 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		_g_variant_unref0 (v);
#line 167 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 167 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		g_clear_error (&_inner_error_);
#line 167 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		return;
#line 1121 "marshalling-test.c"
	}
#line 175 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp45_ = error_thrown;
#line 175 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_vala_assert (_tmp45_, "error_thrown");
#line 130 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	arr = (_vala_array_free (arr, arr_length1, (GDestroyNotify) g_free), NULL);
#line 130 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_g_variant_unref0 (v);
#line 1131 "marshalling-test.c"
}


void corrupt_timerange_test (void) {
	GVariant* _tmp0_;
	GVariant* v;
	gboolean error_thrown;
	GError * _inner_error_ = NULL;
#line 180 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_tmp0_ = g_variant_new ("(s)", "oh noes, what is this?", NULL);
#line 180 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	g_variant_ref_sink (_tmp0_);
#line 180 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	v = _tmp0_;
#line 181 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	error_thrown = FALSE;
#line 1148 "marshalling-test.c"
	{
		ZeitgeistTimeRange* _tmp1_;
		ZeitgeistTimeRange* _tmp2_;
#line 184 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		_tmp1_ = zeitgeist_time_range_new_from_variant (v, &_inner_error_);
#line 184 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		_tmp2_ = _tmp1_;
#line 184 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		_g_object_unref0 (_tmp2_);
#line 184 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		if (_inner_error_ != NULL) {
#line 184 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
			if (g_error_matches (_inner_error_, ZEITGEIST_DATA_MODEL_ERROR, ZEITGEIST_DATA_MODEL_ERROR_INVALID_SIGNATURE)) {
#line 1162 "marshalling-test.c"
				goto __catch3_zeitgeist_data_model_error_invalid_signature;
			}
			goto __finally3;
		}
	}
	goto __finally3;
	__catch3_zeitgeist_data_model_error_invalid_signature:
	{
		GError* err = NULL;
#line 182 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		err = _inner_error_;
#line 182 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		_inner_error_ = NULL;
#line 188 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		error_thrown = TRUE;
#line 182 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		_g_error_free0 (err);
#line 1180 "marshalling-test.c"
	}
	__finally3:
#line 182 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	if (_inner_error_ != NULL) {
#line 182 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		_g_variant_unref0 (v);
#line 182 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 182 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		g_clear_error (&_inner_error_);
#line 182 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
		return;
#line 1193 "marshalling-test.c"
	}
#line 178 "/home/manish/code/zeitgeist/test/direct/marshalling-test.vala"
	_g_variant_unref0 (v);
#line 1197 "marshalling-test.c"
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}



