/* role-details-interface.c generated by valac 0.14.0.15-f8b5, the Vala compiler
 * generated from role-details-interface.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: Raul Gutierrez Segales <raul.gutierrez.segales@collabora.co.uk>
 *
 */

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


#define TYPE_ROLE_DETAILS_INTERFACE_TESTS (role_details_interface_tests_get_type ())
#define ROLE_DETAILS_INTERFACE_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ROLE_DETAILS_INTERFACE_TESTS, RoleDetailsInterfaceTests))
#define ROLE_DETAILS_INTERFACE_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ROLE_DETAILS_INTERFACE_TESTS, RoleDetailsInterfaceTestsClass))
#define IS_ROLE_DETAILS_INTERFACE_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ROLE_DETAILS_INTERFACE_TESTS))
#define IS_ROLE_DETAILS_INTERFACE_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ROLE_DETAILS_INTERFACE_TESTS))
#define ROLE_DETAILS_INTERFACE_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ROLE_DETAILS_INTERFACE_TESTS, RoleDetailsInterfaceTestsClass))

typedef struct _RoleDetailsInterfaceTests RoleDetailsInterfaceTests;
typedef struct _RoleDetailsInterfaceTestsClass RoleDetailsInterfaceTestsClass;
typedef struct _RoleDetailsInterfaceTestsPrivate RoleDetailsInterfaceTestsPrivate;
#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 _tracker_test_backend_unref0(var) ((var == NULL) ? NULL : (var = (tracker_test_backend_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 _RoleDetailsInterfaceTestsTestRoleDetailsInterfaceAsyncData RoleDetailsInterfaceTestsTestRoleDetailsInterfaceAsyncData;

struct _RoleDetailsInterfaceTests {
	FolksTestCase parent_instance;
	RoleDetailsInterfaceTestsPrivate * priv;
};

struct _RoleDetailsInterfaceTestsClass {
	FolksTestCaseClass parent_class;
};

struct _RoleDetailsInterfaceTestsPrivate {
	GMainLoop* _main_loop;
	FolksIndividualAggregator* _aggregator;
	TrackerTestBackend* _tracker_backend;
	gboolean _found_role;
	gchar* _fullname;
	gchar* _affiliaton;
};

struct _RoleDetailsInterfaceTestsTestRoleDetailsInterfaceAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	RoleDetailsInterfaceTests* self;
	FolksBackendStore* _tmp0_;
	FolksBackendStore* store;
	FolksIndividualAggregator* _tmp1_;
	FolksIndividualAggregator* _tmp2_;
	FolksIndividualAggregator* _tmp3_;
	GError* e;
	GError* _tmp4_;
	const gchar* _tmp5_;
	GError * _inner_error_;
};


static gpointer role_details_interface_tests_parent_class = NULL;

