/* test-shared-update.c generated by valac 0.14.0, the Vala compiler
 * generated from test-shared-update.vala, do not modify */


#include <glib.h>
#include <glib-object.h>
#include <libtracker-sparql/tracker-sparql.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>


#define TYPE_TEST_APP (test_app_get_type ())
#define TEST_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TEST_APP, TestApp))
#define TEST_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TEST_APP, TestAppClass))
#define IS_TEST_APP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TEST_APP))
#define IS_TEST_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TEST_APP))
#define TEST_APP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TEST_APP, TestAppClass))

typedef struct _TestApp TestApp;
typedef struct _TestAppClass TestAppClass;
typedef struct _TestAppPrivate TestAppPrivate;
#define _g_main_loop_unref0(var) ((var == NULL) ? NULL : (var = (g_main_loop_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _TestAppUpdateQueryAsyncData TestAppUpdateQueryAsyncData;
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
typedef struct _TestAppUpdateBlankQueryAsyncData TestAppUpdateBlankQueryAsyncData;
typedef struct _TestAppDoAsyncTestsData TestAppDoAsyncTestsData;

struct _TestApp {
	GObject parent_instance;
	TestAppPrivate * priv;
};

struct _TestAppClass {
	GObjectClass parent_class;
};

struct _TestAppPrivate {
	GMainLoop* loop;
	TrackerSparqlConnection* con;
	gint res;
};

struct _TestAppUpdateQueryAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TestApp* self;
	TrackerSparqlCursor* cursor;
	gint a;
	TrackerSparqlConnection* _tmp0_;
	GError* ea;
	GError* _tmp1_;
	const gchar* _tmp2_;
	TrackerSparqlConnection* _tmp3_;
	TrackerSparqlCursor* _tmp4_;
	TrackerSparqlCursor* _tmp5_;
	TrackerSparqlCursor* _tmp6_;
	gint _tmp7_;
	GError* eb;
	GError* _tmp8_;
	const gchar* _tmp9_;
	GError * _inner_error_;
};

struct _TestAppUpdateBlankQueryAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TestApp* self;
	GVariant* variant;
	gint a;
	TrackerSparqlConnection* _tmp0_;
	GVariant* _tmp1_;
	GVariant* _tmp2_;
	GVariant* _tmp3_;
	gint _tmp4_;
	GError* e;
	GError* _tmp5_;
	const gchar* _tmp6_;
	GError * _inner_error_;
};

struct _TestAppDoAsyncTestsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TestApp* self;
	GMainLoop* _tmp0_;
};


static gpointer test_app_parent_class = NULL;

