/* dummy-lsw.c generated by valac 0.12.0, the Vala compiler
 * generated from dummy-lsw.vala, do not modify */

/*
 * Copyright (C) 2011 Collabora Ltd.
 *
 * This library is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 2.1 of the License, or
 * (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Authors: Alban Crequy <alban.crequy@collabora.co.uk>
 *
 */

#include <glib.h>
#include <glib-object.h>
#include <folks-test.h>
#include <libsocialweb-test.h>
#include <stdlib.h>
#include <string.h>
#include <folks/folks.h>
#include <gio/gio.h>
#include <gee.h>


#define TYPE_DUMMY_LSW_TESTS (dummy_lsw_tests_get_type ())
#define DUMMY_LSW_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DUMMY_LSW_TESTS, DummyLswTests))
#define DUMMY_LSW_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DUMMY_LSW_TESTS, DummyLswTestsClass))
#define IS_DUMMY_LSW_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DUMMY_LSW_TESTS))
#define IS_DUMMY_LSW_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DUMMY_LSW_TESTS))
#define DUMMY_LSW_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DUMMY_LSW_TESTS, DummyLswTestsClass))

typedef struct _DummyLswTests DummyLswTests;
typedef struct _DummyLswTestsClass DummyLswTestsClass;
typedef struct _DummyLswTestsPrivate DummyLswTestsPrivate;
#define _libsocialweb_test_backend_unref0(var) ((var == NULL) ? NULL : (var = (libsocialweb_test_backend_unref (var), NULL)))
typedef struct _Block1Data Block1Data;
#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_main_loop_unref0(var) ((var == NULL) ? NULL : (var = (g_main_loop_unref (var), NULL)))
typedef struct _Block2Data Block2Data;
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _Block3Data Block3Data;
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))

struct _DummyLswTests {
	FolksTestCase parent_instance;
	DummyLswTestsPrivate * priv;
};

struct _DummyLswTestsClass {
	FolksTestCaseClass parent_class;
};

struct _DummyLswTestsPrivate {
	LibsocialwebTestBackend* _lsw_backend;
};

struct _Block1Data {
	int _ref_count_;
	DummyLswTests * self;
	GMainLoop* main_loop;
	LibsocialwebTestLibsocialwebServiceTest* mysocialnetwork;
	gchar* view_path;
	FolksIndividual* i1;
	FolksIndividual* i2;
};

struct _Block2Data {
	int _ref_count_;
	Block1Data * _data1_;
	char* view_path;
};

struct _Block3Data {
	int _ref_count_;
	DummyLswTests * self;
	gchar* path;
};


static gpointer dummy_lsw_tests_parent_class = NULL;

GType dummy_lsw_tests_get_type (void) G_GNUC_CONST;
#define DUMMY_LSW_TESTS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_DUMMY_LSW_TESTS, DummyLswTestsPrivate))
enum  {
	DUMMY_LSW_TESTS_DUMMY_PROPERTY
};
DummyLswTests* dummy_lsw_tests_new (void);
DummyLswTests* dummy_lsw_tests_construct (GType object_type);
void dummy_lsw_tests_test_dummy_libsocialweb (DummyLswTests* self);
static void _dummy_lsw_tests_test_dummy_libsocialweb_folks_test_case_test_method (gpointer self);
static void dummy_lsw_tests_real_set_up (FolksTestCase* base);
static void dummy_lsw_tests_real_tear_down (FolksTestCase* base);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (Block1Data* _data1_);
static void _lambda0_ (Block1Data* _data1_);
static void __lambda0__libsocialweb_test_backend_ready (LibsocialwebTestBackend* _sender, gpointer self);
static gboolean _lambda1_ (DummyLswTests* self);
static gboolean __lambda1__gsource_func (gpointer self);
static void _g_free0_ (gpointer var);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (Block2Data* _data2_);
static void _lambda2_ (GObject* v, Block2Data* _data2_);
static void _vala_LibsocialwebTestLibsocialwebContactViewTestContactsAddedElement_array_free (LibsocialwebTestLibsocialwebContactViewTestContactsAddedElement* array, gint array_length);
static void __lambda2__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static gboolean _lambda3_ (DummyLswTests* self);
static gboolean __lambda3__gsource_func (gpointer self);
static void _lambda4_ (const gchar* query, GHashTable* p, const gchar* path, Block1Data* _data1_);
static void _lambda5_ (const gchar* path, DummyLswTests* self);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (Block3Data* _data3_);
static gboolean _lambda6_ (Block3Data* _data3_);
static gboolean __lambda6__gsource_func (gpointer self);
static void __lambda5__libsocialweb_test_libsocialweb_contact_view_test_start_called (LibsocialwebTestLibsocialwebContactViewTest* _sender, const gchar* path, gpointer self);
static void __lambda4__libsocialweb_test_libsocialweb_service_test_open_view_called (LibsocialwebTestLibsocialwebServiceTest* _sender, const gchar* query, GHashTable* p, const gchar* path, gpointer self);
static void _lambda7_ (GeeSet* added, GeeSet* removed, const gchar* m, FolksPersona* a, FolksGroupDetailsChangeReason r, Block1Data* _data1_);
static void __lambda7__folks_individual_aggregator_individuals_changed (FolksIndividualAggregator* _sender, GeeSet* added, GeeSet* removed, const gchar* message, FolksPersona* actor, FolksGroupDetailsChangeReason reason, gpointer self);
static gboolean _lambda8_ (DummyLswTests* self);
static gboolean __lambda8__gsource_func (gpointer self);
static gboolean _lambda9_ (Block1Data* _data1_);
static gboolean __lambda9__gsource_func (gpointer self);
static void _lambda10_ (Block1Data* _data1_);
static void __lambda10__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static gboolean _lambda11_ (DummyLswTests* self);
static gboolean __lambda11__gsource_func (gpointer self);
static gboolean _lambda12_ (Block1Data* _data1_);
static gboolean __lambda12__gsource_func (gpointer self);
static void _lambda13_ (GeeSet* added, GeeSet* removed, const gchar* m, FolksPersona* a, FolksGroupDetailsChangeReason r, Block1Data* _data1_);
static void __lambda13__folks_individual_aggregator_individuals_changed (FolksIndividualAggregator* _sender, GeeSet* added, GeeSet* removed, const gchar* message, FolksPersona* actor, FolksGroupDetailsChangeReason reason, gpointer self);
static gboolean _lambda14_ (DummyLswTests* self);
static gboolean __lambda14__gsource_func (gpointer self);
static void dummy_lsw_tests_finalize (GObject* obj);
gint _vala_main (gchar** args, int args_length1);


