/* imaddresses-updates.c generated by valac 0.26.0.36-540e, the Vala compiler
 * generated from imaddresses-updates.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 <tracker-test.h>
#include <folks/folks.h>
#include <stdlib.h>
#include <string.h>
#include <folks-test.h>
#include <gee.h>
#include <folks/folks-tracker.h>
#include <gio/gio.h>


#define TYPE_IM_ADDRESSES_UPDATES_TESTS (im_addresses_updates_tests_get_type ())
#define IM_ADDRESSES_UPDATES_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_IM_ADDRESSES_UPDATES_TESTS, IMAddressesUpdatesTests))
#define IM_ADDRESSES_UPDATES_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_IM_ADDRESSES_UPDATES_TESTS, IMAddressesUpdatesTestsClass))
#define IS_IM_ADDRESSES_UPDATES_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_IM_ADDRESSES_UPDATES_TESTS))
#define IS_IM_ADDRESSES_UPDATES_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_IM_ADDRESSES_UPDATES_TESTS))
#define IM_ADDRESSES_UPDATES_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_IM_ADDRESSES_UPDATES_TESTS, IMAddressesUpdatesTestsClass))

typedef struct _IMAddressesUpdatesTests IMAddressesUpdatesTests;
typedef struct _IMAddressesUpdatesTestsClass IMAddressesUpdatesTestsClass;
typedef struct _IMAddressesUpdatesTestsPrivate IMAddressesUpdatesTestsPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_main_loop_unref0(var) ((var == NULL) ? NULL : (var = (g_main_loop_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 _ImAddressesUpdatesTestsTestImaddressesUpdatesAsyncData ImAddressesUpdatesTestsTestImaddressesUpdatesAsyncData;
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _IMAddressesUpdatesTests {
	TrackerTestTestCase parent_instance;
	IMAddressesUpdatesTestsPrivate * priv;
};

struct _IMAddressesUpdatesTestsClass {
	TrackerTestTestCaseClass parent_class;
};

struct _IMAddressesUpdatesTestsPrivate {
	FolksIndividualAggregator* _aggregator;
	GMainLoop* _main_loop;
	gchar* _initial_fullname_1;
	gchar* _contact_urn_1;
	gchar* _imaddress_proto_1;
	gchar* _imaddress_1;
	gchar* _imaddress_2;
	gchar* _proto_2;
	gchar* _individual_id;
	gboolean _initial_imaddress_found;
	gboolean _updated_imaddr_found;
};

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


static gpointer im_addresses_updates_tests_parent_class = NULL;

GType im_addresses_updates_tests_get_type (void) G_GNUC_CONST;
#define IM_ADDRESSES_UPDATES_TESTS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_IM_ADDRESSES_UPDATES_TESTS, IMAddressesUpdatesTestsPrivate))
enum  {
	IM_ADDRESSES_UPDATES_TESTS_DUMMY_PROPERTY
};
IMAddressesUpdatesTests* im_addresses_updates_tests_new (void);
IMAddressesUpdatesTests* im_addresses_updates_tests_construct (GType object_type);
void im_addresses_updates_tests_test_imaddresses_updates (IMAddressesUpdatesTests* self);
static void _im_addresses_updates_tests_test_imaddresses_updates_folks_test_case_test_method (gpointer self);
static void _im_addresses_updates_tests_test_imaddresses_updates_async (IMAddressesUpdatesTests* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _im_addresses_updates_tests_test_imaddresses_updates_finish (IMAddressesUpdatesTests* self, GAsyncResult* _res_);
static void _im_addresses_updates_tests_test_imaddresses_updates_async_data_free (gpointer _data);
static gboolean _im_addresses_updates_tests_test_imaddresses_updates_async_co (ImAddressesUpdatesTestsTestImaddressesUpdatesAsyncData* _data_);
static void _im_addresses_updates_tests_test_imaddresses_updates_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _im_addresses_updates_tests_individuals_changed_cb (IMAddressesUpdatesTests* self, GeeMultiMap* changes);
static void __im_addresses_updates_tests_individuals_changed_cb_folks_individual_aggregator_individuals_changed_detailed (FolksIndividualAggregator* _sender, GeeMultiMap* changes, gpointer self);
static void _im_addresses_updates_tests_do_im_addr_update (IMAddressesUpdatesTests* self);
static void im_addresses_updates_tests_finalize (GObject* obj);
gint _vala_main (gchar** args, int args_length1);


static void _im_addresses_updates_tests_test_imaddresses_updates_folks_test_case_test_method (gpointer self) {
#line 44 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	im_addresses_updates_tests_test_imaddresses_updates ((IMAddressesUpdatesTests*) self);
#line 121 "imaddresses-updates.c"
}


IMAddressesUpdatesTests* im_addresses_updates_tests_construct (GType object_type) {
	IMAddressesUpdatesTests * self = NULL;
#line 42 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	self = (IMAddressesUpdatesTests*) tracker_test_test_case_construct (object_type, "IMAddressesUpdates");
#line 44 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	folks_test_case_add_test ((FolksTestCase*) self, "im addresses updates", _im_addresses_updates_tests_test_imaddresses_updates_folks_test_case_test_method, self);
#line 40 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	return self;
#line 133 "imaddresses-updates.c"
}


IMAddressesUpdatesTests* im_addresses_updates_tests_new (void) {
#line 40 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	return im_addresses_updates_tests_construct (TYPE_IM_ADDRESSES_UPDATES_TESTS);
#line 140 "imaddresses-updates.c"
}


void im_addresses_updates_tests_test_imaddresses_updates (IMAddressesUpdatesTests* self) {
	GMainLoop* _tmp0_ = NULL;
	GeeHashMap* c1 = NULL;
	GeeHashMap* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	gchar* _tmp6_ = NULL;
	gchar* _tmp7_ = NULL;
	const gchar* _tmp8_ = NULL;
	const gchar* _tmp9_ = NULL;
	const gchar* _tmp10_ = NULL;
	TrackerTestBackend* _tmp11_ = NULL;
	TrackerTestBackend* _tmp12_ = NULL;
	gchar* _tmp13_ = NULL;
	GMainLoop* _tmp14_ = NULL;
	gboolean _tmp15_ = FALSE;
	gboolean _tmp16_ = FALSE;
#line 47 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	g_return_if_fail (self != NULL);
#line 49 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp0_ = g_main_loop_new (NULL, FALSE);
#line 49 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_g_main_loop_unref0 (self->priv->_main_loop);
#line 49 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	self->priv->_main_loop = _tmp0_;
#line 50 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.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, NULL, NULL, NULL, NULL, NULL, NULL);
#line 50 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	c1 = _tmp1_;
#line 51 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp2_ = g_strdup ("persona #1");
#line 51 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_g_free0 (self->priv->_initial_fullname_1);
#line 51 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	self->priv->_initial_fullname_1 = _tmp2_;
#line 52 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp3_ = g_strdup ("<urn:contact001>");
#line 52 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_g_free0 (self->priv->_contact_urn_1);
#line 52 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	self->priv->_contact_urn_1 = _tmp3_;
#line 53 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp4_ = g_strdup ("jabber#test1@example.org");
#line 53 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_g_free0 (self->priv->_imaddress_proto_1);
#line 53 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	self->priv->_imaddress_proto_1 = _tmp4_;
#line 54 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp5_ = g_strdup ("test1@example.org");
#line 54 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_g_free0 (self->priv->_imaddress_1);
#line 54 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	self->priv->_imaddress_1 = _tmp5_;
#line 55 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp6_ = g_strdup ("test2@example.org");
#line 55 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_g_free0 (self->priv->_imaddress_2);
#line 55 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	self->priv->_imaddress_2 = _tmp6_;
#line 56 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp7_ = g_strdup ("aim");
#line 56 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_g_free0 (self->priv->_proto_2);
#line 56 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	self->priv->_proto_2 = _tmp7_;
#line 58 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp8_ = self->priv->_contact_urn_1;
#line 58 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	gee_abstract_map_set ((GeeAbstractMap*) c1, TRACKER_TEST_BACKEND_URN, _tmp8_);
#line 59 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp9_ = self->priv->_initial_fullname_1;
#line 59 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	gee_abstract_map_set ((GeeAbstractMap*) c1, TRF_ONTOLOGY_DEFS_NCO_FULLNAME, _tmp9_);
#line 60 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp10_ = self->priv->_imaddress_proto_1;
#line 60 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	gee_abstract_map_set ((GeeAbstractMap*) c1, TRF_ONTOLOGY_DEFS_NCO_IMADDRESS, _tmp10_);
#line 61 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp11_ = ((TrackerTestTestCase*) self)->tracker_backend;
#line 61 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	tracker_test_backend_add_contact (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, TRACKER_TEST_TYPE_BACKEND, TrackerTestBackend), c1);
#line 62 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp12_ = ((TrackerTestTestCase*) self)->tracker_backend;
#line 62 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	tracker_test_backend_set_up (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, TRACKER_TEST_TYPE_BACKEND, TrackerTestBackend));
#line 64 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp13_ = g_strdup ("");
#line 64 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_g_free0 (self->priv->_individual_id);
#line 64 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	self->priv->_individual_id = _tmp13_;
#line 65 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	self->priv->_initial_imaddress_found = FALSE;
#line 66 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	self->priv->_updated_imaddr_found = FALSE;
#line 68 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_im_addresses_updates_tests_test_imaddresses_updates_async (self, NULL, NULL);
#line 70 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp14_ = self->priv->_main_loop;
#line 70 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	folks_test_utils_loop_run_with_timeout (_tmp14_, 5);
#line 72 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp15_ = self->priv->_initial_imaddress_found;
#line 72 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_vala_assert (_tmp15_ == TRUE, "this._initial_imaddress_found == true");
#line 73 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp16_ = self->priv->_updated_imaddr_found;
#line 73 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_vala_assert (_tmp16_ == TRUE, "this._updated_imaddr_found == true");
#line 47 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_g_object_unref0 (c1);
#line 257 "imaddresses-updates.c"
}


static void _im_addresses_updates_tests_test_imaddresses_updates_async_data_free (gpointer _data) {
	ImAddressesUpdatesTestsTestImaddressesUpdatesAsyncData* _data_;
	_data_ = _data;
#line 26 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_g_object_unref0 (_data_->self);
#line 26 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	g_slice_free (ImAddressesUpdatesTestsTestImaddressesUpdatesAsyncData, _data_);
#line 268 "imaddresses-updates.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 26 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	return self ? g_object_ref (self) : NULL;
#line 275 "imaddresses-updates.c"
}


static void _im_addresses_updates_tests_test_imaddresses_updates_async (IMAddressesUpdatesTests* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	ImAddressesUpdatesTestsTestImaddressesUpdatesAsyncData* _data_;
	IMAddressesUpdatesTests* _tmp0_ = NULL;
#line 26 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_data_ = g_slice_new0 (ImAddressesUpdatesTestsTestImaddressesUpdatesAsyncData);
#line 26 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _im_addresses_updates_tests_test_imaddresses_updates_async);
#line 26 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _im_addresses_updates_tests_test_imaddresses_updates_async_data_free);
#line 26 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 26 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_data_->self = _tmp0_;
#line 26 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_im_addresses_updates_tests_test_imaddresses_updates_async_co (_data_);
#line 294 "imaddresses-updates.c"
}


static void _im_addresses_updates_tests_test_imaddresses_updates_finish (IMAddressesUpdatesTests* self, GAsyncResult* _res_) {
	ImAddressesUpdatesTestsTestImaddressesUpdatesAsyncData* _data_;
#line 26 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 302 "imaddresses-updates.c"
}


static void _im_addresses_updates_tests_test_imaddresses_updates_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	ImAddressesUpdatesTestsTestImaddressesUpdatesAsyncData* _data_;
#line 79 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_data_ = _user_data_;
#line 79 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_data_->_source_object_ = source_object;
#line 79 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_data_->_res_ = _res_;
#line 79 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_im_addresses_updates_tests_test_imaddresses_updates_async_co (_data_);
#line 316 "imaddresses-updates.c"
}


static void __im_addresses_updates_tests_individuals_changed_cb_folks_individual_aggregator_individuals_changed_detailed (FolksIndividualAggregator* _sender, GeeMultiMap* changes, gpointer self) {
#line 81 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_im_addresses_updates_tests_individuals_changed_cb ((IMAddressesUpdatesTests*) self, changes);
#line 323 "imaddresses-updates.c"
}


static gboolean _im_addresses_updates_tests_test_imaddresses_updates_async_co (ImAddressesUpdatesTestsTestImaddressesUpdatesAsyncData* _data_) {
#line 76 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	switch (_data_->_state_) {
#line 76 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
		case 0:
#line 332 "imaddresses-updates.c"
		goto _state_0;
#line 76 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
		case 1:
#line 336 "imaddresses-updates.c"
		goto _state_1;
#line 76 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
		case 2:
#line 340 "imaddresses-updates.c"
		goto _state_2;
		default:
#line 76 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
		g_assert_not_reached ();
#line 345 "imaddresses-updates.c"
	}
	_state_0:
#line 78 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_data_->_tmp0_ = NULL;
#line 78 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_data_->_tmp0_ = folks_backend_store_dup ();
#line 78 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_data_->store = _data_->_tmp0_;
#line 79 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_data_->_state_ = 1;
#line 79 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	folks_backend_store_prepare (_data_->store, _im_addresses_updates_tests_test_imaddresses_updates_async_ready, _data_);
#line 79 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	return FALSE;
#line 360 "imaddresses-updates.c"
	_state_1:
#line 79 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	folks_backend_store_prepare_finish (_data_->store, _data_->_res_);
#line 80 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_data_->_tmp1_ = NULL;
#line 80 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_data_->_tmp1_ = folks_individual_aggregator_dup ();
#line 80 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_g_object_unref0 (_data_->self->priv->_aggregator);
#line 80 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_data_->self->priv->_aggregator = _data_->_tmp1_;
#line 81 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_data_->_tmp2_ = NULL;
#line 81 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_data_->_tmp2_ = _data_->self->priv->_aggregator;
#line 81 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	g_signal_connect_object (_data_->_tmp2_, "individuals-changed-detailed", (GCallback) __im_addresses_updates_tests_individuals_changed_cb_folks_individual_aggregator_individuals_changed_detailed, _data_->self, 0);
#line 378 "imaddresses-updates.c"
	{
#line 85 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
		_data_->_tmp3_ = NULL;
#line 85 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
		_data_->_tmp3_ = _data_->self->priv->_aggregator;
#line 85 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
		_data_->_state_ = 2;
#line 85 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
		folks_individual_aggregator_prepare (_data_->_tmp3_, _im_addresses_updates_tests_test_imaddresses_updates_async_ready, _data_);
#line 85 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
		return FALSE;
#line 390 "imaddresses-updates.c"
		_state_2:
#line 85 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
		folks_individual_aggregator_prepare_finish (_data_->_tmp3_, _data_->_res_, &_data_->_inner_error_);
#line 85 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 396 "imaddresses-updates.c"
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
#line 83 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
		_data_->e = _data_->_inner_error_;
#line 83 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
		_data_->_inner_error_ = NULL;
#line 89 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
		_data_->_tmp4_ = NULL;
#line 89 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
		_data_->_tmp4_ = _data_->e;
#line 89 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
		_data_->_tmp5_ = NULL;
#line 89 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
		_data_->_tmp5_ = _data_->_tmp4_->message;
#line 89 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
		g_warning ("imaddresses-updates.vala:89: Error when calling prepare: %s\n", _data_->_tmp5_);
#line 83 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
		_g_error_free0 (_data_->e);
#line 419 "imaddresses-updates.c"
	}
	__finally0:
#line 83 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 83 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
		_g_object_unref0 (_data_->store);
#line 83 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.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 83 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
		g_clear_error (&_data_->_inner_error_);
#line 83 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
		return FALSE;
#line 432 "imaddresses-updates.c"
	}
#line 76 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_g_object_unref0 (_data_->store);
#line 76 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	if (_data_->_state_ == 0) {
#line 76 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 440 "imaddresses-updates.c"
	} else {
#line 76 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 444 "imaddresses-updates.c"
	}
#line 76 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	g_object_unref (_data_->_async_result);
#line 76 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	return FALSE;
#line 450 "imaddresses-updates.c"
}


static void _im_addresses_updates_tests_individuals_changed_cb (IMAddressesUpdatesTests* self, GeeMultiMap* changes) {
	GeeCollection* added = NULL;
	GeeMultiMap* _tmp0_ = NULL;
	GeeCollection* _tmp1_ = NULL;
#line 93 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	g_return_if_fail (self != NULL);
#line 93 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	g_return_if_fail (changes != NULL);
#line 96 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp0_ = changes;
#line 96 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp1_ = gee_multi_map_get_values (_tmp0_);
#line 96 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	added = _tmp1_;
#line 468 "imaddresses-updates.c"
	{
		GeeIterator* _i_it = NULL;
		GeeCollection* _tmp2_ = NULL;
		GeeIterator* _tmp3_ = NULL;
#line 98 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
		_tmp2_ = added;
#line 98 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
		_tmp3_ = gee_iterable_iterator ((GeeIterable*) _tmp2_);
#line 98 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
		_i_it = _tmp3_;
#line 98 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
		while (TRUE) {
#line 481 "imaddresses-updates.c"
			GeeIterator* _tmp4_ = NULL;
			gboolean _tmp5_ = FALSE;
			FolksIndividual* i = NULL;
			GeeIterator* _tmp6_ = NULL;
			gpointer _tmp7_ = NULL;
			FolksIndividual* _tmp8_ = NULL;
			FolksIndividual* _tmp9_ = NULL;
			const gchar* _tmp10_ = NULL;
			const gchar* _tmp11_ = NULL;
			const gchar* _tmp12_ = NULL;
			gboolean _tmp13_ = FALSE;
#line 98 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
			_tmp4_ = _i_it;
#line 98 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
			_tmp5_ = gee_iterator_next (_tmp4_);
#line 98 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
			if (!_tmp5_) {
#line 98 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
				break;
#line 501 "imaddresses-updates.c"
			}
#line 98 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
			_tmp6_ = _i_it;
#line 98 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
			_tmp7_ = gee_iterator_get (_tmp6_);
#line 98 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
			i = (FolksIndividual*) _tmp7_;
#line 100 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
			_tmp8_ = i;
#line 100 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
			_vala_assert (_tmp8_ != NULL, "i != null");
#line 102 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
			_tmp9_ = i;
#line 102 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
			_tmp10_ = folks_name_details_get_full_name ((FolksNameDetails*) _tmp9_);
#line 102 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
			_tmp11_ = _tmp10_;
#line 102 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
			_tmp12_ = self->priv->_initial_fullname_1;
#line 102 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
			if (g_strcmp0 (_tmp11_, _tmp12_) != 0) {
#line 103 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
				_g_object_unref0 (i);
#line 103 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
				continue;
#line 527 "imaddresses-updates.c"
			}
#line 105 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
			_tmp13_ = self->priv->_initial_imaddress_found;
#line 105 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
			if (!_tmp13_) {
#line 533 "imaddresses-updates.c"
				FolksIndividual* _tmp14_ = NULL;
				const gchar* _tmp15_ = NULL;
				const gchar* _tmp16_ = NULL;
				gchar* _tmp17_ = NULL;
#line 107 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
				_tmp14_ = i;
#line 107 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
				_tmp15_ = folks_individual_get_id (_tmp14_);
#line 107 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
				_tmp16_ = _tmp15_;
#line 107 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
				_tmp17_ = g_strdup (_tmp16_);
#line 107 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
				_g_free0 (self->priv->_individual_id);
#line 107 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
				self->priv->_individual_id = _tmp17_;
#line 550 "imaddresses-updates.c"
				{
					GeeIterator* _proto_it = NULL;
					FolksIndividual* _tmp18_ = NULL;
					GeeMultiMap* _tmp19_ = NULL;
					GeeMultiMap* _tmp20_ = NULL;
					GeeSet* _tmp21_ = NULL;
					GeeSet* _tmp22_ = NULL;
					GeeIterator* _tmp23_ = NULL;
					GeeIterator* _tmp24_ = NULL;
#line 109 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
					_tmp18_ = i;
#line 109 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
					_tmp19_ = folks_im_details_get_im_addresses ((FolksImDetails*) _tmp18_);
#line 109 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
					_tmp20_ = _tmp19_;
#line 109 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
					_tmp21_ = gee_multi_map_get_keys (_tmp20_);
#line 109 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
					_tmp22_ = _tmp21_;
#line 109 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
					_tmp23_ = gee_iterable_iterator ((GeeIterable*) _tmp22_);
#line 109 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
					_tmp24_ = _tmp23_;
#line 109 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
					_g_object_unref0 (_tmp22_);
#line 109 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
					_proto_it = _tmp24_;
#line 109 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
					while (TRUE) {
#line 580 "imaddresses-updates.c"
						GeeIterator* _tmp25_ = NULL;
						gboolean _tmp26_ = FALSE;
						gchar* proto = NULL;
						GeeIterator* _tmp27_ = NULL;
						gpointer _tmp28_ = NULL;
						GeeCollection* addrs = NULL;
						FolksIndividual* _tmp29_ = NULL;
						GeeMultiMap* _tmp30_ = NULL;
						GeeMultiMap* _tmp31_ = NULL;
						const gchar* _tmp32_ = NULL;
						GeeCollection* _tmp33_ = NULL;
						gboolean contains_addr_1 = FALSE;
						gboolean _tmp44_ = FALSE;
						GeeCollection* _tmp45_ = NULL;
						gint _tmp46_ = 0;
						gint _tmp47_ = 0;
#line 109 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						_tmp25_ = _proto_it;
#line 109 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						_tmp26_ = gee_iterator_next (_tmp25_);
#line 109 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						if (!_tmp26_) {
#line 109 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
							break;
#line 605 "imaddresses-updates.c"
						}
#line 109 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						_tmp27_ = _proto_it;
#line 109 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						_tmp28_ = gee_iterator_get (_tmp27_);
#line 109 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						proto = (gchar*) _tmp28_;
#line 111 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						_tmp29_ = i;
#line 111 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						_tmp30_ = folks_im_details_get_im_addresses ((FolksImDetails*) _tmp29_);
#line 111 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						_tmp31_ = _tmp30_;
#line 111 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						_tmp32_ = proto;
#line 111 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						_tmp33_ = gee_multi_map_get (_tmp31_, _tmp32_);
#line 111 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						addrs = _tmp33_;
#line 112 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						contains_addr_1 = FALSE;
#line 627 "imaddresses-updates.c"
						{
							GeeIterator* _im_fd_it = NULL;
							GeeCollection* _tmp34_ = NULL;
							GeeIterator* _tmp35_ = NULL;
#line 113 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
							_tmp34_ = addrs;
#line 113 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
							_tmp35_ = gee_iterable_iterator ((GeeIterable*) _tmp34_);
#line 113 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
							_im_fd_it = _tmp35_;
#line 113 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
							while (TRUE) {
#line 640 "imaddresses-updates.c"
								GeeIterator* _tmp36_ = NULL;
								gboolean _tmp37_ = FALSE;
								FolksImFieldDetails* im_fd = NULL;
								GeeIterator* _tmp38_ = NULL;
								gpointer _tmp39_ = NULL;
								FolksImFieldDetails* _tmp40_ = NULL;
								gconstpointer _tmp41_ = NULL;
								const gchar* _tmp42_ = NULL;
								const gchar* _tmp43_ = NULL;
#line 113 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
								_tmp36_ = _im_fd_it;
#line 113 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
								_tmp37_ = gee_iterator_next (_tmp36_);
#line 113 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
								if (!_tmp37_) {
#line 113 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
									break;
#line 658 "imaddresses-updates.c"
								}
#line 113 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
								_tmp38_ = _im_fd_it;
#line 113 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
								_tmp39_ = gee_iterator_get (_tmp38_);
#line 113 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
								im_fd = (FolksImFieldDetails*) _tmp39_;
#line 115 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
								_tmp40_ = im_fd;
#line 115 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
								_tmp41_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp40_);
#line 115 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
								_tmp42_ = _tmp41_;
#line 115 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
								_tmp43_ = self->priv->_imaddress_1;
#line 115 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
								if (g_strcmp0 ((const gchar*) _tmp42_, _tmp43_) == 0) {
#line 117 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
									contains_addr_1 = TRUE;
#line 118 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
									_g_object_unref0 (im_fd);
#line 118 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
									break;
#line 682 "imaddresses-updates.c"
								}
#line 113 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
								_g_object_unref0 (im_fd);
#line 686 "imaddresses-updates.c"
							}
#line 113 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
							_g_object_unref0 (_im_fd_it);
#line 690 "imaddresses-updates.c"
						}
#line 122 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						_tmp45_ = addrs;
#line 122 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						_tmp46_ = gee_collection_get_size (_tmp45_);
#line 122 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						_tmp47_ = _tmp46_;
#line 122 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						if (_tmp47_ == 1) {
#line 700 "imaddresses-updates.c"
							gboolean _tmp48_ = FALSE;
#line 122 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
							_tmp48_ = contains_addr_1;
#line 122 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
							_tmp44_ = _tmp48_;
#line 706 "imaddresses-updates.c"
						} else {
#line 122 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
							_tmp44_ = FALSE;
#line 710 "imaddresses-updates.c"
						}
#line 122 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						if (_tmp44_) {
#line 124 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
							self->priv->_initial_imaddress_found = TRUE;
#line 125 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
							_im_addresses_updates_tests_do_im_addr_update (self);
#line 718 "imaddresses-updates.c"
						}
#line 109 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						_g_object_unref0 (addrs);
#line 109 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						_g_free0 (proto);
#line 724 "imaddresses-updates.c"
					}
#line 109 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
					_g_object_unref0 (_proto_it);
#line 728 "imaddresses-updates.c"
				}
			} else {
				{
					GeeIterator* _proto_it = NULL;
					FolksIndividual* _tmp49_ = NULL;
					GeeMultiMap* _tmp50_ = NULL;
					GeeMultiMap* _tmp51_ = NULL;
					GeeSet* _tmp52_ = NULL;
					GeeSet* _tmp53_ = NULL;
					GeeIterator* _tmp54_ = NULL;
					GeeIterator* _tmp55_ = NULL;
#line 131 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
					_tmp49_ = i;
#line 131 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
					_tmp50_ = folks_im_details_get_im_addresses ((FolksImDetails*) _tmp49_);
#line 131 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
					_tmp51_ = _tmp50_;
#line 131 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
					_tmp52_ = gee_multi_map_get_keys (_tmp51_);
#line 131 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
					_tmp53_ = _tmp52_;
#line 131 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
					_tmp54_ = gee_iterable_iterator ((GeeIterable*) _tmp53_);
#line 131 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
					_tmp55_ = _tmp54_;
#line 131 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
					_g_object_unref0 (_tmp53_);
#line 131 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
					_proto_it = _tmp55_;
#line 131 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
					while (TRUE) {
#line 760 "imaddresses-updates.c"
						GeeIterator* _tmp56_ = NULL;
						gboolean _tmp57_ = FALSE;
						gchar* proto = NULL;
						GeeIterator* _tmp58_ = NULL;
						gpointer _tmp59_ = NULL;
						GeeCollection* addrs = NULL;
						FolksIndividual* _tmp60_ = NULL;
						GeeMultiMap* _tmp61_ = NULL;
						GeeMultiMap* _tmp62_ = NULL;
						const gchar* _tmp63_ = NULL;
						GeeCollection* _tmp64_ = NULL;
						gboolean contains_addr_2 = FALSE;
						gboolean _tmp75_ = FALSE;
						GeeCollection* _tmp76_ = NULL;
						gint _tmp77_ = 0;
						gint _tmp78_ = 0;
#line 131 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						_tmp56_ = _proto_it;
#line 131 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						_tmp57_ = gee_iterator_next (_tmp56_);
#line 131 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						if (!_tmp57_) {
#line 131 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
							break;
#line 785 "imaddresses-updates.c"
						}
#line 131 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						_tmp58_ = _proto_it;
#line 131 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						_tmp59_ = gee_iterator_get (_tmp58_);
#line 131 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						proto = (gchar*) _tmp59_;
#line 133 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						_tmp60_ = i;
#line 133 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						_tmp61_ = folks_im_details_get_im_addresses ((FolksImDetails*) _tmp60_);
#line 133 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						_tmp62_ = _tmp61_;
#line 133 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						_tmp63_ = proto;
#line 133 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						_tmp64_ = gee_multi_map_get (_tmp62_, _tmp63_);
#line 133 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						addrs = _tmp64_;
#line 134 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						contains_addr_2 = FALSE;
#line 807 "imaddresses-updates.c"
						{
							GeeIterator* _im_fd_it = NULL;
							GeeCollection* _tmp65_ = NULL;
							GeeIterator* _tmp66_ = NULL;
#line 135 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
							_tmp65_ = addrs;
#line 135 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
							_tmp66_ = gee_iterable_iterator ((GeeIterable*) _tmp65_);
#line 135 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
							_im_fd_it = _tmp66_;
#line 135 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
							while (TRUE) {
#line 820 "imaddresses-updates.c"
								GeeIterator* _tmp67_ = NULL;
								gboolean _tmp68_ = FALSE;
								FolksImFieldDetails* im_fd = NULL;
								GeeIterator* _tmp69_ = NULL;
								gpointer _tmp70_ = NULL;
								FolksImFieldDetails* _tmp71_ = NULL;
								gconstpointer _tmp72_ = NULL;
								const gchar* _tmp73_ = NULL;
								const gchar* _tmp74_ = NULL;
#line 135 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
								_tmp67_ = _im_fd_it;
#line 135 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
								_tmp68_ = gee_iterator_next (_tmp67_);
#line 135 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
								if (!_tmp68_) {
#line 135 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
									break;
#line 838 "imaddresses-updates.c"
								}
#line 135 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
								_tmp69_ = _im_fd_it;
#line 135 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
								_tmp70_ = gee_iterator_get (_tmp69_);
#line 135 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
								im_fd = (FolksImFieldDetails*) _tmp70_;
#line 137 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
								_tmp71_ = im_fd;
#line 137 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
								_tmp72_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp71_);
#line 137 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
								_tmp73_ = _tmp72_;
#line 137 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
								_tmp74_ = self->priv->_imaddress_2;
#line 137 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
								if (g_strcmp0 ((const gchar*) _tmp73_, _tmp74_) == 0) {
#line 139 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
									contains_addr_2 = TRUE;
#line 140 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
									_g_object_unref0 (im_fd);
#line 140 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
									break;
#line 862 "imaddresses-updates.c"
								}
#line 135 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
								_g_object_unref0 (im_fd);
#line 866 "imaddresses-updates.c"
							}
#line 135 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
							_g_object_unref0 (_im_fd_it);
#line 870 "imaddresses-updates.c"
						}
#line 144 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						_tmp76_ = addrs;
#line 144 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						_tmp77_ = gee_collection_get_size (_tmp76_);
#line 144 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						_tmp78_ = _tmp77_;
#line 144 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						if (_tmp78_ == 1) {
#line 880 "imaddresses-updates.c"
							gboolean _tmp79_ = FALSE;
#line 144 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
							_tmp79_ = contains_addr_2;
#line 144 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
							_tmp75_ = _tmp79_;
#line 886 "imaddresses-updates.c"
						} else {
#line 144 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
							_tmp75_ = FALSE;
#line 890 "imaddresses-updates.c"
						}
#line 144 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						if (_tmp75_) {
#line 894 "imaddresses-updates.c"
							GMainLoop* _tmp80_ = NULL;
#line 146 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
							self->priv->_updated_imaddr_found = TRUE;
#line 147 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
							_tmp80_ = self->priv->_main_loop;
#line 147 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
							g_main_loop_quit (_tmp80_);
#line 902 "imaddresses-updates.c"
						}
#line 131 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						_g_object_unref0 (addrs);
#line 131 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
						_g_free0 (proto);
#line 908 "imaddresses-updates.c"
					}
#line 131 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
					_g_object_unref0 (_proto_it);
#line 912 "imaddresses-updates.c"
				}
			}
#line 98 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
			_g_object_unref0 (i);
#line 917 "imaddresses-updates.c"
		}
#line 98 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
		_g_object_unref0 (_i_it);
#line 921 "imaddresses-updates.c"
	}
#line 93 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_g_object_unref0 (added);
#line 925 "imaddresses-updates.c"
}


static void _im_addresses_updates_tests_do_im_addr_update (IMAddressesUpdatesTests* self) {
	gchar* urn_affil_1 = NULL;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	TrackerTestBackend* _tmp5_ = NULL;
	const gchar* _tmp6_ = NULL;
	gchar* urn_imaddr_2 = NULL;
	const gchar* _tmp7_ = NULL;
	gchar* _tmp8_ = NULL;
	gchar* _tmp9_ = NULL;
	gchar* _tmp10_ = NULL;
	gchar* _tmp11_ = NULL;
	TrackerTestBackend* _tmp12_ = NULL;
	const gchar* _tmp13_ = NULL;
	const gchar* _tmp14_ = NULL;
	gchar* urn_affil_2 = NULL;
	const gchar* _tmp15_ = NULL;
	gchar* _tmp16_ = NULL;
	const gchar* _tmp17_ = NULL;
	gchar* _tmp18_ = NULL;
	TrackerTestBackend* _tmp19_ = NULL;
	const gchar* _tmp20_ = NULL;
	TrackerTestBackend* _tmp21_ = NULL;
	const gchar* _tmp22_ = NULL;
	TrackerTestBackend* _tmp23_ = NULL;
	const gchar* _tmp24_ = NULL;
	const gchar* _tmp25_ = NULL;
#line 154 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	g_return_if_fail (self != NULL);
#line 156 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp0_ = self->priv->_imaddress_1;
#line 156 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp1_ = g_strconcat ("<", _tmp0_, NULL);
#line 156 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp2_ = _tmp1_;
#line 156 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp3_ = g_strconcat (_tmp2_, "myaffiliation>", NULL);
#line 156 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp4_ = _tmp3_;
#line 156 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_g_free0 (_tmp2_);
#line 156 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	urn_affil_1 = _tmp4_;
#line 157 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp5_ = ((TrackerTestTestCase*) self)->tracker_backend;
#line 157 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp6_ = self->priv->_contact_urn_1;
#line 157 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	tracker_test_backend_remove_triplet (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, TRACKER_TEST_TYPE_BACKEND, TrackerTestBackend), _tmp6_, TRF_ONTOLOGY_DEFS_NCO_HAS_AFFILIATION, urn_affil_1);
#line 160 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp7_ = self->priv->_imaddress_2;
#line 160 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp8_ = g_strconcat ("<", _tmp7_, NULL);
#line 160 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp9_ = _tmp8_;
#line 160 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp10_ = g_strconcat (_tmp9_, ">", NULL);
#line 160 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp11_ = _tmp10_;
#line 160 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_g_free0 (_tmp9_);
#line 160 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	urn_imaddr_2 = _tmp11_;
#line 161 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp12_ = ((TrackerTestTestCase*) self)->tracker_backend;
#line 161 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp13_ = self->priv->_proto_2;
#line 161 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp14_ = self->priv->_imaddress_2;
#line 161 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	tracker_test_backend_insert_triplet (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, TRACKER_TEST_TYPE_BACKEND, TrackerTestBackend), urn_imaddr_2, "a", TRF_ONTOLOGY_DEFS_NCO_IMADDRESS, TRF_ONTOLOGY_DEFS_NCO_IMPROTOCOL, _tmp13_, TRF_ONTOLOGY_DEFS_NCO_IMID, _tmp14_);
#line 167 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp15_ = self->priv->_imaddress_2;
#line 167 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp16_ = g_strconcat ("<", _tmp15_, NULL);
#line 167 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	urn_affil_2 = _tmp16_;
#line 168 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp17_ = urn_affil_2;
#line 168 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp18_ = g_strconcat (_tmp17_, "myaffiliation>", NULL);
#line 168 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_g_free0 (urn_affil_2);
#line 168 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	urn_affil_2 = _tmp18_;
#line 169 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp19_ = ((TrackerTestTestCase*) self)->tracker_backend;
#line 169 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp20_ = urn_affil_2;
#line 169 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	tracker_test_backend_insert_triplet (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, TRACKER_TEST_TYPE_BACKEND, TrackerTestBackend), _tmp20_, "a", TRF_ONTOLOGY_DEFS_NCO_AFFILIATION, NULL, NULL, NULL, NULL);
#line 173 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp21_ = ((TrackerTestTestCase*) self)->tracker_backend;
#line 173 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp22_ = urn_affil_2;
#line 173 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	tracker_test_backend_insert_triplet (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, TRACKER_TEST_TYPE_BACKEND, TrackerTestBackend), _tmp22_, TRF_ONTOLOGY_DEFS_NCO_HAS_IMADDRESS, urn_imaddr_2, NULL, NULL, NULL, NULL);
#line 177 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp23_ = ((TrackerTestTestCase*) self)->tracker_backend;
#line 177 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp24_ = self->priv->_contact_urn_1;
#line 177 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp25_ = urn_affil_2;
#line 177 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	tracker_test_backend_insert_triplet (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, TRACKER_TEST_TYPE_BACKEND, TrackerTestBackend), _tmp24_, TRF_ONTOLOGY_DEFS_NCO_HAS_AFFILIATION, _tmp25_, NULL, NULL, NULL, NULL);
#line 154 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_g_free0 (urn_affil_2);
#line 154 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_g_free0 (urn_imaddr_2);
#line 154 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_g_free0 (urn_affil_1);
#line 1043 "imaddresses-updates.c"
}


static void im_addresses_updates_tests_class_init (IMAddressesUpdatesTestsClass * klass) {
#line 26 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	im_addresses_updates_tests_parent_class = g_type_class_peek_parent (klass);
#line 26 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	g_type_class_add_private (klass, sizeof (IMAddressesUpdatesTestsPrivate));
#line 26 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	G_OBJECT_CLASS (klass)->finalize = im_addresses_updates_tests_finalize;
#line 1054 "imaddresses-updates.c"
}


static void im_addresses_updates_tests_instance_init (IMAddressesUpdatesTests * self) {
#line 26 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	self->priv = IM_ADDRESSES_UPDATES_TESTS_GET_PRIVATE (self);
#line 1061 "imaddresses-updates.c"
}


static void im_addresses_updates_tests_finalize (GObject* obj) {
	IMAddressesUpdatesTests * self;
#line 26 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_IM_ADDRESSES_UPDATES_TESTS, IMAddressesUpdatesTests);
#line 28 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_g_object_unref0 (self->priv->_aggregator);
#line 29 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_g_main_loop_unref0 (self->priv->_main_loop);
#line 30 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_g_free0 (self->priv->_initial_fullname_1);
#line 31 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_g_free0 (self->priv->_contact_urn_1);
#line 32 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_g_free0 (self->priv->_imaddress_proto_1);
#line 33 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_g_free0 (self->priv->_imaddress_1);
#line 34 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_g_free0 (self->priv->_imaddress_2);
#line 35 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_g_free0 (self->priv->_proto_2);
#line 36 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_g_free0 (self->priv->_individual_id);
#line 26 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	G_OBJECT_CLASS (im_addresses_updates_tests_parent_class)->finalize (obj);
#line 1089 "imaddresses-updates.c"
}


GType im_addresses_updates_tests_get_type (void) {
	static volatile gsize im_addresses_updates_tests_type_id__volatile = 0;
	if (g_once_init_enter (&im_addresses_updates_tests_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (IMAddressesUpdatesTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) im_addresses_updates_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (IMAddressesUpdatesTests), 0, (GInstanceInitFunc) im_addresses_updates_tests_instance_init, NULL };
		GType im_addresses_updates_tests_type_id;
		im_addresses_updates_tests_type_id = g_type_register_static (TRACKER_TEST_TYPE_TEST_CASE, "IMAddressesUpdatesTests", &g_define_type_info, 0);
		g_once_init_leave (&im_addresses_updates_tests_type_id__volatile, im_addresses_updates_tests_type_id);
	}
	return im_addresses_updates_tests_type_id__volatile;
}


gint _vala_main (gchar** args, int args_length1) {
	gint result = 0;
	IMAddressesUpdatesTests* tests = NULL;
	IMAddressesUpdatesTests* _tmp0_ = NULL;
#line 185 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	g_test_init (&args_length1, &args, NULL);
#line 187 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_tmp0_ = im_addresses_updates_tests_new ();
#line 187 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	tests = _tmp0_;
#line 188 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	folks_test_case_register ((FolksTestCase*) tests);
#line 189 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	g_test_run ();
#line 190 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	folks_test_case_final_tear_down ((FolksTestCase*) tests);
#line 192 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	result = 0;
#line 192 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	_g_object_unref0 (tests);
#line 192 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	return result;
#line 1127 "imaddresses-updates.c"
}


int main (int argc, char ** argv) {
#if !GLIB_CHECK_VERSION (2,35,0)
	g_type_init ();
#endif
#line 183 "/opt/gnome3/source/folks/tests/tracker/imaddresses-updates.vala"
	return _vala_main (argv, argc);
#line 1137 "imaddresses-updates.c"
}