GType test_app_get_type (void) G_GNUC_CONST;
#define TEST_APP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_TEST_APP, TestAppPrivate))
enum  {
	TEST_APP_DUMMY_PROPERTY
};
TestApp* test_app_new (TrackerSparqlConnection* connection);
TestApp* test_app_construct (GType object_type, TrackerSparqlConnection* connection);
static gint test_app_iter_cursor (TestApp* self, TrackerSparqlCursor* cursor);
static gint test_app_iter_variant (TestApp* self, GVariant* variant);
static void test_app_update_query (TestApp* self);
static void test_app_update_query_async_data_free (gpointer _data);
static void test_app_update_query_async (TestApp* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void test_app_update_query_finish (TestApp* self, GAsyncResult* _res_);
static gboolean test_app_update_query_async_co (TestAppUpdateQueryAsyncData* _data_);
static void test_app_update_query_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void test_app_update_blank_query (TestApp* self);
static void test_app_update_blank_query_async_data_free (gpointer _data);
static void test_app_update_blank_query_async (TestApp* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void test_app_update_blank_query_finish (TestApp* self, GAsyncResult* _res_);
static gboolean test_app_update_blank_query_async_co (TestAppUpdateBlankQueryAsyncData* _data_);
static void test_app_update_blank_query_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void test_app_do_sync_tests (TestApp* self);
static void test_app_do_async_tests_data_free (gpointer _data);
static void test_app_do_async_tests (TestApp* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void test_app_do_async_tests_finish (TestApp* self, GAsyncResult* _res_);
static gboolean test_app_do_async_tests_co (TestAppDoAsyncTestsData* _data_);
static void test_app_do_async_tests_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static gboolean test_app_in_mainloop (TestApp* self);
gint test_app_run (TestApp* self);
static gboolean _test_app_in_mainloop_gsource_func (gpointer self);
static void test_app_finalize (GObject* obj);


static gpointer _g_object_ref0 (gpointer self) {
#line 11 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	return self ? g_object_ref (self) : NULL;
#line 137 "test-shared-update.c"
}


TestApp* test_app_construct (GType object_type, TrackerSparqlConnection* connection) {
	TestApp * self = NULL;
	TrackerSparqlConnection* _tmp0_;
	TrackerSparqlConnection* _tmp1_;
#line 10 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	g_return_val_if_fail (connection != NULL, NULL);
#line 10 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	self = (TestApp*) g_object_new (object_type, NULL);
#line 11 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_tmp0_ = connection;
#line 11 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_tmp1_ = _g_object_ref0 (_tmp0_);
#line 11 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_g_object_unref0 (self->priv->con);
#line 11 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	self->priv->con = _tmp1_;
#line 10 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	return self;
#line 159 "test-shared-update.c"
}


TestApp* test_app_new (TrackerSparqlConnection* connection) {
#line 10 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	return test_app_construct (TYPE_TEST_APP, connection);
#line 166 "test-shared-update.c"
}


static gint test_app_iter_cursor (TestApp* self, TrackerSparqlCursor* cursor) {
	gint result = 0;
	GError * _inner_error_ = NULL;
#line 14 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	g_return_val_if_fail (self != NULL, 0);
#line 14 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	g_return_val_if_fail (cursor != NULL, 0);
#line 177 "test-shared-update.c"
	{
#line 16 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		while (TRUE) {
#line 181 "test-shared-update.c"
			TrackerSparqlCursor* _tmp0_;
			gboolean _tmp1_ = FALSE;
			gboolean _tmp2_;
			gint i = 0;
#line 16 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
			_tmp0_ = cursor;
#line 16 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
			_tmp1_ = tracker_sparql_cursor_next (_tmp0_, NULL, &_inner_error_);
#line 16 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
			_tmp2_ = _tmp1_;
#line 16 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
			if (_inner_error_ != NULL) {
#line 194 "test-shared-update.c"
				goto __catch0_g_error;
			}
#line 16 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
			if (!_tmp2_) {
#line 16 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
				break;
#line 201 "test-shared-update.c"
			}
			{
				gboolean _tmp3_;
#line 19 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
				i = 0;
#line 19 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
				_tmp3_ = TRUE;
#line 19 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
				while (TRUE) {
#line 211 "test-shared-update.c"
					gboolean _tmp4_;
					gint _tmp6_;
					TrackerSparqlCursor* _tmp7_;
					gint _tmp8_;
					gint _tmp9_;
					const gchar* _tmp10_ = NULL;
					gint _tmp11_;
					const gchar* _tmp12_;
					TrackerSparqlCursor* _tmp13_;
					gint _tmp14_;
					const gchar* _tmp15_ = NULL;
#line 19 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
					_tmp4_ = _tmp3_;
#line 19 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
					if (!_tmp4_) {
#line 227 "test-shared-update.c"
						gint _tmp5_;
#line 19 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
						_tmp5_ = i;
#line 19 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
						i = _tmp5_ + 1;
#line 233 "test-shared-update.c"
					}
#line 19 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
					_tmp3_ = FALSE;
#line 19 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
					_tmp6_ = i;
#line 19 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
					_tmp7_ = cursor;
#line 19 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
					_tmp8_ = tracker_sparql_cursor_get_n_columns (_tmp7_);
#line 19 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
					_tmp9_ = _tmp8_;
#line 19 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
					if (!(_tmp6_ < _tmp9_)) {
#line 19 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
						break;
#line 249 "test-shared-update.c"
					}
#line 20 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
					_tmp11_ = i;
#line 20 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
					if (_tmp11_ != 0) {
#line 20 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
						_tmp10_ = ",";
#line 257 "test-shared-update.c"
					} else {
#line 20 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
						_tmp10_ = "";
#line 261 "test-shared-update.c"
					}
#line 20 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
					_tmp12_ = _tmp10_;
#line 20 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
					_tmp13_ = cursor;
#line 20 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
					_tmp14_ = i;
#line 20 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
					_tmp15_ = tracker_sparql_cursor_get_string (_tmp13_, _tmp14_, NULL);
#line 20 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
					g_print ("%s%s", _tmp12_, _tmp15_);
#line 273 "test-shared-update.c"
				}
			}
#line 23 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
			g_print ("\n");
#line 278 "test-shared-update.c"
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp16_;
		const gchar* _tmp17_;
#line 15 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		e = _inner_error_;
#line 15 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_inner_error_ = NULL;
#line 26 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_tmp16_ = e;
#line 26 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_tmp17_ = _tmp16_->message;
#line 26 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		g_warning ("test-shared-update.vala:26: Couldn't iterate query results: %s", _tmp17_);
#line 27 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		result = -1;
#line 27 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_g_error_free0 (e);
#line 27 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		return result;
#line 303 "test-shared-update.c"
	}
	__finally0:
#line 15 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	if (_inner_error_ != NULL) {
#line 15 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.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 15 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		g_clear_error (&_inner_error_);
#line 15 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		return 0;
#line 314 "test-shared-update.c"
	}
#line 30 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	result = 0;
#line 30 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	return result;
#line 320 "test-shared-update.c"
}


static gint test_app_iter_variant (TestApp* self, GVariant* variant) {
	gint result = 0;
#line 33 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	g_return_val_if_fail (self != NULL, 0);
#line 33 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	g_return_val_if_fail (variant != NULL, 0);
#line 38 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	result = 0;
#line 38 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	return result;
#line 334 "test-shared-update.c"
}


static void test_app_update_query (TestApp* self) {
	TrackerSparqlCursor* cursor = NULL;
	gint a = 0;
	GError * _inner_error_ = NULL;
#line 41 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	g_return_if_fail (self != NULL);
#line 344 "test-shared-update.c"
	{
		TrackerSparqlConnection* _tmp0_;
#line 46 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_tmp0_ = self->priv->con;
#line 46 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		tracker_sparql_connection_update (_tmp0_, "INSERT { <test01> a nie:InformationElement ; nie:title 'test01' }", G_PRIORITY_DEFAULT, NULL, &_inner_error_);
#line 46 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		if (_inner_error_ != NULL) {
#line 353 "test-shared-update.c"
			goto __catch1_g_error;
		}
	}
	goto __finally1;
	__catch1_g_error:
	{
		GError* e = NULL;
		GError* _tmp1_;
		const gchar* _tmp2_;
#line 45 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		e = _inner_error_;
#line 45 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_inner_error_ = NULL;
#line 48 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_tmp1_ = e;
#line 48 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_tmp2_ = _tmp1_->message;
#line 48 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		g_warning ("test-shared-update.vala:48: Couldn't update: %s", _tmp2_);
#line 49 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		self->priv->res = -1;
#line 45 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_g_error_free0 (e);
#line 377 "test-shared-update.c"
	}
	__finally1:
#line 45 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	if (_inner_error_ != NULL) {
#line 45 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_g_object_unref0 (cursor);
#line 45 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.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 45 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		g_clear_error (&_inner_error_);
#line 45 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		return;
#line 390 "test-shared-update.c"
	}
	{
		TrackerSparqlConnection* _tmp3_;
		TrackerSparqlCursor* _tmp4_ = NULL;
		TrackerSparqlCursor* _tmp5_;
		TrackerSparqlCursor* _tmp6_;
		gint _tmp7_ = 0;
#line 53 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_tmp3_ = self->priv->con;
#line 53 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_tmp4_ = tracker_sparql_connection_query (_tmp3_, "SELECT ?title WHERE { <test01> nie:title ?title }", NULL, &_inner_error_);
#line 53 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_tmp5_ = _tmp4_;
#line 53 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		if (_inner_error_ != NULL) {
#line 406 "test-shared-update.c"
			goto __catch2_g_error;
		}
#line 53 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_g_object_unref0 (cursor);
#line 53 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		cursor = _tmp5_;
#line 54 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_tmp6_ = cursor;
#line 54 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_tmp7_ = test_app_iter_cursor (self, _tmp6_);
#line 54 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		a = _tmp7_;
#line 419 "test-shared-update.c"
	}
	goto __finally2;
	__catch2_g_error:
	{
		GError* e = NULL;
		GError* _tmp8_;
		const gchar* _tmp9_;
#line 52 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		e = _inner_error_;
#line 52 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_inner_error_ = NULL;
#line 56 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_tmp8_ = e;
#line 56 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_tmp9_ = _tmp8_->message;
#line 56 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		g_warning ("test-shared-update.vala:56: Couldn't query: %s", _tmp9_);
#line 57 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		self->priv->res = -1;
#line 52 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_g_error_free0 (e);
#line 441 "test-shared-update.c"
	}
	__finally2:
#line 52 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	if (_inner_error_ != NULL) {
#line 52 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_g_object_unref0 (cursor);
#line 52 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.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 52 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		g_clear_error (&_inner_error_);
#line 52 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		return;
#line 454 "test-shared-update.c"
	}
#line 41 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_g_object_unref0 (cursor);
#line 458 "test-shared-update.c"
}


static void test_app_update_query_async_data_free (gpointer _data) {
	TestAppUpdateQueryAsyncData* _data_;
	_data_ = _data;
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_g_object_unref0 (_data_->self);
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	g_slice_free (TestAppUpdateQueryAsyncData, _data_);
#line 469 "test-shared-update.c"
}


static void test_app_update_query_async (TestApp* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TestAppUpdateQueryAsyncData* _data_;
	TestApp* _tmp0_;
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_data_ = g_slice_new0 (TestAppUpdateQueryAsyncData);
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, test_app_update_query_async);
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, test_app_update_query_async_data_free);
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_data_->self = _tmp0_;
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	test_app_update_query_async_co (_data_);
#line 488 "test-shared-update.c"
}


static void test_app_update_query_finish (TestApp* self, GAsyncResult* _res_) {
	TestAppUpdateQueryAsyncData* _data_;
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 496 "test-shared-update.c"
}


static void test_app_update_query_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TestAppUpdateQueryAsyncData* _data_;
#line 66 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_data_ = _user_data_;
#line 66 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_data_->_source_object_ = source_object;
#line 66 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_data_->_res_ = _res_;
#line 66 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	test_app_update_query_async_co (_data_);
#line 510 "test-shared-update.c"
}