static void _dummy_lsw_tests_test_dummy_libsocialweb_folks_test_case_test_method (gpointer self) {
	dummy_lsw_tests_test_dummy_libsocialweb (self);
}


DummyLswTests* dummy_lsw_tests_construct (GType object_type) {
	DummyLswTests * self = NULL;
	LibsocialwebTestBackend* _tmp0_ = NULL;
	self = (DummyLswTests*) folks_test_case_construct (object_type, "DummyLsw");
	_tmp0_ = libsocialweb_test_backend_new ();
	_libsocialweb_test_backend_unref0 (self->priv->_lsw_backend);
	self->priv->_lsw_backend = _tmp0_;
	folks_test_case_add_test ((FolksTestCase*) self, "dummy libsocialweb", _dummy_lsw_tests_test_dummy_libsocialweb_folks_test_case_test_method, self);
	return self;
}


DummyLswTests* dummy_lsw_tests_new (void) {
	return dummy_lsw_tests_construct (TYPE_DUMMY_LSW_TESTS);
}


static void dummy_lsw_tests_real_set_up (FolksTestCase* base) {
	DummyLswTests * self;
	self = (DummyLswTests*) base;
}


static void dummy_lsw_tests_real_tear_down (FolksTestCase* base) {
	DummyLswTests * self;
	self = (DummyLswTests*) base;
}


static Block1Data* block1_data_ref (Block1Data* _data1_) {
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}


static void block1_data_unref (Block1Data* _data1_) {
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		_g_object_unref0 (_data1_->self);
		_g_object_unref0 (_data1_->i2);
		_g_object_unref0 (_data1_->i1);
		_g_free0 (_data1_->view_path);
		_g_object_unref0 (_data1_->mysocialnetwork);
		_g_main_loop_unref0 (_data1_->main_loop);
		g_slice_free (Block1Data, _data1_);
	}
}


static void _lambda0_ (Block1Data* _data1_) {
	DummyLswTests * self;
	self = _data1_->self;
	g_main_loop_quit (_data1_->main_loop);
}


static void __lambda0__libsocialweb_test_backend_ready (LibsocialwebTestBackend* _sender, gpointer self) {
	_lambda0_ (self);
}


static gboolean _lambda1_ (DummyLswTests* self) {
	gboolean result = FALSE;
	g_assert_not_reached ();
	result = FALSE;
	return result;
}


static gboolean __lambda1__gsource_func (gpointer self) {
	gboolean result;
	result = _lambda1_ (self);
	return result;
}


static void _g_free0_ (gpointer var) {
	var = (g_free (var), NULL);
}


static Block2Data* block2_data_ref (Block2Data* _data2_) {
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}


static void block2_data_unref (Block2Data* _data2_) {
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		block1_data_unref (_data2_->_data1_);
		_data2_->_data1_ = NULL;
		_g_free0 (_data2_->view_path);
		g_slice_free (Block2Data, _data2_);
	}
}


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