GType role_details_interface_tests_get_type (void) G_GNUC_CONST;
#define ROLE_DETAILS_INTERFACE_TESTS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_ROLE_DETAILS_INTERFACE_TESTS, RoleDetailsInterfaceTestsPrivate))
enum  {
	ROLE_DETAILS_INTERFACE_TESTS_DUMMY_PROPERTY
};
RoleDetailsInterfaceTests* role_details_interface_tests_new (void);
RoleDetailsInterfaceTests* role_details_interface_tests_construct (GType object_type);
void role_details_interface_tests_test_role_details_interface (RoleDetailsInterfaceTests* self);
static void _role_details_interface_tests_test_role_details_interface_folks_test_case_test_method (gpointer self);
static void role_details_interface_tests_real_set_up (FolksTestCase* base);
static void role_details_interface_tests_real_tear_down (FolksTestCase* base);
static void _role_details_interface_tests_test_role_details_interface_async (RoleDetailsInterfaceTests* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _role_details_interface_tests_test_role_details_interface_finish (RoleDetailsInterfaceTests* self, GAsyncResult* _res_);
static gboolean __lambda2_ (RoleDetailsInterfaceTests* self);
static gboolean ___lambda2__gsource_func (gpointer self);
static void _role_details_interface_tests_test_role_details_interface_async_data_free (gpointer _data);
static gboolean _role_details_interface_tests_test_role_details_interface_async_co (RoleDetailsInterfaceTestsTestRoleDetailsInterfaceAsyncData* _data_);
static void _role_details_interface_tests_test_role_details_interface_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _role_details_interface_tests_individuals_changed_cb (RoleDetailsInterfaceTests* self, GeeMultiMap* changes);
static void __role_details_interface_tests_individuals_changed_cb_folks_individual_aggregator_individuals_changed_detailed (FolksIndividualAggregator* _sender, GeeMultiMap* changes, gpointer self);
static void role_details_interface_tests_finalize (GObject* obj);
gint _vala_main (gchar** args, int args_length1);


static void _role_details_interface_tests_test_role_details_interface_folks_test_case_test_method (gpointer self) {
#line 42 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	role_details_interface_tests_test_role_details_interface (self);
#line 119 "role-details-interface.c"
}


RoleDetailsInterfaceTests* role_details_interface_tests_construct (GType object_type) {
	RoleDetailsInterfaceTests * self = NULL;
	TrackerTestBackend* _tmp0_;
	TrackerTestBackend* _tmp1_;
#line 37 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	self = (RoleDetailsInterfaceTests*) folks_test_case_construct (object_type, "RoleDetailsInterfaceTests");
#line 39 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_tmp0_ = tracker_test_backend_new ();
#line 39 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_tracker_test_backend_unref0 (self->priv->_tracker_backend);
#line 39 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	self->priv->_tracker_backend = _tmp0_;
#line 40 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_tmp1_ = self->priv->_tracker_backend;
#line 40 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	tracker_test_backend_set_debug (_tmp1_, FALSE);
#line 42 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	folks_test_case_add_test ((FolksTestCase*) self, "test role details interface", _role_details_interface_tests_test_role_details_interface_folks_test_case_test_method, self);
#line 35 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	return self;
#line 143 "role-details-interface.c"
}


RoleDetailsInterfaceTests* role_details_interface_tests_new (void) {
#line 35 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	return role_details_interface_tests_construct (TYPE_ROLE_DETAILS_INTERFACE_TESTS);
#line 150 "role-details-interface.c"
}


static void role_details_interface_tests_real_set_up (FolksTestCase* base) {
	RoleDetailsInterfaceTests * self;
#line 46 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	self = (RoleDetailsInterfaceTests*) base;
#line 158 "role-details-interface.c"
}


static void role_details_interface_tests_real_tear_down (FolksTestCase* base) {
	RoleDetailsInterfaceTests * self;
#line 50 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	self = (RoleDetailsInterfaceTests*) base;
#line 166 "role-details-interface.c"
}


static gboolean __lambda2_ (RoleDetailsInterfaceTests* self) {
	gboolean result = FALSE;
	GMainLoop* _tmp0_;
#line 73 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_tmp0_ = self->priv->_main_loop;
#line 73 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	g_main_loop_quit (_tmp0_);
#line 74 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	g_assert_not_reached ();
#line 71 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	return result;
#line 181 "role-details-interface.c"
}


static gboolean ___lambda2__gsource_func (gpointer self) {
	gboolean result;
	result = __lambda2_ (self);
#line 71 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	return result;
#line 190 "role-details-interface.c"
}


void role_details_interface_tests_test_role_details_interface (RoleDetailsInterfaceTests* self) {
	GMainLoop* _tmp0_;
	GeeHashMap* _tmp1_;
	GeeHashMap* c1;
	gchar* _tmp2_;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	TrackerTestBackend* _tmp6_;
	TrackerTestBackend* _tmp7_;
	GMainLoop* _tmp8_;
	gboolean _tmp9_;
	TrackerTestBackend* _tmp10_;
#line 54 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	g_return_if_fail (self != NULL);
#line 56 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_tmp0_ = g_main_loop_new (NULL, FALSE);
#line 56 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_g_main_loop_unref0 (self->priv->_main_loop);
#line 56 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	self->priv->_main_loop = _tmp0_;
#line 57 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_tmp1_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL);
#line 57 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	c1 = _tmp1_;
#line 58 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_tmp2_ = g_strdup ("persona #1");
#line 58 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_g_free0 (self->priv->_fullname);
#line 58 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	self->priv->_fullname = _tmp2_;
#line 59 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_tmp3_ = g_strdup ("boss,Company,Role");
#line 59 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_g_free0 (self->priv->_affiliaton);
#line 59 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	self->priv->_affiliaton = _tmp3_;
#line 61 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_tmp4_ = self->priv->_fullname;
#line 61 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	gee_abstract_map_set ((GeeAbstractMap*) c1, TRF_ONTOLOGY_DEFS_NCO_FULLNAME, _tmp4_);
#line 62 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_tmp5_ = self->priv->_affiliaton;
#line 62 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	gee_abstract_map_set ((GeeAbstractMap*) c1, TRF_ONTOLOGY_DEFS_NCO_HAS_AFFILIATION, _tmp5_);
#line 63 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_tmp6_ = self->priv->_tracker_backend;
#line 63 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	tracker_test_backend_add_contact (_tmp6_, c1);
#line 65 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_tmp7_ = self->priv->_tracker_backend;
#line 65 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	tracker_test_backend_set_up (_tmp7_);
#line 67 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	self->priv->_found_role = FALSE;
#line 69 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_role_details_interface_tests_test_role_details_interface_async (self, NULL, NULL);
#line 71 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 5, ___lambda2__gsource_func, g_object_ref (self), g_object_unref);
#line 77 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_tmp8_ = self->priv->_main_loop;
#line 77 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	g_main_loop_run (_tmp8_);
#line 79 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_tmp9_ = self->priv->_found_role;
#line 79 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	g_assert (_tmp9_ == TRUE);
#line 81 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_tmp10_ = self->priv->_tracker_backend;
#line 81 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	tracker_test_backend_tear_down (_tmp10_);
#line 54 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_g_object_unref0 (c1);
#line 267 "role-details-interface.c"
}


static void _role_details_interface_tests_test_role_details_interface_async_data_free (gpointer _data) {
	RoleDetailsInterfaceTestsTestRoleDetailsInterfaceAsyncData* _data_;
	_data_ = _data;
#line 26 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_g_object_unref0 (_data_->self);
#line 26 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	g_slice_free (RoleDetailsInterfaceTestsTestRoleDetailsInterfaceAsyncData, _data_);
#line 278 "role-details-interface.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 26 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	return self ? g_object_ref (self) : NULL;
#line 285 "role-details-interface.c"
}


static void _role_details_interface_tests_test_role_details_interface_async (RoleDetailsInterfaceTests* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	RoleDetailsInterfaceTestsTestRoleDetailsInterfaceAsyncData* _data_;
	RoleDetailsInterfaceTests* _tmp0_;
#line 26 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_data_ = g_slice_new0 (RoleDetailsInterfaceTestsTestRoleDetailsInterfaceAsyncData);
#line 26 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _role_details_interface_tests_test_role_details_interface_async);
#line 26 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _role_details_interface_tests_test_role_details_interface_async_data_free);
#line 26 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 26 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_data_->self = _tmp0_;
#line 26 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_role_details_interface_tests_test_role_details_interface_async_co (_data_);
#line 304 "role-details-interface.c"
}


static void _role_details_interface_tests_test_role_details_interface_finish (RoleDetailsInterfaceTests* self, GAsyncResult* _res_) {
	RoleDetailsInterfaceTestsTestRoleDetailsInterfaceAsyncData* _data_;
#line 26 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 312 "role-details-interface.c"
}


static void _role_details_interface_tests_test_role_details_interface_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	RoleDetailsInterfaceTestsTestRoleDetailsInterfaceAsyncData* _data_;
#line 87 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_data_ = _user_data_;
#line 87 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_data_->_source_object_ = source_object;
#line 87 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_data_->_res_ = _res_;
#line 87 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_role_details_interface_tests_test_role_details_interface_async_co (_data_);
#line 326 "role-details-interface.c"
}