static gboolean test_app_update_query_async_co (TestAppUpdateQueryAsyncData* _data_) {
#line 61 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	switch (_data_->_state_) {
#line 61 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		case 0:
#line 519 "test-shared-update.c"
		goto _state_0;
#line 61 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		case 1:
#line 523 "test-shared-update.c"
		goto _state_1;
		default:
#line 61 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		g_assert_not_reached ();
#line 528 "test-shared-update.c"
	}
	_state_0:
	{
#line 66 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->_tmp0_ = _data_->self->priv->con;
#line 66 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->_state_ = 1;
#line 66 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		tracker_sparql_connection_update_async (_data_->_tmp0_, "INSERT { <test02> a nie:InformationElement ; nie:title 'test01' }", G_PRIORITY_DEFAULT, NULL, test_app_update_query_async_ready, _data_);
#line 66 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		return FALSE;
#line 540 "test-shared-update.c"
		_state_1:
#line 66 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		tracker_sparql_connection_update_finish (_data_->_tmp0_, _data_->_res_, &_data_->_inner_error_);
#line 66 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		if (_data_->_inner_error_ != NULL) {
#line 546 "test-shared-update.c"
			goto __catch3_g_error;
		}
	}
	goto __finally3;
	__catch3_g_error:
	{
#line 65 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->ea = _data_->_inner_error_;
#line 65 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->_inner_error_ = NULL;
#line 68 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->_tmp1_ = _data_->ea;
#line 68 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->_tmp2_ = _data_->_tmp1_->message;
#line 68 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		g_warning ("test-shared-update.vala:68: Couldn't update: %s", _data_->_tmp2_);
#line 69 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->self->priv->res = -1;
#line 65 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_g_error_free0 (_data_->ea);
#line 567 "test-shared-update.c"
	}
	__finally3:
#line 65 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	if (_data_->_inner_error_ != NULL) {
#line 65 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_g_object_unref0 (_data_->cursor);
#line 65 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
#line 65 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		g_clear_error (&_data_->_inner_error_);
#line 65 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		return FALSE;
#line 580 "test-shared-update.c"
	}
	{
#line 73 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->_tmp3_ = _data_->self->priv->con;
#line 73 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->_tmp4_ = NULL;
#line 73 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->_tmp4_ = tracker_sparql_connection_query (_data_->_tmp3_, "SELECT ?title WHERE { <test02> nie:title ?title }", NULL, &_data_->_inner_error_);
#line 73 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->_tmp5_ = _data_->_tmp4_;
#line 73 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		if (_data_->_inner_error_ != NULL) {
#line 593 "test-shared-update.c"
			goto __catch4_g_error;
		}
#line 73 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_g_object_unref0 (_data_->cursor);
#line 73 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->cursor = _data_->_tmp5_;
#line 74 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->_tmp6_ = _data_->cursor;
#line 74 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->_tmp7_ = 0;
#line 74 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->_tmp7_ = test_app_iter_cursor (_data_->self, _data_->_tmp6_);
#line 74 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->a = _data_->_tmp7_;
#line 608 "test-shared-update.c"
	}
	goto __finally4;
	__catch4_g_error:
	{
#line 72 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->eb = _data_->_inner_error_;
#line 72 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->_inner_error_ = NULL;
#line 76 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->_tmp8_ = _data_->eb;
#line 76 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->_tmp9_ = _data_->_tmp8_->message;
#line 76 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		g_warning ("test-shared-update.vala:76: Couldn't query: %s", _data_->_tmp9_);
#line 77 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->self->priv->res = -1;
#line 72 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_g_error_free0 (_data_->eb);
#line 627 "test-shared-update.c"
	}
	__finally4:
#line 72 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	if (_data_->_inner_error_ != NULL) {
#line 72 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_g_object_unref0 (_data_->cursor);
#line 72 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
#line 72 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		g_clear_error (&_data_->_inner_error_);
#line 72 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		return FALSE;
#line 640 "test-shared-update.c"
	}
#line 61 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_g_object_unref0 (_data_->cursor);
#line 61 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	if (_data_->_state_ == 0) {
#line 61 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 648 "test-shared-update.c"
	} else {
#line 61 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 652 "test-shared-update.c"
	}
#line 61 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	g_object_unref (_data_->_async_result);
#line 61 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	return FALSE;
#line 658 "test-shared-update.c"
}


static void test_app_update_blank_query (TestApp* self) {
	GVariant* variant = NULL;
	gint a = 0;
	GError * _inner_error_ = NULL;
#line 81 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	g_return_if_fail (self != NULL);
#line 668 "test-shared-update.c"
	{
		TrackerSparqlConnection* _tmp0_;
		GVariant* _tmp1_ = NULL;
		GVariant* _tmp2_;
		GVariant* _tmp3_;
		gint _tmp4_ = 0;
#line 86 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_tmp0_ = self->priv->con;
#line 86 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_tmp1_ = tracker_sparql_connection_update_blank (_tmp0_, "INSERT { _:a1 a nie:InformationElement  . _:b1 a nie:InformationElemen" \
"t . _:c1 a nie:InformationElement }", G_PRIORITY_DEFAULT, NULL, &_inner_error_);
#line 86 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_tmp2_ = _tmp1_;
#line 86 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		if (_inner_error_ != NULL) {
#line 683 "test-shared-update.c"
			goto __catch5_g_error;
		}