static void _vala_LibsocialwebTestLibsocialwebContactViewTestContactsAddedElement_array_free (LibsocialwebTestLibsocialwebContactViewTestContactsAddedElement* array, gint array_length) {
	if (array != NULL) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			libsocialweb_test_libsocialweb_contact_view_test_contacts_added_element_destroy (&array[i]);
		}
	}
	g_free (array);
}


static void _lambda2_ (GObject* v, Block2Data* _data2_) {
	Block1Data* _data1_;
	DummyLswTests * self;
	LibsocialwebTestContactView* _tmp0_;
	LibsocialwebTestContactView* view;
	gpointer _tmp1_ = NULL;
	LibsocialwebTestLibsocialwebContactViewTest* _tmp2_;
	LibsocialwebTestLibsocialwebContactViewTestContactsAddedElement* _tmp3_ = NULL;
	LibsocialwebTestLibsocialwebContactViewTestContactsAddedElement* _tmp4_;
	gint _tmp4__length1;
	gpointer _tmp5_ = NULL;
	LibsocialwebTestLibsocialwebContactViewTest* _tmp6_;
	LibsocialwebTestLibsocialwebContactViewTestContactsAddedElement* _tmp7_ = NULL;
	LibsocialwebTestLibsocialwebContactViewTestContactsAddedElement* _tmp8_;
	gint _tmp8__length1;
	_data1_ = _data2_->_data1_;
	self = _data1_->self;
	_tmp0_ = _g_object_ref0 (LIBSOCIALWEB_TEST_CONTACT_VIEW (v));
	view = _tmp0_;
	libsocialweb_test_contact_view_Start (view, NULL, NULL);
	_tmp1_ = gee_abstract_map_get ((GeeAbstractMap*) _data1_->mysocialnetwork->contact_views, (const gchar*) _data2_->view_path);
	_tmp2_ = (LibsocialwebTestLibsocialwebContactViewTest*) _tmp1_;
	_tmp3_ = g_new0 (LibsocialwebTestLibsocialwebContactViewTestContactsAddedElement, 0);
	_tmp4_ = _tmp3_;
	_tmp4__length1 = 0;
	g_signal_emit_by_name (_tmp2_, "contacts-added", _tmp4_, 0);
	_tmp4_ = (_vala_LibsocialwebTestLibsocialwebContactViewTestContactsAddedElement_array_free (_tmp4_, _tmp4__length1), NULL);
	_g_object_unref0 (_tmp2_);
	_tmp5_ = gee_abstract_map_get ((GeeAbstractMap*) _data1_->mysocialnetwork->contact_views, (const gchar*) _data2_->view_path);
	_tmp6_ = (LibsocialwebTestLibsocialwebContactViewTest*) _tmp5_;
	_tmp7_ = g_new0 (LibsocialwebTestLibsocialwebContactViewTestContactsAddedElement, 0);
	_tmp8_ = _tmp7_;
	_tmp8__length1 = 0;
	g_signal_emit_by_name (_tmp6_, "contacts-added", _tmp8_, 0);
	_tmp8_ = (_vala_LibsocialwebTestLibsocialwebContactViewTestContactsAddedElement_array_free (_tmp8_, _tmp8__length1), NULL);
	_g_object_unref0 (_tmp6_);
	g_main_loop_quit (_data1_->main_loop);
	_g_object_unref0 (view);
}


static void __lambda2__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	_lambda2_ (source_object, self);
	block2_data_unref (self);
}


static gboolean _lambda3_ (DummyLswTests* self) {
	gboolean result = FALSE;
	g_assert_not_reached ();
	return result;
}


static gboolean __lambda3__gsource_func (gpointer self) {
	gboolean result;
	result = _lambda3_ (self);
	return result;
}


static Block3Data* block3_data_ref (Block3Data* _data3_) {
	g_atomic_int_inc (&_data3_->_ref_count_);
	return _data3_;
}


static void block3_data_unref (Block3Data* _data3_) {
	if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
		_g_object_unref0 (_data3_->self);
		_g_free0 (_data3_->path);
		g_slice_free (Block3Data, _data3_);
	}
}


