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


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


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

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

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

struct _TestAppClass {
	GObjectClass parent_class;
};

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

struct _TestAppUpdateQueryAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TestApp* self;
	TrackerSparqlCursor* cursor;
	gint a;
	GError * ea;
	TrackerSparqlCursor* _tmp0_;
	TrackerSparqlCursor* _tmp1_;
	TrackerSparqlCursor* _tmp2_;
	gint _tmp3_;
	GError * eb;
	GError * _inner_error_;
};

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

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


static gpointer test_app_parent_class = NULL;

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


static gpointer _g_object_ref0 (gpointer self) {
	return self ? g_object_ref (self) : NULL;
}


TestApp* test_app_construct (GType object_type, TrackerSparqlConnection* connection) {
	TestApp * self = NULL;
	TrackerSparqlConnection* _tmp0_;
	TrackerSparqlConnection* _tmp1_;
	g_return_val_if_fail (connection != NULL, NULL);
	self = (TestApp*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (connection);
	_tmp1_ = _tmp0_;
	_g_object_unref0 (self->priv->con);
	self->priv->con = _tmp1_;
	return self;
}


TestApp* test_app_new (TrackerSparqlConnection* connection) {
	return test_app_construct (TYPE_TEST_APP, connection);
}


static gint test_app_iter_cursor (TestApp* self, TrackerSparqlCursor* cursor) {
	gint result = 0;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (self != NULL, 0);
	g_return_val_if_fail (cursor != NULL, 0);
	while (TRUE) {
		gboolean _tmp0_;
		gboolean _tmp1_;
		gint i = 0;
		_tmp0_ = tracker_sparql_cursor_next (cursor, NULL, &_inner_error_);
		_tmp1_ = _tmp0_;
		if (_inner_error_ != NULL) {
			goto __catch0_g_error;
		}
		if (!_tmp1_) {
			break;
		}
		{
			gboolean _tmp2_;
			i = 0;
			_tmp2_ = TRUE;
			while (TRUE) {
				gint _tmp3_;
				const gchar* _tmp4_ = NULL;
				const gchar* _tmp5_ = NULL;
				if (!_tmp2_) {
					i++;
				}
				_tmp2_ = FALSE;
				_tmp3_ = tracker_sparql_cursor_get_n_columns (cursor);
				if (!(i < _tmp3_)) {
					break;
				}
				if (i != 0) {
					_tmp4_ = ",";
				} else {
					_tmp4_ = "";
				}
				_tmp5_ = tracker_sparql_cursor_get_string (cursor, i, NULL);
				g_print ("%s%s", _tmp4_, _tmp5_);
			}
		}
		g_print ("\n");
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError * e;
		e = _inner_error_;
		_inner_error_ = NULL;
		g_warning ("test-shared-update.vala:26: Couldn't iterate query results: %s", e->message);
		result = -1;
		_g_error_free0 (e);
		return result;
	}
	__finally0:
	if (_inner_error_ != NULL) {
		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);
		g_clear_error (&_inner_error_);
		return 0;
	}
	result = 0;
	return result;
}


static gint test_app_iter_variant (TestApp* self, GVariant* variant) {
	gint result = 0;
	g_return_val_if_fail (self != NULL, 0);
	g_return_val_if_fail (variant != NULL, 0);
	result = 0;
	return result;
}