#line 86 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_g_variant_unref0 (variant);
#line 86 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		variant = _tmp2_;
#line 87 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_tmp3_ = variant;
#line 87 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_tmp4_ = test_app_iter_variant (self, _tmp3_);
#line 87 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		a = _tmp4_;
#line 696 "test-shared-update.c"
	}
	goto __finally5;
	__catch5_g_error:
	{
		GError* e = NULL;
		GError* _tmp5_;
		const gchar* _tmp6_;
#line 85 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		e = _inner_error_;
#line 85 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_inner_error_ = NULL;
#line 89 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_tmp5_ = e;
#line 89 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_tmp6_ = _tmp5_->message;
#line 89 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		g_warning ("test-shared-update.vala:89: Couldn't update: %s", _tmp6_);
#line 90 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		self->priv->res = -1;
#line 85 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_g_error_free0 (e);
#line 718 "test-shared-update.c"
	}
	__finally5:
#line 85 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	if (_inner_error_ != NULL) {
#line 85 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_g_variant_unref0 (variant);
#line 85 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.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 85 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		g_clear_error (&_inner_error_);
#line 85 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		return;
#line 731 "test-shared-update.c"
	}
#line 81 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_g_variant_unref0 (variant);
#line 735 "test-shared-update.c"
}


static void test_app_update_blank_query_async_data_free (gpointer _data) {
	TestAppUpdateBlankQueryAsyncData* _data_;
	_data_ = _data;
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_g_object_unref0 (_data_->self);
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	g_slice_free (TestAppUpdateBlankQueryAsyncData, _data_);
#line 746 "test-shared-update.c"
}


static void test_app_update_blank_query_async (TestApp* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TestAppUpdateBlankQueryAsyncData* _data_;
	TestApp* _tmp0_;
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_data_ = g_slice_new0 (TestAppUpdateBlankQueryAsyncData);
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, test_app_update_blank_query_async);
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, test_app_update_blank_query_async_data_free);
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_data_->self = _tmp0_;
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	test_app_update_blank_query_async_co (_data_);
#line 765 "test-shared-update.c"
}


static void test_app_update_blank_query_finish (TestApp* self, GAsyncResult* _res_) {
	TestAppUpdateBlankQueryAsyncData* _data_;
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 773 "test-shared-update.c"
}


static void test_app_update_blank_query_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TestAppUpdateBlankQueryAsyncData* _data_;
#line 99 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_data_ = _user_data_;
#line 99 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_data_->_source_object_ = source_object;
#line 99 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_data_->_res_ = _res_;
#line 99 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	test_app_update_blank_query_async_co (_data_);
#line 787 "test-shared-update.c"
}


static gboolean test_app_update_blank_query_async_co (TestAppUpdateBlankQueryAsyncData* _data_) {
#line 94 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	switch (_data_->_state_) {
#line 94 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		case 0:
#line 796 "test-shared-update.c"
		goto _state_0;
#line 94 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		case 1:
#line 800 "test-shared-update.c"
		goto _state_1;
		default:
#line 94 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		g_assert_not_reached ();
#line 805 "test-shared-update.c"
	}
	_state_0:
	{
#line 99 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->_tmp0_ = _data_->self->priv->con;
#line 99 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->_state_ = 1;
#line 99 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		tracker_sparql_connection_update_blank_async (_data_->_tmp0_, "INSERT { _:a2 a nie:InformationElement  . _:b2 a nie:InformationElemen" \
"t . _:c2 a nie:InformationElement }", G_PRIORITY_DEFAULT, NULL, test_app_update_blank_query_async_ready, _data_);
#line 99 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		return FALSE;
#line 817 "test-shared-update.c"
		_state_1:
#line 99 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->_tmp1_ = NULL;
#line 99 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->_tmp1_ = tracker_sparql_connection_update_blank_finish (_data_->_tmp0_, _data_->_res_, &_data_->_inner_error_);
#line 99 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->_tmp2_ = _data_->_tmp1_;
#line 99 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		if (_data_->_inner_error_ != NULL) {
#line 827 "test-shared-update.c"
			goto __catch6_g_error;
		}