static gboolean _lambda6_ (Block3Data* _data3_) {
	DummyLswTests * self;
	gboolean result = FALSE;
	gchar* _tmp0_;
	gchar* text;
	GVariant* _tmp1_ = NULL;
	GVariant* v;
	GDBusConnection* _tmp2_ = NULL;
	GDBusConnection* conn;
	GError * _inner_error_ = NULL;
	self = _data3_->self;
	_tmp0_ = g_strdup ("([('mysocialnetwork', 'id01', %x, " "{'id': ['id01'], 'name': ['Gargantua']}), " "('mysocialnetwork', 'id02', %x, " "{'id': ['id02'], 'name': ['Pantagruel']})],)");
	text = _tmp0_;
	_tmp1_ = g_variant_new_parsed (text, 1300792578, 1300792579, NULL);
	v = g_variant_ref_sink (_tmp1_);
	_tmp2_ = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &_inner_error_);
	conn = _tmp2_;
	if (_inner_error_ != NULL) {
		if (_inner_error_->domain == G_IO_ERROR) {
			goto __catch1_g_io_error;
		}
		goto __catch1_g_error;
	}
	g_dbus_connection_emit_signal (conn, NULL, _data3_->path, "com.meego.libsocialweb.ContactView", "ContactsAdded", v, &_inner_error_);
	if (_inner_error_ != NULL) {
		_g_object_unref0 (conn);
		if (_inner_error_->domain == G_IO_ERROR) {
			goto __catch1_g_io_error;
		}
		goto __catch1_g_error;
	}
	_g_object_unref0 (conn);
	goto __finally1;
	__catch1_g_io_error:
	{
		GError * e;
		e = _inner_error_;
		_inner_error_ = NULL;
		g_assert_not_reached ();
		_g_error_free0 (e);
	}
	goto __finally1;
	__catch1_g_error:
	{
		GError * e;
		e = _inner_error_;
		_inner_error_ = NULL;
		g_assert_not_reached ();
		_g_error_free0 (e);
	}
	__finally1:
	if (_inner_error_ != NULL) {
		_g_variant_unref0 (v);
		_g_free0 (text);
		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 FALSE;
	}
	result = FALSE;
	_g_variant_unref0 (v);
	_g_free0 (text);
	return result;
}


static gboolean __lambda6__gsource_func (gpointer self) {
	gboolean result;
	result = _lambda6_ (self);
	return result;
}


static void _lambda5_ (const gchar* path, DummyLswTests* self) {
	Block3Data* _data3_;
	g_return_if_fail (path != NULL);
	_data3_ = g_slice_new0 (Block3Data);
	_data3_->_ref_count_ = 1;
	_data3_->self = g_object_ref (self);
	_data3_->path = g_strdup (path);
	g_debug ("dummy-lsw.vala:109: OpenViewCalled.connect");
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, __lambda6__gsource_func, block3_data_ref (_data3_), block3_data_unref);
	block3_data_unref (_data3_);
	_data3_ = NULL;
}


static void __lambda5__libsocialweb_test_libsocialweb_contact_view_test_start_called (LibsocialwebTestLibsocialwebContactViewTest* _sender, const gchar* path, gpointer self) {
	_lambda5_ (path, self);
}


static void _lambda4_ (const gchar* query, GHashTable* p, const gchar* path, Block1Data* _data1_) {
	DummyLswTests * self;
	gchar* _tmp0_;
	gpointer _tmp1_ = NULL;
	LibsocialwebTestLibsocialwebContactViewTest* _tmp2_;
	self = _data1_->self;
	g_return_if_fail (query != NULL);
	g_return_if_fail (p != NULL);
	g_return_if_fail (path != NULL);
	g_debug ("dummy-lsw.vala:105: mysocialnetwork.OpenViewCalled.connect");
	_tmp0_ = g_strdup (path);
	_g_free0 (_data1_->view_path);
	_data1_->view_path = _tmp0_;
	_tmp1_ = gee_abstract_map_get ((GeeAbstractMap*) _data1_->mysocialnetwork->contact_views, path);
	_tmp2_ = (LibsocialwebTestLibsocialwebContactViewTest*) _tmp1_;
	g_signal_connect_object (_tmp2_, "start-called", (GCallback) __lambda5__libsocialweb_test_libsocialweb_contact_view_test_start_called, self, 0);
	_g_object_unref0 (_tmp2_);
}


static void __lambda4__libsocialweb_test_libsocialweb_service_test_open_view_called (LibsocialwebTestLibsocialwebServiceTest* _sender, const gchar* query, GHashTable* p, const gchar* path, gpointer self) {
	_lambda4_ (query, p, path, self);
}


