/* test-shared-query.c generated by valac 0.28.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;
	TrackerSparqlCursor* _tmp0_;
	TrackerSparqlConnection* _tmp1_;
	TrackerSparqlCursor* _tmp2_;
	TrackerSparqlCursor* _tmp3_;
	GError* e;
	GError* _tmp4_;
	const gchar* _tmp5_;
	TrackerSparqlCursor* _tmp6_;
	gint _tmp7_;
	gint _tmp8_;
	TrackerSparqlCursor* _tmp9_;
	TrackerSparqlCursor* _tmp10_;
	gint _tmp11_;
	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/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	return self ? g_object_ref (self) : NULL;
#line 111 "test-shared-query.c"
}


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


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


static gchar* test_app_type_to_string (TestApp* self, TrackerSparqlValueType type) {
	gchar* result = NULL;
	TrackerSparqlValueType _tmp0_ = 0;
	gchar* _tmp9_ = NULL;
#line 13 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 14 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_tmp0_ = type;
#line 14 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	switch (_tmp0_) {
#line 14 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		case TRACKER_SPARQL_VALUE_TYPE_UNBOUND:
#line 156 "test-shared-query.c"
		{
			gchar* _tmp1_ = NULL;
#line 16 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			_tmp1_ = g_strdup ("unbound");
#line 16 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			result = _tmp1_;
#line 16 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			return result;
#line 165 "test-shared-query.c"
		}
#line 14 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		case TRACKER_SPARQL_VALUE_TYPE_URI:
#line 169 "test-shared-query.c"
		{
			gchar* _tmp2_ = NULL;
#line 18 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			_tmp2_ = g_strdup ("uri");
#line 18 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			result = _tmp2_;
#line 18 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			return result;
#line 178 "test-shared-query.c"
		}
#line 14 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		case TRACKER_SPARQL_VALUE_TYPE_STRING:
#line 182 "test-shared-query.c"
		{
			gchar* _tmp3_ = NULL;
#line 20 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			_tmp3_ = g_strdup ("string");
#line 20 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			result = _tmp3_;
#line 20 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			return result;
#line 191 "test-shared-query.c"
		}
#line 14 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		case TRACKER_SPARQL_VALUE_TYPE_INTEGER:
#line 195 "test-shared-query.c"
		{
			gchar* _tmp4_ = NULL;
#line 22 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			_tmp4_ = g_strdup ("integer");
#line 22 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			result = _tmp4_;
#line 22 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			return result;
#line 204 "test-shared-query.c"
		}
#line 14 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		case TRACKER_SPARQL_VALUE_TYPE_DOUBLE:
#line 208 "test-shared-query.c"
		{
			gchar* _tmp5_ = NULL;
#line 24 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			_tmp5_ = g_strdup ("double");
#line 24 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			result = _tmp5_;
#line 24 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			return result;
#line 217 "test-shared-query.c"
		}
#line 14 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		case TRACKER_SPARQL_VALUE_TYPE_DATETIME:
#line 221 "test-shared-query.c"
		{
			gchar* _tmp6_ = NULL;
#line 26 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			_tmp6_ = g_strdup ("datetime");
#line 26 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			result = _tmp6_;
#line 26 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			return result;
#line 230 "test-shared-query.c"
		}
#line 14 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		case TRACKER_SPARQL_VALUE_TYPE_BLANK_NODE:
#line 234 "test-shared-query.c"
		{
			gchar* _tmp7_ = NULL;
#line 28 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			_tmp7_ = g_strdup ("blank-node");
#line 28 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			result = _tmp7_;
#line 28 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			return result;
#line 243 "test-shared-query.c"
		}
#line 14 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		case TRACKER_SPARQL_VALUE_TYPE_BOOLEAN:
#line 247 "test-shared-query.c"
		{
			gchar* _tmp8_ = NULL;
#line 30 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			_tmp8_ = g_strdup ("boolean");
#line 30 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			result = _tmp8_;
#line 30 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			return result;
#line 256 "test-shared-query.c"
		}
		default:
		{
#line 32 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			break;
#line 262 "test-shared-query.c"
		}
	}
#line 34 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_tmp9_ = g_strdup ("unknown");
#line 34 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	result = _tmp9_;
#line 34 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	return result;
#line 271 "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/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	g_return_val_if_fail (self != NULL, 0);
#line 37 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	g_return_val_if_fail (cursor != NULL, 0);
#line 283 "test-shared-query.c"
	{
		TrackerSparqlCursor* _tmp9_ = NULL;
		gint _tmp10_ = 0;
		gint _tmp11_ = 0;
		{
			gboolean _tmp0_ = FALSE;
#line 41 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			i = 0;
#line 41 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			_tmp0_ = TRUE;
#line 41 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			while (TRUE) {
#line 296 "test-shared-query.c"
				gint _tmp2_ = 0;
				TrackerSparqlCursor* _tmp3_ = NULL;
				gint _tmp4_ = 0;
				gint _tmp5_ = 0;
				TrackerSparqlCursor* _tmp6_ = NULL;
				gint _tmp7_ = 0;
				const gchar* _tmp8_ = NULL;
#line 41 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
				if (!_tmp0_) {
#line 306 "test-shared-query.c"
					gint _tmp1_ = 0;
#line 41 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_tmp1_ = i;
#line 41 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					i = _tmp1_ + 1;
#line 312 "test-shared-query.c"
				}
#line 41 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
				_tmp0_ = FALSE;
#line 41 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
				_tmp2_ = i;
#line 41 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
				_tmp3_ = cursor;
#line 41 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
				_tmp4_ = tracker_sparql_cursor_get_n_columns (_tmp3_);
#line 41 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
				_tmp5_ = _tmp4_;
#line 41 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
				if (!(_tmp2_ < _tmp5_)) {
#line 41 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					break;
#line 328 "test-shared-query.c"
				}
#line 42 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
				_tmp6_ = cursor;
#line 42 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
				_tmp7_ = i;
#line 42 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
				_tmp8_ = tracker_sparql_cursor_get_variable_name (_tmp6_, _tmp7_);
#line 42 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
				g_print ("| %s ", _tmp8_);
#line 338 "test-shared-query.c"
			}
		}
#line 44 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_tmp9_ = cursor;
#line 44 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_tmp10_ = tracker_sparql_cursor_get_n_columns (_tmp9_);
#line 44 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_tmp11_ = _tmp10_;
#line 44 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		g_print ("| -> %d columns\n", _tmp11_);
#line 46 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		while (TRUE) {
#line 351 "test-shared-query.c"
			gboolean _tmp12_ = FALSE;
			TrackerSparqlCursor* _tmp13_ = NULL;
			gboolean _tmp14_ = FALSE;
#line 46 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			_tmp13_ = cursor;
#line 46 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			_tmp14_ = tracker_sparql_cursor_next (_tmp13_, NULL, &_inner_error_);
#line 46 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			_tmp12_ = _tmp14_;
#line 46 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 363 "test-shared-query.c"
				goto __catch0_g_error;
			}
#line 46 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			if (!_tmp12_) {
#line 46 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
				break;
#line 370 "test-shared-query.c"
			}
			{
				gboolean _tmp15_ = FALSE;
#line 47 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
				i = 0;
#line 47 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
				_tmp15_ = TRUE;
#line 47 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
				while (TRUE) {
#line 380 "test-shared-query.c"
					gint _tmp17_ = 0;
					TrackerSparqlCursor* _tmp18_ = NULL;
					gint _tmp19_ = 0;
					gint _tmp20_ = 0;
					const gchar* _tmp21_ = NULL;
					gint _tmp22_ = 0;
					TrackerSparqlCursor* _tmp23_ = NULL;
					gint _tmp24_ = 0;
					const gchar* _tmp25_ = NULL;
					TrackerSparqlCursor* _tmp26_ = NULL;
					gint _tmp27_ = 0;
					TrackerSparqlValueType _tmp28_ = 0;
					gchar* _tmp29_ = NULL;
					gchar* _tmp30_ = NULL;
#line 47 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					if (!_tmp15_) {
#line 397 "test-shared-query.c"
						gint _tmp16_ = 0;
#line 47 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
						_tmp16_ = i;
#line 47 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
						i = _tmp16_ + 1;
#line 403 "test-shared-query.c"
					}
#line 47 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_tmp15_ = FALSE;
#line 47 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_tmp17_ = i;
#line 47 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_tmp18_ = cursor;
#line 47 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_tmp19_ = tracker_sparql_cursor_get_n_columns (_tmp18_);
#line 47 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_tmp20_ = _tmp19_;
#line 47 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					if (!(_tmp17_ < _tmp20_)) {
#line 47 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
						break;
#line 419 "test-shared-query.c"
					}
#line 48 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_tmp22_ = i;
#line 48 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					if (_tmp22_ != 0) {
#line 48 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
						_tmp21_ = ",";
#line 427 "test-shared-query.c"
					} else {
#line 48 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
						_tmp21_ = "";
#line 431 "test-shared-query.c"
					}
#line 48 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_tmp23_ = cursor;
#line 48 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_tmp24_ = i;
#line 48 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_tmp25_ = tracker_sparql_cursor_get_string (_tmp23_, _tmp24_, NULL);
#line 48 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_tmp26_ = cursor;
#line 48 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_tmp27_ = i;
#line 48 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_tmp28_ = tracker_sparql_cursor_get_value_type (_tmp26_, _tmp27_);
#line 48 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_tmp29_ = test_app_type_to_string (self, _tmp28_);
#line 48 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_tmp30_ = _tmp29_;
#line 48 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					g_print ("%s%s a %s", _tmp21_, _tmp25_, _tmp30_);
#line 48 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
					_g_free0 (_tmp30_);
#line 453 "test-shared-query.c"
				}
			}
#line 53 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			g_print ("\n");
#line 458 "test-shared-query.c"
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp31_ = NULL;
		const gchar* _tmp32_ = NULL;
#line 40 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		e = _inner_error_;
#line 40 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_inner_error_ = NULL;
#line 56 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_tmp31_ = e;
#line 56 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_tmp32_ = _tmp31_->message;
#line 56 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		g_warning ("test-shared-query.vala:56: Couldn't iterate query results: %s", _tmp32_);
#line 57 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		result = -1;
#line 57 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_g_error_free0 (e);
#line 57 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		return result;
#line 483 "test-shared-query.c"
	}
	__finally0:
#line 40 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 40 "/home/carlos/Source/gnome/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/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		g_clear_error (&_inner_error_);
#line 40 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		return 0;
#line 494 "test-shared-query.c"
	}
#line 60 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	result = 0;
#line 60 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	return result;
#line 500 "test-shared-query.c"
}


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


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


static void test_app_test_query_async (TestApp* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TestAppTestQueryAsyncData* _data_;
	TestApp* _tmp0_ = NULL;
#line 4 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_ = g_slice_new0 (TestAppTestQueryAsyncData);
#line 4 "/home/carlos/Source/gnome/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/carlos/Source/gnome/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/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 4 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->self = _tmp0_;
#line 4 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	test_app_test_query_async_co (_data_);
#line 647 "test-shared-query.c"
}


static void test_app_test_query_finish (TestApp* self, GAsyncResult* _res_) {
	TestAppTestQueryAsyncData* _data_;
#line 4 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 655 "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/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_ = _user_data_;
#line 92 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->_source_object_ = source_object;
#line 92 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->_res_ = _res_;
#line 92 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	test_app_test_query_async_co (_data_);
#line 669 "test-shared-query.c"
}


static gboolean test_app_test_query_async_co (TestAppTestQueryAsyncData* _data_) {
#line 87 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	switch (_data_->_state_) {
#line 87 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		case 0:
#line 678 "test-shared-query.c"
		goto _state_0;
#line 87 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		case 1:
#line 682 "test-shared-query.c"
		goto _state_1;
		default:
#line 87 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		g_assert_not_reached ();
#line 687 "test-shared-query.c"
	}
	_state_0:
#line 90 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	g_print ("Async test\n");
#line 692 "test-shared-query.c"
	{
#line 92 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_data_->_tmp1_ = NULL;
#line 92 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_data_->_tmp1_ = _data_->self->priv->con;
#line 92 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_data_->_state_ = 1;
#line 92 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		tracker_sparql_connection_query_async (_data_->_tmp1_, "SELECT ?u WHERE { ?u a rdfs:Class }", NULL, test_app_test_query_async_ready, _data_);
#line 92 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		return FALSE;
#line 704 "test-shared-query.c"
		_state_1:
#line 92 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_data_->_tmp2_ = NULL;
#line 92 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_data_->_tmp2_ = tracker_sparql_connection_query_finish (_data_->_tmp1_, _data_->_res_, &_data_->_inner_error_);
#line 92 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_data_->_tmp0_ = _data_->_tmp2_;
#line 92 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 714 "test-shared-query.c"
			goto __catch2_g_error;
		}
#line 92 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_data_->_tmp3_ = NULL;
#line 92 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_data_->_tmp3_ = _data_->_tmp0_;
#line 92 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_data_->_tmp0_ = NULL;
#line 92 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_g_object_unref0 (_data_->cursor);
#line 92 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_data_->cursor = _data_->_tmp3_;
#line 91 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_g_object_unref0 (_data_->_tmp0_);
#line 729 "test-shared-query.c"
	}
	goto __finally2;
	__catch2_g_error:
	{
#line 91 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_data_->e = _data_->_inner_error_;
#line 91 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_data_->_inner_error_ = NULL;
#line 94 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_data_->_tmp4_ = NULL;
#line 94 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_data_->_tmp4_ = _data_->e;
#line 94 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_data_->_tmp5_ = NULL;
#line 94 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_data_->_tmp5_ = _data_->_tmp4_->message;
#line 94 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		g_warning ("test-shared-query.vala:94: Couldn't perform query: %s", _data_->_tmp5_);
#line 95 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_data_->self->priv->res = -1;
#line 96 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_g_error_free0 (_data_->e);
#line 96 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_g_object_unref0 (_data_->cursor);
#line 96 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		if (_data_->_state_ == 0) {
#line 96 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 758 "test-shared-query.c"
		} else {
#line 96 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 762 "test-shared-query.c"
		}
#line 96 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		g_object_unref (_data_->_async_result);
#line 96 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		return FALSE;
#line 768 "test-shared-query.c"
	}
	__finally2:
#line 91 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 91 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_g_object_unref0 (_data_->cursor);
#line 91 "/home/carlos/Source/gnome/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/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		g_clear_error (&_data_->_inner_error_);
#line 91 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		return FALSE;
#line 781 "test-shared-query.c"
	}
#line 99 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->_tmp6_ = NULL;
#line 99 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->_tmp6_ = _data_->cursor;
#line 99 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->_tmp7_ = 0;
#line 99 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->_tmp7_ = test_app_iter_cursor (_data_->self, _data_->_tmp6_);
#line 99 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->self->priv->res = _data_->_tmp7_;
#line 101 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->_tmp8_ = 0;
#line 101 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->_tmp8_ = _data_->self->priv->res;
#line 101 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	if (_data_->_tmp8_ == (-1)) {
#line 102 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		_g_object_unref0 (_data_->cursor);
#line 102 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		if (_data_->_state_ == 0) {
#line 102 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 805 "test-shared-query.c"
		} else {
#line 102 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 809 "test-shared-query.c"
		}
#line 102 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		g_object_unref (_data_->_async_result);
#line 102 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		return FALSE;
#line 815 "test-shared-query.c"
	}
#line 104 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	g_print ("\nRewinding\n");
#line 105 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->_tmp9_ = NULL;
#line 105 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->_tmp9_ = _data_->cursor;
#line 105 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	tracker_sparql_cursor_rewind (_data_->_tmp9_);
#line 107 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	g_print ("\nSecond run\n");
#line 108 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->_tmp10_ = NULL;
#line 108 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->_tmp10_ = _data_->cursor;
#line 108 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->_tmp11_ = 0;
#line 108 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->_tmp11_ = test_app_iter_cursor (_data_->self, _data_->_tmp10_);
#line 108 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->self->priv->res = _data_->_tmp11_;
#line 87 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_g_object_unref0 (_data_->cursor);
#line 87 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	if (_data_->_state_ == 0) {
#line 87 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 843 "test-shared-query.c"
	} else {
#line 87 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 847 "test-shared-query.c"
	}
#line 87 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	g_object_unref (_data_->_async_result);
#line 87 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	return FALSE;
#line 853 "test-shared-query.c"
}


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


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


static void test_app_do_async_tests (TestApp* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TestAppDoAsyncTestsData* _data_;
	TestApp* _tmp0_ = NULL;
#line 4 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_ = g_slice_new0 (TestAppDoAsyncTestsData);
#line 4 "/home/carlos/Source/gnome/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/carlos/Source/gnome/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/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 4 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->self = _tmp0_;
#line 4 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	test_app_do_async_tests_co (_data_);
#line 892 "test-shared-query.c"
}


static void test_app_do_async_tests_finish (TestApp* self, GAsyncResult* _res_) {
	TestAppDoAsyncTestsData* _data_;
#line 4 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 900 "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/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_ = _user_data_;
#line 116 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->_source_object_ = source_object;
#line 116 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->_res_ = _res_;
#line 116 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	test_app_do_async_tests_co (_data_);
#line 914 "test-shared-query.c"
}


static gboolean test_app_do_async_tests_co (TestAppDoAsyncTestsData* _data_) {
#line 115 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	switch (_data_->_state_) {
#line 115 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		case 0:
#line 923 "test-shared-query.c"
		goto _state_0;
#line 115 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		case 1:
#line 927 "test-shared-query.c"
		goto _state_1;
		default:
#line 115 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		g_assert_not_reached ();
#line 932 "test-shared-query.c"
	}
	_state_0:
#line 116 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->_state_ = 1;
#line 116 "/home/carlos/Source/gnome/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/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	return FALSE;
#line 941 "test-shared-query.c"
	_state_1:
#line 116 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	test_app_test_query_finish (_data_->self, _data_->_res_);
#line 118 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	g_print ("Async tests done, now I can quit the mainloop\n");
#line 119 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->_tmp0_ = NULL;
#line 119 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_data_->_tmp0_ = _data_->self->priv->loop;
#line 119 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	g_main_loop_quit (_data_->_tmp0_);
#line 115 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	if (_data_->_state_ == 0) {
#line 115 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 957 "test-shared-query.c"
	} else {
#line 115 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 961 "test-shared-query.c"
	}
#line 115 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	g_object_unref (_data_->_async_result);
#line 115 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	return FALSE;
#line 967 "test-shared-query.c"
}


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


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


gint test_app_run (TestApp* self) {
	gint result = 0;
	GMainLoop* _tmp0_ = NULL;
	GMainLoop* _tmp1_ = NULL;
	gint _tmp2_ = 0;
#line 130 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	g_return_val_if_fail (self != NULL, 0);
#line 131 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_tmp0_ = g_main_loop_new (NULL, FALSE);
#line 131 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_g_main_loop_unref0 (self->priv->loop);
#line 131 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	self->priv->loop = _tmp0_;
#line 133 "/home/carlos/Source/gnome/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/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_tmp1_ = self->priv->loop;
#line 135 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	g_main_loop_run (_tmp1_);
#line 137 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	_tmp2_ = self->priv->res;
#line 137 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	result = _tmp2_;
#line 137 "/home/carlos/Source/gnome/tracker/tests/functional-tests/ipc/test-shared-query.vala"
	return result;
#line 1021 "test-shared-query.c"
}


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


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


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