#line 99 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_g_variant_unref0 (_data_->variant);
#line 99 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->variant = _data_->_tmp2_;
#line 100 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->_tmp3_ = _data_->variant;
#line 100 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->_tmp4_ = 0;
#line 100 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->_tmp4_ = test_app_iter_variant (_data_->self, _data_->_tmp3_);
#line 100 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->a = _data_->_tmp4_;
#line 842 "test-shared-update.c"
	}
	goto __finally6;
	__catch6_g_error:
	{
#line 98 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->e = _data_->_inner_error_;
#line 98 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->_inner_error_ = NULL;
#line 102 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->_tmp5_ = _data_->e;
#line 102 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->_tmp6_ = _data_->_tmp5_->message;
#line 102 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		g_warning ("test-shared-update.vala:102: Couldn't update: %s", _data_->_tmp6_);
#line 103 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_data_->self->priv->res = -1;
#line 98 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_g_error_free0 (_data_->e);
#line 861 "test-shared-update.c"
	}
	__finally6:
#line 98 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	if (_data_->_inner_error_ != NULL) {
#line 98 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		_g_variant_unref0 (_data_->variant);
#line 98 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
#line 98 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		g_clear_error (&_data_->_inner_error_);
#line 98 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		return FALSE;
#line 874 "test-shared-update.c"
	}
#line 94 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_g_variant_unref0 (_data_->variant);
#line 94 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	if (_data_->_state_ == 0) {
#line 94 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 882 "test-shared-update.c"
	} else {
#line 94 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 886 "test-shared-update.c"
	}
#line 94 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	g_object_unref (_data_->_async_result);
#line 94 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	return FALSE;
#line 892 "test-shared-update.c"
}


static void test_app_do_sync_tests (TestApp* self) {
#line 107 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	g_return_if_fail (self != NULL);
#line 108 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	test_app_update_query (self);
#line 109 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	test_app_update_blank_query (self);
#line 903 "test-shared-update.c"
}


static void test_app_do_async_tests_data_free (gpointer _data) {
	TestAppDoAsyncTestsData* _data_;
	_data_ = _data;
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_g_object_unref0 (_data_->self);
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	g_slice_free (TestAppDoAsyncTestsData, _data_);
#line 914 "test-shared-update.c"
}


static void test_app_do_async_tests (TestApp* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TestAppDoAsyncTestsData* _data_;
	TestApp* _tmp0_;
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_data_ = g_slice_new0 (TestAppDoAsyncTestsData);
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, test_app_do_async_tests);
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, test_app_do_async_tests_data_free);
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_data_->self = _tmp0_;
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	test_app_do_async_tests_co (_data_);
#line 933 "test-shared-update.c"
}


static void test_app_do_async_tests_finish (TestApp* self, GAsyncResult* _res_) {
	TestAppDoAsyncTestsData* _data_;
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 941 "test-shared-update.c"
}


static void test_app_do_async_tests_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TestAppDoAsyncTestsData* _data_;
#line 113 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_data_ = _user_data_;
#line 113 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_data_->_source_object_ = source_object;
#line 113 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_data_->_res_ = _res_;
#line 113 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	test_app_do_async_tests_co (_data_);
#line 955 "test-shared-update.c"
}


static gboolean test_app_do_async_tests_co (TestAppDoAsyncTestsData* _data_) {
#line 112 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	switch (_data_->_state_) {
#line 112 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		case 0:
#line 964 "test-shared-update.c"
		goto _state_0;
#line 112 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		case 1:
#line 968 "test-shared-update.c"
		goto _state_1;
#line 112 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		case 2:
#line 972 "test-shared-update.c"
		goto _state_2;
		default:
#line 112 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		g_assert_not_reached ();
#line 977 "test-shared-update.c"
	}
	_state_0:
#line 113 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_data_->_state_ = 1;
#line 113 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	test_app_update_query_async (_data_->self, test_app_do_async_tests_ready, _data_);
#line 113 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	return FALSE;
#line 986 "test-shared-update.c"
	_state_1:
#line 113 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	test_app_update_query_finish (_data_->self, _data_->_res_);
#line 114 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_data_->_state_ = 2;
#line 114 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	test_app_update_blank_query_async (_data_->self, test_app_do_async_tests_ready, _data_);
#line 114 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	return FALSE;
#line 996 "test-shared-update.c"
	_state_2:
#line 114 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	test_app_update_blank_query_finish (_data_->self, _data_->_res_);
#line 116 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	g_print ("Async tests done, now I can quit the mainloop\n");
#line 117 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_data_->_tmp0_ = _data_->self->priv->loop;
#line 117 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	g_main_loop_quit (_data_->_tmp0_);
#line 112 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	if (_data_->_state_ == 0) {
#line 112 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1010 "test-shared-update.c"
	} else {
#line 112 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 1014 "test-shared-update.c"
	}
#line 112 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	g_object_unref (_data_->_async_result);
#line 112 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	return FALSE;
#line 1020 "test-shared-update.c"
}


static gboolean test_app_in_mainloop (TestApp* self) {
	gboolean result = FALSE;
#line 120 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 122 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	test_app_do_sync_tests (self);
#line 123 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	test_app_do_async_tests (self, NULL, NULL);
#line 125 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	result = FALSE;
#line 125 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	return result;
#line 1036 "test-shared-update.c"
}


static gboolean _test_app_in_mainloop_gsource_func (gpointer self) {
	gboolean result;
	result = test_app_in_mainloop (self);
#line 131 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	return result;
#line 1045 "test-shared-update.c"
}


gint test_app_run (TestApp* self) {
	gint result = 0;
	GMainLoop* _tmp0_;
	GMainLoop* _tmp1_;
	gint _tmp2_;
#line 128 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	g_return_val_if_fail (self != NULL, 0);
#line 129 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_tmp0_ = g_main_loop_new (NULL, FALSE);
#line 129 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_g_main_loop_unref0 (self->priv->loop);
#line 129 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	self->priv->loop = _tmp0_;
#line 131 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _test_app_in_mainloop_gsource_func, g_object_ref (self), g_object_unref);
#line 133 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_tmp1_ = self->priv->loop;
#line 133 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	g_main_loop_run (_tmp1_);
#line 135 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_tmp2_ = self->priv->res;
#line 135 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	result = _tmp2_;
#line 135 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	return result;
#line 1074 "test-shared-update.c"
}


static void test_app_class_init (TestAppClass * klass) {
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	test_app_parent_class = g_type_class_peek_parent (klass);
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	g_type_class_add_private (klass, sizeof (TestAppPrivate));
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	G_OBJECT_CLASS (klass)->finalize = test_app_finalize;
#line 1085 "test-shared-update.c"
}


static void test_app_instance_init (TestApp * self) {
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	self->priv = TEST_APP_GET_PRIVATE (self);
#line 8 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	self->priv->res = 0;
#line 1094 "test-shared-update.c"
}


static void test_app_finalize (GObject* obj) {
	TestApp * self;
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	self = TEST_APP (obj);
#line 6 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_g_main_loop_unref0 (self->priv->loop);
#line 7 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	_g_object_unref0 (self->priv->con);
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-update.vala"
	G_OBJECT_CLASS (test_app_parent_class)->finalize (obj);
#line 1108 "test-shared-update.c"
}


GType test_app_get_type (void) {
	static volatile gsize test_app_type_id__volatile = 0;
	if (g_once_init_enter (&test_app_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (TestAppClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) test_app_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TestApp), 0, (GInstanceInitFunc) test_app_instance_init, NULL };
		GType test_app_type_id;
		test_app_type_id = g_type_register_static (G_TYPE_OBJECT, "TestApp", &g_define_type_info, 0);
		g_once_init_leave (&test_app_type_id__volatile, test_app_type_id);
	}
	return test_app_type_id__volatile;
}