static void _lambda7_ (GeeSet* added, GeeSet* removed, const gchar* m, FolksPersona* a, FolksGroupDetailsChangeReason r, Block1Data* _data1_) {
	DummyLswTests * self;
	gint _tmp0_;
	gint _tmp1_;
	self = _data1_->self;
	g_return_if_fail (added != NULL);
	g_return_if_fail (removed != NULL);
	g_debug ("dummy-lsw.vala:143: Aggregator got some data!");
	_tmp0_ = gee_collection_get_size ((GeeCollection*) added);
	g_assert (_tmp0_ == 2);
	_tmp1_ = gee_collection_get_size ((GeeCollection*) removed);
	g_assert (_tmp1_ == 0);
	{
		GeeIterator* _tmp2_ = NULL;
		GeeIterator* _i_it;
		_tmp2_ = gee_iterable_iterator ((GeeIterable*) added);
		_i_it = _tmp2_;
		while (TRUE) {
			gboolean _tmp3_;
			gpointer _tmp4_ = NULL;
			FolksIndividual* i;
			const gchar* _tmp5_ = NULL;
			gchar* _tmp6_;
			gchar* nickname;
			_tmp3_ = gee_iterator_next (_i_it);
			if (!_tmp3_) {
				break;
			}
			_tmp4_ = gee_iterator_get (_i_it);
			i = (FolksIndividual*) _tmp4_;
			_tmp5_ = folks_name_details_get_nickname (FOLKS_NAME_DETAILS (i));
			_tmp6_ = g_strdup (_tmp5_);
			nickname = _tmp6_;
			if (g_strcmp0 (nickname, "Gargantua") == 0) {
				FolksIndividual* _tmp7_;
				_tmp7_ = _g_object_ref0 (i);
				_g_object_unref0 (_data1_->i1);
				_data1_->i1 = _tmp7_;
			}
			if (g_strcmp0 (nickname, "Pantagruel") == 0) {
				FolksIndividual* _tmp8_;
				_tmp8_ = _g_object_ref0 (i);
				_g_object_unref0 (_data1_->i2);
				_data1_->i2 = _tmp8_;
			}
			_g_free0 (nickname);
			_g_object_unref0 (i);
		}
		_g_object_unref0 (_i_it);
	}
	g_main_loop_quit (_data1_->main_loop);
}


static void __lambda7__folks_individual_aggregator_individuals_changed (FolksIndividualAggregator* _sender, GeeSet* added, GeeSet* removed, const gchar* message, FolksPersona* actor, FolksGroupDetailsChangeReason reason, gpointer self) {
	_lambda7_ (added, removed, message, actor, reason, self);
}


static gboolean _lambda8_ (DummyLswTests* self) {
	gboolean result = FALSE;
	g_assert_not_reached ();
	return result;
}


static gboolean __lambda8__gsource_func (gpointer self) {
	gboolean result;
	result = _lambda8_ (self);
	return result;
}


static gboolean _lambda9_ (Block1Data* _data1_) {
	DummyLswTests * self;
	gboolean result = FALSE;
	gchar* _tmp0_;
	gchar* text;
	GVariant* _tmp1_ = NULL;
	GVariant* v;
	GDBusConnection* _tmp2_ = NULL;
	GDBusConnection* conn;
	GError * _inner_error_ = NULL;
	self = _data1_->self;
	_tmp0_ = g_strdup ("([('mysocialnetwork', 'id01', %x, " "{'id': ['id01'], 'name': ['Rabelais']})],)");
	text = _tmp0_;
	_tmp1_ = g_variant_new_parsed (text, 1300792581, NULL);
	v = g_variant_ref_sink (_tmp1_);
	_tmp2_ = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &_inner_error_);
	conn = _tmp2_;
	if (_inner_error_ != NULL) {
		if (_inner_error_->domain == G_IO_ERROR) {
			goto __catch2_g_io_error;
		}
		goto __catch2_g_error;
	}
	g_dbus_connection_emit_signal (conn, NULL, _data1_->view_path, "com.meego.libsocialweb.ContactView", "ContactsChanged", v, &_inner_error_);
	if (_inner_error_ != NULL) {
		_g_object_unref0 (conn);
		if (_inner_error_->domain == G_IO_ERROR) {
			goto __catch2_g_io_error;
		}
		goto __catch2_g_error;
	}
	_g_object_unref0 (conn);
	goto __finally2;
	__catch2_g_io_error:
	{
		GError * e;
		e = _inner_error_;
		_inner_error_ = NULL;
		g_assert_not_reached ();
		_g_error_free0 (e);
	}
	goto __finally2;
	__catch2_g_error:
	{
		GError * e;
		e = _inner_error_;
		_inner_error_ = NULL;
		g_assert_not_reached ();
		_g_error_free0 (e);
	}
	__finally2:
	if (_inner_error_ != NULL) {
		_g_variant_unref0 (v);
		_g_free0 (text);
		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 FALSE;
	}
	result = FALSE;
	_g_variant_unref0 (v);
	_g_free0 (text);
	return result;
}


static gboolean __lambda9__gsource_func (gpointer self) {
	gboolean result;
	result = _lambda9_ (self);
	return result;
}


static void _lambda10_ (Block1Data* _data1_) {
	DummyLswTests * self;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_;
	gchar* nickname;
	self = _data1_->self;
	g_debug ("dummy-lsw.vala:194: Aggregator changed some data!");
	_tmp0_ = folks_name_details_get_nickname (FOLKS_NAME_DETAILS (_data1_->i1));
	_tmp1_ = g_strdup (_tmp0_);
	nickname = _tmp1_;
	g_assert (g_strcmp0 (nickname, "Rabelais") == 0);
	g_main_loop_quit (_data1_->main_loop);
	_g_free0 (nickname);
}


static void __lambda10__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	_lambda10_ (self);
}