static void __role_details_interface_tests_individuals_changed_cb_folks_individual_aggregator_individuals_changed_detailed (FolksIndividualAggregator* _sender, GeeMultiMap* changes, gpointer self) {
#line 89 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_role_details_interface_tests_individuals_changed_cb (self, changes);
#line 333 "role-details-interface.c"
}


static gboolean _role_details_interface_tests_test_role_details_interface_async_co (RoleDetailsInterfaceTestsTestRoleDetailsInterfaceAsyncData* _data_) {
#line 84 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	switch (_data_->_state_) {
#line 84 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
		case 0:
#line 342 "role-details-interface.c"
		goto _state_0;
#line 84 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
		case 1:
#line 346 "role-details-interface.c"
		goto _state_1;
#line 84 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
		case 2:
#line 350 "role-details-interface.c"
		goto _state_2;
		default:
#line 84 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
		g_assert_not_reached ();
#line 355 "role-details-interface.c"
	}
	_state_0:
#line 86 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_data_->_tmp0_ = NULL;
#line 86 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_data_->_tmp0_ = folks_backend_store_dup ();
#line 86 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_data_->store = _data_->_tmp0_;
#line 87 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_data_->_state_ = 1;
#line 87 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	folks_backend_store_prepare (_data_->store, _role_details_interface_tests_test_role_details_interface_async_ready, _data_);
#line 87 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	return FALSE;
#line 370 "role-details-interface.c"
	_state_1:
#line 87 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	folks_backend_store_prepare_finish (_data_->store, _data_->_res_);
#line 88 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_data_->_tmp1_ = folks_individual_aggregator_new ();
#line 88 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_g_object_unref0 (_data_->self->priv->_aggregator);
#line 88 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_data_->self->priv->_aggregator = _data_->_tmp1_;
#line 89 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_data_->_tmp2_ = _data_->self->priv->_aggregator;
#line 89 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	g_signal_connect_object (_data_->_tmp2_, "individuals-changed-detailed", (GCallback) __role_details_interface_tests_individuals_changed_cb_folks_individual_aggregator_individuals_changed_detailed, _data_->self, 0);
#line 384 "role-details-interface.c"
	{
#line 93 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
		_data_->_tmp3_ = _data_->self->priv->_aggregator;
#line 93 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
		_data_->_state_ = 2;
#line 93 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
		folks_individual_aggregator_prepare (_data_->_tmp3_, _role_details_interface_tests_test_role_details_interface_async_ready, _data_);
#line 93 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
		return FALSE;
#line 394 "role-details-interface.c"
		_state_2:
#line 93 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
		folks_individual_aggregator_prepare_finish (_data_->_tmp3_, _data_->_res_, &_data_->_inner_error_);
#line 93 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
		if (_data_->_inner_error_ != NULL) {
#line 400 "role-details-interface.c"
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
#line 91 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
		_data_->e = _data_->_inner_error_;
#line 91 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
		_data_->_inner_error_ = NULL;
#line 97 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
		_data_->_tmp4_ = _data_->e;
#line 97 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
		_data_->_tmp5_ = _data_->_tmp4_->message;
#line 97 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
		g_warning ("role-details-interface.vala:97: Error when calling prepare: %s\n", _data_->_tmp5_);
#line 91 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
		_g_error_free0 (_data_->e);
#line 419 "role-details-interface.c"
	}
	__finally0:
#line 91 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	if (_data_->_inner_error_ != NULL) {
#line 91 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
		_g_object_unref0 (_data_->store);
#line 91 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.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/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
		g_clear_error (&_data_->_inner_error_);
#line 91 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
		return FALSE;
#line 432 "role-details-interface.c"
	}
#line 84 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_g_object_unref0 (_data_->store);
#line 84 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	if (_data_->_state_ == 0) {
#line 84 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 440 "role-details-interface.c"
	} else {
#line 84 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 444 "role-details-interface.c"
	}