static void test_app_update_query (TestApp* self) {
	TrackerSparqlCursor* cursor = NULL;
	gint a = 0;
	TrackerSparqlCursor* _tmp0_ = NULL;
	TrackerSparqlCursor* _tmp1_;
	TrackerSparqlCursor* _tmp2_;
	gint _tmp3_;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	tracker_sparql_connection_update (self->priv->con, "INSERT { <test01> a nie:InformationElement ; nie:title 'test01' }", G_PRIORITY_DEFAULT, NULL, &_inner_error_);
	if (_inner_error_ != NULL) {
		goto __catch1_g_error;
	}
	goto __finally1;
	__catch1_g_error:
	{
		GError * e;
		e = _inner_error_;
		_inner_error_ = NULL;
		g_warning ("test-shared-update.vala:48: Couldn't update: %s", e->message);
		self->priv->res = -1;
		_g_error_free0 (e);
	}
	__finally1:
	if (_inner_error_ != NULL) {
		_g_object_unref0 (cursor);
		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);
		g_clear_error (&_inner_error_);
		return;
	}
	_tmp0_ = tracker_sparql_connection_query (self->priv->con, "SELECT ?title WHERE { <test01> nie:title ?title }", NULL, &_inner_error_);
	_tmp1_ = _tmp0_;
	if (_inner_error_ != NULL) {
		goto __catch2_g_error;
	}
	_tmp2_ = _tmp1_;
	_g_object_unref0 (cursor);
	cursor = _tmp2_;
	_tmp3_ = test_app_iter_cursor (self, cursor);
	a = _tmp3_;
	goto __finally2;
	__catch2_g_error:
	{
		GError * e;
		e = _inner_error_;
		_inner_error_ = NULL;
		g_warning ("test-shared-update.vala:56: Couldn't query: %s", e->message);
		self->priv->res = -1;
		_g_error_free0 (e);
	}
	__finally2:
	if (_inner_error_ != NULL) {
		_g_object_unref0 (cursor);
		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);
		g_clear_error (&_inner_error_);
		return;
	}
	_g_object_unref0 (cursor);
}


static void test_app_update_query_async_data_free (gpointer _data) {
	TestAppUpdateQueryAsyncData* data;
	data = _data;
	_g_object_unref0 (data->self);
	g_slice_free (TestAppUpdateQueryAsyncData, data);
}


static void test_app_update_query_async (TestApp* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TestAppUpdateQueryAsyncData* _data_;
	_data_ = g_slice_new0 (TestAppUpdateQueryAsyncData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, test_app_update_query_async);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, test_app_update_query_async_data_free);
	_data_->self = _g_object_ref0 (self);
	test_app_update_query_async_co (_data_);
}


static void test_app_update_query_finish (TestApp* self, GAsyncResult* _res_) {
	TestAppUpdateQueryAsyncData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void test_app_update_query_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TestAppUpdateQueryAsyncData* data;
	data = _user_data_;
	data->_source_object_ = source_object;
	data->_res_ = _res_;
	test_app_update_query_async_co (data);
}


static gboolean test_app_update_query_async_co (TestAppUpdateQueryAsyncData* data) {
	switch (data->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	data->_state_ = 1;
	tracker_sparql_connection_update_async (data->self->priv->con, "INSERT { <test02> a nie:InformationElement ; nie:title 'test01' }", G_PRIORITY_DEFAULT, NULL, test_app_update_query_async_ready, data);
	return FALSE;
	_state_1:
	tracker_sparql_connection_update_finish (data->self->priv->con, data->_res_, &data->_inner_error_);
	if (data->_inner_error_ != NULL) {
		goto __catch3_g_error;
	}
	goto __finally3;
	__catch3_g_error:
	{
		data->ea = data->_inner_error_;
		data->_inner_error_ = NULL;
		g_warning ("test-shared-update.vala:68: Couldn't update: %s", data->ea->message);
		data->self->priv->res = -1;
		_g_error_free0 (data->ea);
	}
	__finally3:
	if (data->_inner_error_ != NULL) {
		_g_object_unref0 (data->cursor);
		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);
		g_clear_error (&data->_inner_error_);
		return FALSE;
	}
	data->_tmp0_ = NULL;
	data->_tmp0_ = tracker_sparql_connection_query (data->self->priv->con, "SELECT ?title WHERE { <test02> nie:title ?title }", NULL, &data->_inner_error_);
	data->_tmp1_ = data->_tmp0_;
	if (data->_inner_error_ != NULL) {
		goto __catch4_g_error;
	}
	data->_tmp2_ = data->_tmp1_;
	_g_object_unref0 (data->cursor);
	data->cursor = data->_tmp2_;
	data->_tmp3_ = test_app_iter_cursor (data->self, data->cursor);
	data->a = data->_tmp3_;
	goto __finally4;
	__catch4_g_error:
	{
		data->eb = data->_inner_error_;
		data->_inner_error_ = NULL;
		g_warning ("test-shared-update.vala:76: Couldn't query: %s", data->eb->message);
		data->self->priv->res = -1;
		_g_error_free0 (data->eb);
	}
	__finally4:
	if (data->_inner_error_ != NULL) {
		_g_object_unref0 (data->cursor);
		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);
		g_clear_error (&data->_inner_error_);
		return FALSE;
	}
	_g_object_unref0 (data->cursor);
	if (data->_state_ == 0) {
		g_simple_async_result_complete_in_idle (data->_async_result);
	} else {
		g_simple_async_result_complete (data->_async_result);
	}
	g_object_unref (data->_async_result);
	return FALSE;
}