static gboolean _lambda11_ (DummyLswTests* self) {
	gboolean result = FALSE;
	g_assert_not_reached ();
	return result;
}


static gboolean __lambda11__gsource_func (gpointer self) {
	gboolean result;
	result = _lambda11_ (self);
	return result;
}


static gboolean _lambda12_ (Block1Data* _data1_) {
	DummyLswTests * self;
	gboolean result = FALSE;
	gchar* _tmp0_;
	gchar* text;
	GVariant* _tmp1_ = NULL;
	GVariant* v;
	GDBusConnection* _tmp2_ = NULL;
	GDBusConnection* conn;
	GError * _inner_error_ = NULL;
	self = _data1_->self;
	_tmp0_ = g_strdup ("([('mysocialnetwork', 'id01'), " "('mysocialnetwork', 'id02')],)");
	text = _tmp0_;
	_tmp1_ = g_variant_new_parsed (text, NULL);
	v = g_variant_ref_sink (_tmp1_);
	_tmp2_ = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &_inner_error_);
	conn = _tmp2_;
	if (_inner_error_ != NULL) {
		if (_inner_error_->domain == G_IO_ERROR) {
			goto __catch3_g_io_error;
		}
		goto __catch3_g_error;
	}
	g_dbus_connection_emit_signal (conn, NULL, _data1_->view_path, "com.meego.libsocialweb.ContactView", "ContactsRemoved", v, &_inner_error_);
	if (_inner_error_ != NULL) {
		_g_object_unref0 (conn);
		if (_inner_error_->domain == G_IO_ERROR) {
			goto __catch3_g_io_error;
		}
		goto __catch3_g_error;
	}
	_g_object_unref0 (conn);
	goto __finally3;
	__catch3_g_io_error:
	{
		GError * e;
		e = _inner_error_;
		_inner_error_ = NULL;
		g_assert_not_reached ();
		_g_error_free0 (e);
	}
	goto __finally3;
	__catch3_g_error:
	{
		GError * e;
		e = _inner_error_;
		_inner_error_ = NULL;
		g_assert_not_reached ();
		_g_error_free0 (e);
	}
	__finally3:
	if (_inner_error_ != NULL) {
		_g_variant_unref0 (v);
		_g_free0 (text);
		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 FALSE;
	}
	result = FALSE;
	_g_variant_unref0 (v);
	_g_free0 (text);
	return result;
}


static gboolean __lambda12__gsource_func (gpointer self) {
	gboolean result;
	result = _lambda12_ (self);
	return result;
}


static void _lambda13_ (GeeSet* added, GeeSet* removed, const gchar* m, FolksPersona* a, FolksGroupDetailsChangeReason r, Block1Data* _data1_) {
	DummyLswTests * self;
	gint _tmp0_;
	gint _tmp1_;
	self = _data1_->self;
	g_return_if_fail (added != NULL);
	g_return_if_fail (removed != NULL);
	g_debug ("dummy-lsw.vala:235: Aggregator deleted some data!");
	_tmp0_ = gee_collection_get_size ((GeeCollection*) added);
	g_assert (_tmp0_ == 0);
	_tmp1_ = gee_collection_get_size ((GeeCollection*) removed);
	g_assert (_tmp1_ == 2);
	{
		GeeIterator* _tmp2_ = NULL;
		GeeIterator* _i_it;
		_tmp2_ = gee_iterable_iterator ((GeeIterable*) removed);
		_i_it = _tmp2_;
		while (TRUE) {
			gboolean _tmp3_;
			gpointer _tmp4_ = NULL;
			FolksIndividual* i;
			const gchar* _tmp5_ = NULL;
			gchar* _tmp6_;
			gchar* nickname;
			_tmp3_ = gee_iterator_next (_i_it);
			if (!_tmp3_) {
				break;
			}
			_tmp4_ = gee_iterator_get (_i_it);
			i = (FolksIndividual*) _tmp4_;
			_tmp5_ = folks_name_details_get_nickname (FOLKS_NAME_DETAILS (i));
			_tmp6_ = g_strdup (_tmp5_);
			nickname = _tmp6_;
			g_debug ("dummy-lsw.vala:241: deleted nickname: %s", nickname);
			_g_free0 (nickname);
			_g_object_unref0 (i);
		}
		_g_object_unref0 (_i_it);
	}
	g_main_loop_quit (_data1_->main_loop);
}


static void __lambda13__folks_individual_aggregator_individuals_changed (FolksIndividualAggregator* _sender, GeeSet* added, GeeSet* removed, const gchar* message, FolksPersona* actor, FolksGroupDetailsChangeReason reason, gpointer self) {
	_lambda13_ (added, removed, message, actor, reason, self);
}


static gboolean _lambda14_ (DummyLswTests* self) {
	gboolean result = FALSE;
	g_assert_not_reached ();
	return result;
}