#line 84 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	g_object_unref (_data_->_async_result);
#line 84 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	return FALSE;
#line 450 "role-details-interface.c"
}


static void _role_details_interface_tests_individuals_changed_cb (RoleDetailsInterfaceTests* self, GeeMultiMap* changes) {
	GeeMultiMap* _tmp0_;
	GeeCollection* _tmp1_ = NULL;
	GeeCollection* added;
	GeeMultiMap* _tmp2_;
	GeeSet* _tmp3_ = NULL;
	GeeSet* removed;
	GeeSet* _tmp31_;
	gint _tmp32_;
	gint _tmp33_;
#line 101 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	g_return_if_fail (self != NULL);
#line 101 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	g_return_if_fail (changes != NULL);
#line 104 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_tmp0_ = changes;
#line 104 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_tmp1_ = gee_multi_map_get_values (_tmp0_);
#line 104 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	added = _tmp1_;
#line 105 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_tmp2_ = changes;
#line 105 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_tmp3_ = gee_multi_map_get_keys (_tmp2_);
#line 105 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	removed = _tmp3_;
#line 480 "role-details-interface.c"
	{
		GeeCollection* _tmp4_;
		GeeIterator* _tmp5_ = NULL;
		GeeIterator* _i_it;
#line 107 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
		_tmp4_ = added;
#line 107 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
#line 107 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
		_i_it = _tmp5_;
#line 107 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
		while (TRUE) {
#line 493 "role-details-interface.c"
			GeeIterator* _tmp6_;
			gboolean _tmp7_ = FALSE;
			GeeIterator* _tmp8_;
			gpointer _tmp9_ = NULL;
			FolksIndividual* i;
			FolksIndividual* _tmp10_;
			FolksIndividual* _tmp11_;
			const gchar* _tmp12_;
			const gchar* _tmp13_;
			const gchar* _tmp14_;
#line 107 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
			_tmp6_ = _i_it;
#line 107 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
			_tmp7_ = gee_iterator_next (_tmp6_);
#line 107 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
			if (!_tmp7_) {
#line 107 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
				break;
#line 512 "role-details-interface.c"
			}
#line 107 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
			_tmp8_ = _i_it;
#line 107 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
			_tmp9_ = gee_iterator_get (_tmp8_);
#line 107 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
			i = (FolksIndividual*) _tmp9_;
#line 109 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
			_tmp10_ = i;
#line 109 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
			g_assert (_tmp10_ != NULL);
#line 111 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
			_tmp11_ = i;
#line 111 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
			_tmp12_ = folks_name_details_get_full_name ((FolksNameDetails*) _tmp11_);
#line 111 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
			_tmp13_ = _tmp12_;
#line 111 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
			_tmp14_ = self->priv->_fullname;
#line 111 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
			if (g_strcmp0 (_tmp13_, _tmp14_) == 0) {
#line 534 "role-details-interface.c"
				{
					FolksIndividual* _tmp15_;
					GeeSet* _tmp16_;
					GeeSet* _tmp17_;
					GeeIterator* _tmp18_ = NULL;
					GeeIterator* _role_fd_it;
#line 113 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
					_tmp15_ = i;
#line 113 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
					_tmp16_ = folks_role_details_get_roles ((FolksRoleDetails*) _tmp15_);
#line 113 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
					_tmp17_ = _tmp16_;
#line 113 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
					_tmp18_ = gee_iterable_iterator ((GeeIterable*) _tmp17_);
#line 113 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
					_role_fd_it = _tmp18_;
#line 113 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
					while (TRUE) {
#line 553 "role-details-interface.c"
						GeeIterator* _tmp19_;
						gboolean _tmp20_ = FALSE;
						GeeIterator* _tmp21_;
						gpointer _tmp22_ = NULL;
						FolksRoleFieldDetails* role_fd;
						FolksRole* _tmp23_;
						FolksRole* role_expected;
						FolksRole* _tmp24_;
						FolksRole* _tmp25_;
						FolksRoleFieldDetails* _tmp26_;
						FolksRoleFieldDetails* role_fd_expected;
						FolksRoleFieldDetails* _tmp27_;
						FolksRoleFieldDetails* _tmp28_;
						gboolean _tmp29_ = FALSE;
#line 113 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
						_tmp19_ = _role_fd_it;
#line 113 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
						_tmp20_ = gee_iterator_next (_tmp19_);
#line 113 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
						if (!_tmp20_) {
#line 113 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
							break;
#line 576 "role-details-interface.c"
						}
#line 113 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
						_tmp21_ = _role_fd_it;
#line 113 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
						_tmp22_ = gee_iterator_get (_tmp21_);
#line 113 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
						role_fd = (FolksRoleFieldDetails*) _tmp22_;
#line 115 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
						_tmp23_ = folks_role_new ("boss", "Company", NULL);
#line 115 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
						role_expected = _tmp23_;
#line 116 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
						_tmp24_ = role_expected;
#line 116 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
						folks_role_set_role (_tmp24_, "Role");
#line 117 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
						_tmp25_ = role_expected;
#line 117 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
						_tmp26_ = folks_role_field_details_new (_tmp25_, NULL);
#line 117 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
						role_fd_expected = _tmp26_;
#line 118 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
						_tmp27_ = role_fd;
#line 118 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
						_tmp28_ = role_fd_expected;
#line 118 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
						_tmp29_ = folks_abstract_field_details_equal ((FolksAbstractFieldDetails*) _tmp27_, (FolksAbstractFieldDetails*) _tmp28_);
#line 118 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
						if (_tmp29_) {
#line 606 "role-details-interface.c"
							GMainLoop* _tmp30_;
#line 120 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
							self->priv->_found_role = TRUE;
#line 121 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
							_tmp30_ = self->priv->_main_loop;
#line 121 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
							g_main_loop_quit (_tmp30_);
#line 614 "role-details-interface.c"
						}
#line 113 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
						_g_object_unref0 (role_fd_expected);
#line 113 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
						_g_object_unref0 (role_expected);
#line 113 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
						_g_object_unref0 (role_fd);
#line 622 "role-details-interface.c"
					}
#line 113 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
					_g_object_unref0 (_role_fd_it);
#line 626 "role-details-interface.c"
				}
			}
#line 107 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
			_g_object_unref0 (i);
#line 631 "role-details-interface.c"
		}
#line 107 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
		_g_object_unref0 (_i_it);
#line 635 "role-details-interface.c"
	}
#line 127 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_tmp31_ = removed;
#line 127 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_tmp32_ = gee_collection_get_size ((GeeCollection*) _tmp31_);
#line 127 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_tmp33_ = _tmp32_;
#line 127 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	g_assert (_tmp33_ == 1);
#line 645 "role-details-interface.c"
	{
		GeeSet* _tmp34_;
		GeeIterator* _tmp35_ = NULL;
		GeeIterator* _i_it;
#line 129 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
		_tmp34_ = removed;
#line 129 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
		_tmp35_ = gee_iterable_iterator ((GeeIterable*) _tmp34_);
#line 129 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
		_i_it = _tmp35_;
#line 129 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
		while (TRUE) {
#line 658 "role-details-interface.c"
			GeeIterator* _tmp36_;
			gboolean _tmp37_ = FALSE;
			GeeIterator* _tmp38_;
			gpointer _tmp39_ = NULL;
			FolksIndividual* i;
			FolksIndividual* _tmp40_;
#line 129 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
			_tmp36_ = _i_it;
#line 129 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
			_tmp37_ = gee_iterator_next (_tmp36_);
#line 129 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
			if (!_tmp37_) {
#line 129 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
				break;
#line 673 "role-details-interface.c"
			}
#line 129 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
			_tmp38_ = _i_it;
#line 129 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
			_tmp39_ = gee_iterator_get (_tmp38_);
#line 129 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
			i = (FolksIndividual*) _tmp39_;
#line 131 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
			_tmp40_ = i;
#line 131 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
			g_assert (_tmp40_ == NULL);
#line 129 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
			_g_object_unref0 (i);
#line 687 "role-details-interface.c"
		}
#line 129 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
		_g_object_unref0 (_i_it);
#line 691 "role-details-interface.c"
	}
#line 101 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_g_object_unref0 (removed);
#line 101 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_g_object_unref0 (added);
#line 697 "role-details-interface.c"
}