static void test_app_update_blank_query (TestApp* self) {
	GVariant* variant = NULL;
	gint a = 0;
	GVariant* _tmp0_ = NULL;
	GVariant* _tmp1_;
	GVariant* _tmp2_;
	gint _tmp3_;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = tracker_sparql_connection_update_blank (self->priv->con, "INSERT { _:a1 a nie:InformationElement  . _:b1 a nie:InformationElemen" \
"t . _:c1 a nie:InformationElement }", G_PRIORITY_DEFAULT, NULL, &_inner_error_);
	_tmp1_ = _tmp0_;
	if (_inner_error_ != NULL) {
		goto __catch5_g_error;
	}
	_tmp2_ = _tmp1_;
	_g_variant_unref0 (variant);
	variant = _tmp2_;
	_tmp3_ = test_app_iter_variant (self, variant);
	a = _tmp3_;
	goto __finally5;
	__catch5_g_error:
	{
		GError * e;
		e = _inner_error_;
		_inner_error_ = NULL;
		g_warning ("test-shared-update.vala:89: Couldn't update: %s", e->message);
		self->priv->res = -1;
		_g_error_free0 (e);
	}
	__finally5:
	if (_inner_error_ != NULL) {
		_g_variant_unref0 (variant);
		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);
		g_clear_error (&_inner_error_);
		return;
	}
	_g_variant_unref0 (variant);
}


static void test_app_update_blank_query_async_data_free (gpointer _data) {
	TestAppUpdateBlankQueryAsyncData* data;
	data = _data;
	_g_object_unref0 (data->self);
	g_slice_free (TestAppUpdateBlankQueryAsyncData, data);
}


static void test_app_update_blank_query_async (TestApp* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TestAppUpdateBlankQueryAsyncData* _data_;
	_data_ = g_slice_new0 (TestAppUpdateBlankQueryAsyncData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, test_app_update_blank_query_async);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, test_app_update_blank_query_async_data_free);
	_data_->self = _g_object_ref0 (self);
	test_app_update_blank_query_async_co (_data_);
}


static void test_app_update_blank_query_finish (TestApp* self, GAsyncResult* _res_) {
	TestAppUpdateBlankQueryAsyncData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void test_app_update_blank_query_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TestAppUpdateBlankQueryAsyncData* data;
	data = _user_data_;
	data->_source_object_ = source_object;
	data->_res_ = _res_;
	test_app_update_blank_query_async_co (data);
}


static gboolean test_app_update_blank_query_async_co (TestAppUpdateBlankQueryAsyncData* data) {
	switch (data->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	data->_state_ = 1;
	tracker_sparql_connection_update_blank_async (data->self->priv->con, "INSERT { _:a2 a nie:InformationElement  . _:b2 a nie:InformationElemen" \
"t . _:c2 a nie:InformationElement }", G_PRIORITY_DEFAULT, NULL, test_app_update_blank_query_async_ready, data);
	return FALSE;
	_state_1:
	data->_tmp0_ = NULL;
	data->_tmp0_ = tracker_sparql_connection_update_blank_finish (data->self->priv->con, data->_res_, &data->_inner_error_);
	data->_tmp1_ = data->_tmp0_;
	if (data->_inner_error_ != NULL) {
		goto __catch6_g_error;
	}
	data->_tmp2_ = data->_tmp1_;
	_g_variant_unref0 (data->variant);
	data->variant = data->_tmp2_;
	data->_tmp3_ = test_app_iter_variant (data->self, data->variant);
	data->a = data->_tmp3_;
	goto __finally6;
	__catch6_g_error:
	{
		data->e = data->_inner_error_;
		data->_inner_error_ = NULL;
		g_warning ("test-shared-update.vala:102: Couldn't update: %s", data->e->message);
		data->self->priv->res = -1;
		_g_error_free0 (data->e);
	}
	__finally6:
	if (data->_inner_error_ != NULL) {
		_g_variant_unref0 (data->variant);
		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);
		g_clear_error (&data->_inner_error_);
		return FALSE;
	}
	_g_variant_unref0 (data->variant);
	if (data->_state_ == 0) {
		g_simple_async_result_complete_in_idle (data->_async_result);
	} else {
		g_simple_async_result_complete (data->_async_result);
	}
	g_object_unref (data->_async_result);
	return FALSE;
}