static gboolean __lambda14__gsource_func (gpointer self) {
	gboolean result;
	result = _lambda14_ (self);
	return result;
}


void dummy_lsw_tests_test_dummy_libsocialweb (DummyLswTests* self) {
	Block1Data* _data1_;
	GMainLoop* _tmp0_ = NULL;
	guint _tmp1_;
	guint timer_id;
	LibsocialwebTestLibsocialwebServiceTest* _tmp2_ = NULL;
	GHashTable* _tmp3_ = NULL;
	GHashTable* p;
	Block2Data* _data2_;
	char* _tmp4_ = NULL;
	GDBusConnection* _tmp5_ = NULL;
	GDBusConnection* conn;
	guint _tmp6_;
	gchar* _tmp7_;
	FolksIndividualAggregator* _tmp8_ = NULL;
	FolksIndividualAggregator* aggregator;
	gulong _tmp9_;
	gulong handler_id;
	guint _tmp10_;
	gulong _tmp11_;
	guint _tmp12_;
	gulong _tmp13_;
	guint _tmp14_;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	_data1_->self = g_object_ref (self);
	_tmp0_ = g_main_loop_new (NULL, FALSE);
	_data1_->main_loop = _tmp0_;
	g_signal_connect_data (self->priv->_lsw_backend, "ready", (GCallback) __lambda0__libsocialweb_test_backend_ready, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
	_tmp1_ = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 5, __lambda1__gsource_func, g_object_ref (self), g_object_unref);
	timer_id = _tmp1_;
	libsocialweb_test_backend_set_up (self->priv->_lsw_backend);
	g_main_loop_run (_data1_->main_loop);
	g_source_remove (timer_id);
	_tmp2_ = libsocialweb_test_backend_add_service (self->priv->_lsw_backend, "mysocialnetwork");
	_data1_->mysocialnetwork = _tmp2_;
	_tmp3_ = g_hash_table_new_full (NULL, NULL, _g_free0_, _g_free0_);
	p = _tmp3_;
	_data2_ = g_slice_new0 (Block2Data);
	_data2_->_ref_count_ = 1;
	_data2_->_data1_ = block1_data_ref (_data1_);
	_tmp4_ = libsocialweb_test_libsocialweb_service_query_test_OpenView ((LibsocialwebTestLibsocialwebServiceQueryTest*) _data1_->mysocialnetwork, "feed", p, &_inner_error_);
	_data2_->view_path = _tmp4_;
	if (_inner_error_ != NULL) {
		block2_data_unref (_data2_);
		_data2_ = NULL;
		if (_inner_error_->domain == G_IO_ERROR) {
			goto __catch0_g_io_error;
		}
		block2_data_unref (_data2_);
		_data2_ = NULL;
		_g_hash_table_unref0 (p);
		block1_data_unref (_data1_);
		_data1_ = NULL;
		g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
	_tmp5_ = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &_inner_error_);
	conn = _tmp5_;
	if (_inner_error_ != NULL) {
		block2_data_unref (_data2_);
		_data2_ = NULL;
		if (_inner_error_->domain == G_IO_ERROR) {
			goto __catch0_g_io_error;
		}
		block2_data_unref (_data2_);
		_data2_ = NULL;
		_g_hash_table_unref0 (p);
		block1_data_unref (_data1_);
		_data1_ = NULL;
		g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
	g_async_initable_new_async (LIBSOCIALWEB_TEST_TYPE_CONTACT_VIEW_PROXY, 0, NULL, __lambda2__gasync_ready_callback, block2_data_ref (_data2_), "g-flags", 0, "g-name", "com.meego.libsocialweb", "g-connection", conn, "g-object-path", (const gchar*) _data2_->view_path, "g-interface-name", "com.meego.libsocialweb.ContactView", NULL);
	_g_object_unref0 (conn);
	block2_data_unref (_data2_);
	_data2_ = NULL;
	goto __finally0;
	__catch0_g_io_error:
	{
		GError * e;
		e = _inner_error_;
		_inner_error_ = NULL;
		g_assert_not_reached ();
		_g_error_free0 (e);
	}
	__finally0:
	if (_inner_error_ != NULL) {
		_g_hash_table_unref0 (p);
		block1_data_unref (_data1_);
		_data1_ = 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;
	}
	_tmp6_ = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 5, __lambda3__gsource_func, g_object_ref (self), g_object_unref);
	timer_id = _tmp6_;
	g_main_loop_run (_data1_->main_loop);
	g_source_remove (timer_id);
	_tmp7_ = g_strdup ("");
	_data1_->view_path = _tmp7_;
	g_signal_connect_data (_data1_->mysocialnetwork, "open-view-called", (GCallback) __lambda4__libsocialweb_test_libsocialweb_service_test_open_view_called, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
	_tmp8_ = folks_individual_aggregator_new ();
	aggregator = _tmp8_;
	_data1_->i1 = NULL;
	_data1_->i2 = NULL;
	_tmp9_ = g_signal_connect_data (aggregator, "individuals-changed", (GCallback) __lambda7__folks_individual_aggregator_individuals_changed, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
	handler_id = _tmp9_;
	folks_individual_aggregator_prepare (aggregator, NULL, NULL);
	_tmp10_ = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 5, __lambda8__gsource_func, g_object_ref (self), g_object_unref);
	timer_id = _tmp10_;
	g_main_loop_run (_data1_->main_loop);
	g_source_remove (timer_id);
	g_signal_handler_disconnect ((GObject*) aggregator, handler_id);
	g_assert (_data1_->i1 != NULL);
	g_assert (_data1_->i2 != NULL);
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, __lambda9__gsource_func, block1_data_ref (_data1_), block1_data_unref);
	_tmp11_ = g_signal_connect_data ((GObject*) _data1_->i1, "notify::nickname", (GCallback) __lambda10__g_object_notify, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
	handler_id = _tmp11_;
	_tmp12_ = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 5, __lambda11__gsource_func, g_object_ref (self), g_object_unref);
	timer_id = _tmp12_;
	g_main_loop_run (_data1_->main_loop);
	g_source_remove (timer_id);
	g_signal_handler_disconnect ((GObject*) _data1_->i1, handler_id);
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, __lambda12__gsource_func, block1_data_ref (_data1_), block1_data_unref);
	_tmp13_ = g_signal_connect_data (aggregator, "individuals-changed", (GCallback) __lambda13__folks_individual_aggregator_individuals_changed, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
	handler_id = _tmp13_;
	_tmp14_ = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 5, __lambda14__gsource_func, g_object_ref (self), g_object_unref);
	timer_id = _tmp14_;
	g_main_loop_run (_data1_->main_loop);
	g_source_remove (timer_id);
	g_signal_handler_disconnect ((GObject*) aggregator, handler_id);
	libsocialweb_test_backend_tear_down (self->priv->_lsw_backend);
	_g_object_unref0 (aggregator);
	_g_hash_table_unref0 (p);
	block1_data_unref (_data1_);
	_data1_ = NULL;
}