static void role_details_interface_tests_class_init (RoleDetailsInterfaceTestsClass * klass) {
#line 26 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	role_details_interface_tests_parent_class = g_type_class_peek_parent (klass);
#line 26 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	g_type_class_add_private (klass, sizeof (RoleDetailsInterfaceTestsPrivate));
#line 26 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	FOLKS_TEST_CASE_CLASS (klass)->set_up = role_details_interface_tests_real_set_up;
#line 26 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	FOLKS_TEST_CASE_CLASS (klass)->tear_down = role_details_interface_tests_real_tear_down;
#line 26 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	G_OBJECT_CLASS (klass)->finalize = role_details_interface_tests_finalize;
#line 712 "role-details-interface.c"
}


static void role_details_interface_tests_instance_init (RoleDetailsInterfaceTests * self) {
#line 26 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	self->priv = ROLE_DETAILS_INTERFACE_TESTS_GET_PRIVATE (self);
#line 719 "role-details-interface.c"
}


static void role_details_interface_tests_finalize (GObject* obj) {
	RoleDetailsInterfaceTests * self;
#line 26 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	self = ROLE_DETAILS_INTERFACE_TESTS (obj);
#line 28 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_g_main_loop_unref0 (self->priv->_main_loop);
#line 29 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_g_object_unref0 (self->priv->_aggregator);
#line 30 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_tracker_test_backend_unref0 (self->priv->_tracker_backend);
#line 32 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_g_free0 (self->priv->_fullname);
#line 33 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_g_free0 (self->priv->_affiliaton);
#line 26 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	G_OBJECT_CLASS (role_details_interface_tests_parent_class)->finalize (obj);
#line 739 "role-details-interface.c"
}