static void test_app_do_sync_tests (TestApp* self) {
	g_return_if_fail (self != NULL);
	test_app_update_query (self);
	test_app_update_blank_query (self);
}


static void test_app_do_async_tests_data_free (gpointer _data) {
	TestAppDoAsyncTestsData* data;
	data = _data;
	_g_object_unref0 (data->self);
	g_slice_free (TestAppDoAsyncTestsData, data);
}


static void test_app_do_async_tests (TestApp* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TestAppDoAsyncTestsData* _data_;
	_data_ = g_slice_new0 (TestAppDoAsyncTestsData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, test_app_do_async_tests);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, test_app_do_async_tests_data_free);
	_data_->self = _g_object_ref0 (self);
	test_app_do_async_tests_co (_data_);
}


static void test_app_do_async_tests_finish (TestApp* self, GAsyncResult* _res_) {
	TestAppDoAsyncTestsData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void test_app_do_async_tests_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TestAppDoAsyncTestsData* data;
	data = _user_data_;
	data->_source_object_ = source_object;
	data->_res_ = _res_;
	test_app_do_async_tests_co (data);
}


static gboolean test_app_do_async_tests_co (TestAppDoAsyncTestsData* data) {
	switch (data->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	data->_state_ = 1;
	test_app_update_query_async (data->self, test_app_do_async_tests_ready, data);
	return FALSE;
	_state_1:
	test_app_update_query_finish (data->self, data->_res_);
	data->_state_ = 2;
	test_app_update_blank_query_async (data->self, test_app_do_async_tests_ready, data);
	return FALSE;
	_state_2:
	test_app_update_blank_query_finish (data->self, data->_res_);
	g_print ("Async tests done, now I can quit the mainloop\n");
	g_main_loop_quit (data->self->priv->loop);
	if (data->_state_ == 0) {
		g_simple_async_result_complete_in_idle (data->_async_result);
	} else {
		g_simple_async_result_complete (data->_async_result);
	}
	g_object_unref (data->_async_result);
	return FALSE;
}


static gboolean test_app_in_mainloop (TestApp* self) {
	gboolean result = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	test_app_do_sync_tests (self);
	test_app_do_async_tests (self, NULL, NULL);
	result = FALSE;
	return result;
}


static gboolean _test_app_in_mainloop_gsource_func (gpointer self) {
	gboolean result;
	result = test_app_in_mainloop (self);
	return result;
}


gint test_app_run (TestApp* self) {
	gint result = 0;
	GMainLoop* _tmp0_ = NULL;
	GMainLoop* _tmp1_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = g_main_loop_new (NULL, FALSE);
	_tmp1_ = _tmp0_;
	_g_main_loop_unref0 (self->priv->loop);
	self->priv->loop = _tmp1_;
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _test_app_in_mainloop_gsource_func, g_object_ref (self), g_object_unref);
	g_main_loop_run (self->priv->loop);
	result = self->priv->res;
	return result;
}


static void test_app_class_init (TestAppClass * klass) {
	test_app_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (TestAppPrivate));
	G_OBJECT_CLASS (klass)->finalize = test_app_finalize;
}


static void test_app_instance_init (TestApp * self) {
	self->priv = TEST_APP_GET_PRIVATE (self);
	self->priv->res = 0;
}


static void test_app_finalize (GObject* obj) {
	TestApp * self;
	self = TEST_APP (obj);
	_g_main_loop_unref0 (self->priv->loop);
	_g_object_unref0 (self->priv->con);
	G_OBJECT_CLASS (test_app_parent_class)->finalize (obj);
}


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;
}



