/* test-shared-query.c generated by valac 0.14.0, the Vala compiler
 * generated from test-shared-query.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_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _TestAppTestQueryAsyncData TestAppTestQueryAsyncData;
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 _TestAppTestQueryAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TestApp* self;
	TrackerSparqlCursor* cursor;
	TrackerSparqlConnection* _tmp0_;
	TrackerSparqlCursor* _tmp1_;
	TrackerSparqlCursor* _tmp2_;
	GError* e;
	GError* _tmp3_;
	const gchar* _tmp4_;
	TrackerSparqlCursor* _tmp5_;
	gint _tmp6_;
	gint _tmp7_;
	TrackerSparqlCursor* _tmp8_;
	TrackerSparqlCursor* _tmp9_;
	gint _tmp10_;
	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 gchar* test_app_type_to_string (TestApp* self, TrackerSparqlValueType type);
static gint test_app_iter_cursor (TestApp* self, TrackerSparqlCursor* cursor);
static void test_app_test_query (TestApp* self);
static void test_app_test_query_async_data_free (gpointer _data);
static void test_app_test_query_async (TestApp* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void test_app_test_query_finish (TestApp* self, GAsyncResult* _res_);
static gboolean test_app_test_query_async_co (TestAppTestQueryAsyncData* _data_);
static void test_app_test_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 10 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	return self ? g_object_ref (self) : NULL;
#line 110 "test-shared-query.c"
}


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


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


static gchar* test_app_type_to_string (TestApp* self, TrackerSparqlValueType type) {
	gchar* result = NULL;
	TrackerSparqlValueType _tmp0_;
	gchar* _tmp9_;
#line 13 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 14 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_tmp0_ = type;
#line 14 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	switch (_tmp0_) {
#line 14 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		case TRACKER_SPARQL_VALUE_TYPE_UNBOUND:
#line 155 "test-shared-query.c"
		{
			gchar* _tmp1_;
#line 16 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			_tmp1_ = g_strdup ("unbound");
#line 16 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			result = _tmp1_;
#line 16 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			return result;
#line 164 "test-shared-query.c"
		}
#line 14 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		case TRACKER_SPARQL_VALUE_TYPE_URI:
#line 168 "test-shared-query.c"
		{
			gchar* _tmp2_;
#line 18 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			_tmp2_ = g_strdup ("uri");
#line 18 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			result = _tmp2_;
#line 18 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			return result;
#line 177 "test-shared-query.c"
		}
#line 14 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		case TRACKER_SPARQL_VALUE_TYPE_STRING:
#line 181 "test-shared-query.c"
		{
			gchar* _tmp3_;
#line 20 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			_tmp3_ = g_strdup ("string");
#line 20 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			result = _tmp3_;
#line 20 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			return result;
#line 190 "test-shared-query.c"
		}
#line 14 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		case TRACKER_SPARQL_VALUE_TYPE_INTEGER:
#line 194 "test-shared-query.c"
		{
			gchar* _tmp4_;
#line 22 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			_tmp4_ = g_strdup ("integer");
#line 22 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			result = _tmp4_;
#line 22 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			return result;
#line 203 "test-shared-query.c"
		}
#line 14 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		case TRACKER_SPARQL_VALUE_TYPE_DOUBLE:
#line 207 "test-shared-query.c"
		{
			gchar* _tmp5_;
#line 24 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			_tmp5_ = g_strdup ("double");
#line 24 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			result = _tmp5_;
#line 24 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			return result;
#line 216 "test-shared-query.c"
		}
#line 14 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		case TRACKER_SPARQL_VALUE_TYPE_DATETIME:
#line 220 "test-shared-query.c"
		{
			gchar* _tmp6_;
#line 26 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			_tmp6_ = g_strdup ("datetime");
#line 26 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			result = _tmp6_;
#line 26 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			return result;
#line 229 "test-shared-query.c"
		}
#line 14 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		case TRACKER_SPARQL_VALUE_TYPE_BLANK_NODE:
#line 233 "test-shared-query.c"
		{
			gchar* _tmp7_;
#line 28 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			_tmp7_ = g_strdup ("blank-node");
#line 28 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			result = _tmp7_;
#line 28 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			return result;
#line 242 "test-shared-query.c"
		}
#line 14 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		case TRACKER_SPARQL_VALUE_TYPE_BOOLEAN:
#line 246 "test-shared-query.c"
		{
			gchar* _tmp8_;
#line 30 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			_tmp8_ = g_strdup ("boolean");
#line 30 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			result = _tmp8_;
#line 30 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			return result;
#line 255 "test-shared-query.c"
		}
		default:
		{
#line 32 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			break;
#line 261 "test-shared-query.c"
		}
	}
#line 34 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_tmp9_ = g_strdup ("unknown");
#line 34 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	result = _tmp9_;
#line 34 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	return result;
#line 270 "test-shared-query.c"
}


static gint test_app_iter_cursor (TestApp* self, TrackerSparqlCursor* cursor) {
	gint result = 0;
	gint i = 0;
	GError * _inner_error_ = NULL;
#line 37 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	g_return_val_if_fail (self != NULL, 0);
#line 37 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	g_return_val_if_fail (cursor != NULL, 0);
#line 282 "test-shared-query.c"
	{
		TrackerSparqlCursor* _tmp10_;
		gint _tmp11_;
		gint _tmp12_;
		{
			gboolean _tmp0_;
#line 41 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			i = 0;
#line 41 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			_tmp0_ = TRUE;
#line 41 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			while (TRUE) {
#line 295 "test-shared-query.c"
				gboolean _tmp1_;
				gint _tmp3_;
				TrackerSparqlCursor* _tmp4_;
				gint _tmp5_;
				gint _tmp6_;
				TrackerSparqlCursor* _tmp7_;
				gint _tmp8_;
				const gchar* _tmp9_ = NULL;
#line 41 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
				_tmp1_ = _tmp0_;
#line 41 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
				if (!_tmp1_) {
#line 308 "test-shared-query.c"
					gint _tmp2_;
#line 41 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_tmp2_ = i;
#line 41 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					i = _tmp2_ + 1;
#line 314 "test-shared-query.c"
				}
#line 41 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
				_tmp0_ = FALSE;
#line 41 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
				_tmp3_ = i;
#line 41 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
				_tmp4_ = cursor;
#line 41 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
				_tmp5_ = tracker_sparql_cursor_get_n_columns (_tmp4_);
#line 41 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
				_tmp6_ = _tmp5_;
#line 41 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
				if (!(_tmp3_ < _tmp6_)) {
#line 41 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					break;
#line 330 "test-shared-query.c"
				}
#line 42 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
				_tmp7_ = cursor;
#line 42 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
				_tmp8_ = i;
#line 42 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
				_tmp9_ = tracker_sparql_cursor_get_variable_name (_tmp7_, _tmp8_);
#line 42 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
				g_print ("| %s ", _tmp9_);
#line 340 "test-shared-query.c"
			}
		}
#line 44 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_tmp10_ = cursor;
#line 44 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_tmp11_ = tracker_sparql_cursor_get_n_columns (_tmp10_);
#line 44 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_tmp12_ = _tmp11_;
#line 44 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		g_print ("| -> %d columns\n", _tmp12_);
#line 46 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		while (TRUE) {
#line 353 "test-shared-query.c"
			TrackerSparqlCursor* _tmp13_;
			gboolean _tmp14_ = FALSE;
			gboolean _tmp15_;
#line 46 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			_tmp13_ = cursor;
#line 46 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			_tmp14_ = tracker_sparql_cursor_next (_tmp13_, NULL, &_inner_error_);
#line 46 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			_tmp15_ = _tmp14_;
#line 46 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			if (_inner_error_ != NULL) {
#line 365 "test-shared-query.c"
				goto __catch0_g_error;
			}
#line 46 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			if (!_tmp15_) {
#line 46 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
				break;
#line 372 "test-shared-query.c"
			}
			{
				gboolean _tmp16_;
#line 47 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
				i = 0;
#line 47 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
				_tmp16_ = TRUE;
#line 47 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
				while (TRUE) {
#line 382 "test-shared-query.c"
					gboolean _tmp17_;
					gint _tmp19_;
					TrackerSparqlCursor* _tmp20_;
					gint _tmp21_;
					gint _tmp22_;
					const gchar* _tmp23_ = NULL;
					gint _tmp24_;
					const gchar* _tmp25_;
					TrackerSparqlCursor* _tmp26_;
					gint _tmp27_;
					const gchar* _tmp28_ = NULL;
					TrackerSparqlCursor* _tmp29_;
					gint _tmp30_;
					TrackerSparqlValueType _tmp31_ = 0;
					gchar* _tmp32_ = NULL;
					gchar* _tmp33_;
#line 47 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_tmp17_ = _tmp16_;
#line 47 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					if (!_tmp17_) {
#line 403 "test-shared-query.c"
						gint _tmp18_;
#line 47 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
						_tmp18_ = i;
#line 47 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
						i = _tmp18_ + 1;
#line 409 "test-shared-query.c"
					}
#line 47 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_tmp16_ = FALSE;
#line 47 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_tmp19_ = i;
#line 47 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_tmp20_ = cursor;
#line 47 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_tmp21_ = tracker_sparql_cursor_get_n_columns (_tmp20_);
#line 47 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_tmp22_ = _tmp21_;
#line 47 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					if (!(_tmp19_ < _tmp22_)) {
#line 47 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
						break;
#line 425 "test-shared-query.c"
					}
#line 48 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_tmp24_ = i;
#line 48 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					if (_tmp24_ != 0) {
#line 48 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
						_tmp23_ = ",";
#line 433 "test-shared-query.c"
					} else {
#line 48 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
						_tmp23_ = "";
#line 437 "test-shared-query.c"
					}
#line 48 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_tmp25_ = _tmp23_;
#line 48 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_tmp26_ = cursor;
#line 48 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_tmp27_ = i;
#line 48 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_tmp28_ = tracker_sparql_cursor_get_string (_tmp26_, _tmp27_, NULL);
#line 48 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_tmp29_ = cursor;
#line 48 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_tmp30_ = i;
#line 48 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_tmp31_ = tracker_sparql_cursor_get_value_type (_tmp29_, _tmp30_);
#line 48 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_tmp32_ = test_app_type_to_string (self, _tmp31_);
#line 48 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_tmp33_ = _tmp32_;
#line 48 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					g_print ("%s%s a %s", _tmp25_, _tmp28_, _tmp33_);
#line 48 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_g_free0 (_tmp33_);
#line 461 "test-shared-query.c"
				}
			}
#line 53 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			g_print ("\n");
#line 466 "test-shared-query.c"
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp34_;
		const gchar* _tmp35_;
#line 40 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		e = _inner_error_;
#line 40 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_inner_error_ = NULL;
#line 56 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_tmp34_ = e;
#line 56 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_tmp35_ = _tmp34_->message;
#line 56 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		g_warning ("test-shared-query.vala:56: Couldn't iterate query results: %s", _tmp35_);
#line 57 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		result = -1;
#line 57 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_g_error_free0 (e);
#line 57 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		return result;
#line 491 "test-shared-query.c"
	}
	__finally0:
#line 40 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	if (_inner_error_ != NULL) {
#line 40 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.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 40 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		g_clear_error (&_inner_error_);
#line 40 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		return 0;
#line 502 "test-shared-query.c"
	}
#line 60 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	result = 0;
#line 60 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	return result;
#line 508 "test-shared-query.c"
}


static void test_app_test_query (TestApp* self) {
	TrackerSparqlCursor* cursor = NULL;
	TrackerSparqlCursor* _tmp5_;
	gint _tmp6_ = 0;
	gint _tmp7_;
	TrackerSparqlCursor* _tmp8_;
	TrackerSparqlCursor* _tmp9_;
	gint _tmp10_ = 0;
	GError * _inner_error_ = NULL;
#line 63 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	g_return_if_fail (self != NULL);
#line 66 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	g_print ("Sync test\n");
#line 525 "test-shared-query.c"
	{
		TrackerSparqlConnection* _tmp0_;
		TrackerSparqlCursor* _tmp1_ = NULL;
		TrackerSparqlCursor* _tmp2_;
#line 68 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_tmp0_ = self->priv->con;
#line 68 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_tmp1_ = tracker_sparql_connection_query (_tmp0_, "SELECT ?u WHERE { ?u a rdfs:Class }", NULL, &_inner_error_);
#line 68 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_tmp2_ = _tmp1_;
#line 68 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		if (_inner_error_ != NULL) {
#line 538 "test-shared-query.c"
			goto __catch1_g_error;
		}
#line 68 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_g_object_unref0 (cursor);
#line 68 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		cursor = _tmp2_;
#line 545 "test-shared-query.c"
	}
	goto __finally1;
	__catch1_g_error:
	{
		GError* e = NULL;
		GError* _tmp3_;
		const gchar* _tmp4_;
#line 67 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		e = _inner_error_;
#line 67 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_inner_error_ = NULL;
#line 70 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_tmp3_ = e;
#line 70 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_tmp4_ = _tmp3_->message;
#line 70 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		g_warning ("test-shared-query.vala:70: Couldn't perform query: %s", _tmp4_);
#line 71 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		self->priv->res = -1;
#line 72 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_g_error_free0 (e);
#line 72 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_g_object_unref0 (cursor);
#line 72 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		return;
#line 571 "test-shared-query.c"
	}
	__finally1:
#line 67 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	if (_inner_error_ != NULL) {
#line 67 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_g_object_unref0 (cursor);
#line 67 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.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 67 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		g_clear_error (&_inner_error_);
#line 67 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		return;
#line 584 "test-shared-query.c"
	}
#line 75 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_tmp5_ = cursor;
#line 75 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_tmp6_ = test_app_iter_cursor (self, _tmp5_);
#line 75 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	self->priv->res = _tmp6_;
#line 77 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_tmp7_ = self->priv->res;
#line 77 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	if (_tmp7_ == (-1)) {
#line 78 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_g_object_unref0 (cursor);
#line 78 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		return;
#line 600 "test-shared-query.c"
	}
#line 80 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	g_print ("\nRewinding\n");
#line 81 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_tmp8_ = cursor;
#line 81 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	tracker_sparql_cursor_rewind (_tmp8_);
#line 83 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	g_print ("\nSecond run\n");
#line 84 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_tmp9_ = cursor;
#line 84 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_tmp10_ = test_app_iter_cursor (self, _tmp9_);
#line 84 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	self->priv->res = _tmp10_;
#line 63 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_g_object_unref0 (cursor);
#line 618 "test-shared-query.c"
}


static void test_app_test_query_async_data_free (gpointer _data) {
	TestAppTestQueryAsyncData* _data_;
	_data_ = _data;
#line 4 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_g_object_unref0 (_data_->self);
#line 4 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	g_slice_free (TestAppTestQueryAsyncData, _data_);
#line 629 "test-shared-query.c"
}


static void test_app_test_query_async (TestApp* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TestAppTestQueryAsyncData* _data_;
	TestApp* _tmp0_;
#line 4 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_ = g_slice_new0 (TestAppTestQueryAsyncData);
#line 4 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, test_app_test_query_async);
#line 4 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, test_app_test_query_async_data_free);
#line 4 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 4 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->self = _tmp0_;
#line 4 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	test_app_test_query_async_co (_data_);
#line 648 "test-shared-query.c"
}


static void test_app_test_query_finish (TestApp* self, GAsyncResult* _res_) {
	TestAppTestQueryAsyncData* _data_;
#line 4 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 656 "test-shared-query.c"
}


static void test_app_test_query_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TestAppTestQueryAsyncData* _data_;
#line 92 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_ = _user_data_;
#line 92 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->_source_object_ = source_object;
#line 92 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->_res_ = _res_;
#line 92 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	test_app_test_query_async_co (_data_);
#line 670 "test-shared-query.c"
}


static gboolean test_app_test_query_async_co (TestAppTestQueryAsyncData* _data_) {
#line 87 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	switch (_data_->_state_) {
#line 87 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		case 0:
#line 679 "test-shared-query.c"
		goto _state_0;
#line 87 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		case 1:
#line 683 "test-shared-query.c"
		goto _state_1;
		default:
#line 87 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		g_assert_not_reached ();
#line 688 "test-shared-query.c"
	}
	_state_0:
#line 90 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	g_print ("Async test\n");
#line 693 "test-shared-query.c"
	{
#line 92 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_data_->_tmp0_ = _data_->self->priv->con;
#line 92 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_data_->_state_ = 1;
#line 92 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		tracker_sparql_connection_query_async (_data_->_tmp0_, "SELECT ?u WHERE { ?u a rdfs:Class }", NULL, test_app_test_query_async_ready, _data_);
#line 92 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		return FALSE;
#line 703 "test-shared-query.c"
		_state_1:
#line 92 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_data_->_tmp1_ = NULL;
#line 92 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_data_->_tmp1_ = tracker_sparql_connection_query_finish (_data_->_tmp0_, _data_->_res_, &_data_->_inner_error_);
#line 92 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_data_->_tmp2_ = _data_->_tmp1_;
#line 92 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		if (_data_->_inner_error_ != NULL) {
#line 713 "test-shared-query.c"
			goto __catch2_g_error;
		}
#line 92 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_g_object_unref0 (_data_->cursor);
#line 92 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_data_->cursor = _data_->_tmp2_;
#line 720 "test-shared-query.c"
	}
	goto __finally2;
	__catch2_g_error:
	{
#line 91 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_data_->e = _data_->_inner_error_;
#line 91 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_data_->_inner_error_ = NULL;
#line 94 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_data_->_tmp3_ = _data_->e;
#line 94 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_data_->_tmp4_ = _data_->_tmp3_->message;
#line 94 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		g_warning ("test-shared-query.vala:94: Couldn't perform query: %s", _data_->_tmp4_);
#line 95 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_data_->self->priv->res = -1;
#line 96 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_g_error_free0 (_data_->e);
#line 96 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_g_object_unref0 (_data_->cursor);
#line 96 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		if (_data_->_state_ == 0) {
#line 96 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 745 "test-shared-query.c"
		} else {
#line 96 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 749 "test-shared-query.c"
		}
#line 96 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		g_object_unref (_data_->_async_result);
#line 96 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		return FALSE;
#line 755 "test-shared-query.c"
	}
	__finally2:
#line 91 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	if (_data_->_inner_error_ != NULL) {
#line 91 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_g_object_unref0 (_data_->cursor);
#line 91 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.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 91 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		g_clear_error (&_data_->_inner_error_);
#line 91 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		return FALSE;
#line 768 "test-shared-query.c"
	}
#line 99 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->_tmp5_ = _data_->cursor;
#line 99 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->_tmp6_ = 0;
#line 99 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->_tmp6_ = test_app_iter_cursor (_data_->self, _data_->_tmp5_);
#line 99 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->self->priv->res = _data_->_tmp6_;
#line 101 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->_tmp7_ = _data_->self->priv->res;
#line 101 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	if (_data_->_tmp7_ == (-1)) {
#line 102 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_g_object_unref0 (_data_->cursor);
#line 102 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		if (_data_->_state_ == 0) {
#line 102 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 788 "test-shared-query.c"
		} else {
#line 102 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 792 "test-shared-query.c"
		}
#line 102 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		g_object_unref (_data_->_async_result);
#line 102 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		return FALSE;
#line 798 "test-shared-query.c"
	}
#line 104 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	g_print ("\nRewinding\n");
#line 105 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->_tmp8_ = _data_->cursor;
#line 105 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	tracker_sparql_cursor_rewind (_data_->_tmp8_);
#line 107 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	g_print ("\nSecond run\n");
#line 108 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->_tmp9_ = _data_->cursor;
#line 108 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->_tmp10_ = 0;
#line 108 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->_tmp10_ = test_app_iter_cursor (_data_->self, _data_->_tmp9_);
#line 108 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->self->priv->res = _data_->_tmp10_;
#line 87 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_g_object_unref0 (_data_->cursor);
#line 87 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	if (_data_->_state_ == 0) {
#line 87 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 822 "test-shared-query.c"
	} else {
#line 87 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 826 "test-shared-query.c"
	}
#line 87 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	g_object_unref (_data_->_async_result);
#line 87 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	return FALSE;
#line 832 "test-shared-query.c"
}


static void test_app_do_sync_tests (TestApp* self) {
#line 111 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	g_return_if_fail (self != NULL);
#line 112 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	test_app_test_query (self);
#line 841 "test-shared-query.c"
}


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


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


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


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


static gboolean test_app_do_async_tests_co (TestAppDoAsyncTestsData* _data_) {
#line 115 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	switch (_data_->_state_) {
#line 115 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		case 0:
#line 902 "test-shared-query.c"
		goto _state_0;
#line 115 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		case 1:
#line 906 "test-shared-query.c"
		goto _state_1;
		default:
#line 115 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		g_assert_not_reached ();
#line 911 "test-shared-query.c"
	}
	_state_0:
#line 116 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->_state_ = 1;
#line 116 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	test_app_test_query_async (_data_->self, test_app_do_async_tests_ready, _data_);
#line 116 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	return FALSE;
#line 920 "test-shared-query.c"
	_state_1:
#line 116 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	test_app_test_query_finish (_data_->self, _data_->_res_);
#line 118 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	g_print ("Async tests done, now I can quit the mainloop\n");
#line 119 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->_tmp0_ = _data_->self->priv->loop;
#line 119 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	g_main_loop_quit (_data_->_tmp0_);
#line 115 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	if (_data_->_state_ == 0) {
#line 115 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 934 "test-shared-query.c"
	} else {
#line 115 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 938 "test-shared-query.c"
	}
#line 115 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	g_object_unref (_data_->_async_result);
#line 115 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	return FALSE;
#line 944 "test-shared-query.c"
}


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


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


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


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


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


static void test_app_finalize (GObject* obj) {
	TestApp * self;
#line 4 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	self = TEST_APP (obj);
#line 5 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_g_main_loop_unref0 (self->priv->loop);
#line 6 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_g_object_unref0 (self->priv->con);
#line 4 "/home/martyn/Source/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	G_OBJECT_CLASS (test_app_parent_class)->finalize (obj);
#line 1032 "test-shared-query.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;
}