GType role_details_interface_tests_get_type (void) {
	static volatile gsize role_details_interface_tests_type_id__volatile = 0;
	if (g_once_init_enter (&role_details_interface_tests_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (RoleDetailsInterfaceTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) role_details_interface_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RoleDetailsInterfaceTests), 0, (GInstanceInitFunc) role_details_interface_tests_instance_init, NULL };
		GType role_details_interface_tests_type_id;
		role_details_interface_tests_type_id = g_type_register_static (FOLKS_TYPE_TEST_CASE, "RoleDetailsInterfaceTests", &g_define_type_info, 0);
		g_once_init_leave (&role_details_interface_tests_type_id__volatile, role_details_interface_tests_type_id);
	}
	return role_details_interface_tests_type_id__volatile;
}


gint _vala_main (gchar** args, int args_length1) {
	gint result = 0;
	GTestSuite* _tmp0_ = NULL;
	GTestSuite* root;
	RoleDetailsInterfaceTests* _tmp1_;
	RoleDetailsInterfaceTests* _tmp2_;
	GTestSuite* _tmp3_ = NULL;
#line 138 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	g_test_init (&args_length1, &args, NULL);
#line 140 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_tmp0_ = g_test_get_root ();
#line 140 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	root = _tmp0_;
#line 141 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_tmp1_ = role_details_interface_tests_new ();
#line 141 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_tmp2_ = _tmp1_;
#line 141 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_tmp3_ = folks_test_case_get_suite ((FolksTestCase*) _tmp2_);
#line 141 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	g_test_suite_add_suite (root, _tmp3_);
#line 141 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	_g_object_unref0 (_tmp2_);
#line 143 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	g_test_run ();
#line 145 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	result = 0;
#line 145 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	return result;
#line 784 "role-details-interface.c"
}


int main (int argc, char ** argv) {
#line 136 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	g_type_init ();
#line 136 "/home/treitter/collabora/folks/tests/tracker/role-details-interface.vala"
	return _vala_main (argv, argc);
#line 793 "role-details-interface.c"
}