static void dummy_lsw_tests_class_init (DummyLswTestsClass * klass) {
	dummy_lsw_tests_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (DummyLswTestsPrivate));
	FOLKS_TEST_CASE_CLASS (klass)->set_up = dummy_lsw_tests_real_set_up;
	FOLKS_TEST_CASE_CLASS (klass)->tear_down = dummy_lsw_tests_real_tear_down;
	G_OBJECT_CLASS (klass)->finalize = dummy_lsw_tests_finalize;
}


static void dummy_lsw_tests_instance_init (DummyLswTests * self) {
	self->priv = DUMMY_LSW_TESTS_GET_PRIVATE (self);
}


static void dummy_lsw_tests_finalize (GObject* obj) {
	DummyLswTests * self;
	self = DUMMY_LSW_TESTS (obj);
	_libsocialweb_test_backend_unref0 (self->priv->_lsw_backend);
	G_OBJECT_CLASS (dummy_lsw_tests_parent_class)->finalize (obj);
}


GType dummy_lsw_tests_get_type (void) {
	static volatile gsize dummy_lsw_tests_type_id__volatile = 0;
	if (g_once_init_enter (&dummy_lsw_tests_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (DummyLswTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dummy_lsw_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DummyLswTests), 0, (GInstanceInitFunc) dummy_lsw_tests_instance_init, NULL };
		GType dummy_lsw_tests_type_id;
		dummy_lsw_tests_type_id = g_type_register_static (FOLKS_TYPE_TEST_CASE, "DummyLswTests", &g_define_type_info, 0);
		g_once_init_leave (&dummy_lsw_tests_type_id__volatile, dummy_lsw_tests_type_id);
	}
	return dummy_lsw_tests_type_id__volatile;
}


gint _vala_main (gchar** args, int args_length1) {
	gint result = 0;
	GTestSuite* _tmp0_ = NULL;
	GTestSuite* root;
	DummyLswTests* _tmp1_ = NULL;
	DummyLswTests* _tmp2_;
	GTestSuite* _tmp3_ = NULL;
	g_test_init (&args_length1, &args, NULL);
	_tmp0_ = g_test_get_root ();
	root = _tmp0_;
	_tmp1_ = dummy_lsw_tests_new ();
	_tmp2_ = _tmp1_;
	_tmp3_ = folks_test_case_get_suite ((FolksTestCase*) _tmp2_);
	g_test_suite_add_suite (root, _tmp3_);
	_g_object_unref0 (_tmp2_);
	g_test_run ();
	result = 0;
	return result;
}


int main (int argc, char ** argv) {
	g_type_init ();
	return _vala_main (argv, argc);
}



