/* emails-updates.c generated by valac 0.26.2.1-1f25, the Vala compiler
 * generated from emails-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_EMAILS_UPDATES_TESTS (emails_updates_tests_get_type ())
#define EMAILS_UPDATES_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_EMAILS_UPDATES_TESTS, EmailsUpdatesTests))
#define EMAILS_UPDATES_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_EMAILS_UPDATES_TESTS, EmailsUpdatesTestsClass))
#define IS_EMAILS_UPDATES_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_EMAILS_UPDATES_TESTS))
#define IS_EMAILS_UPDATES_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_EMAILS_UPDATES_TESTS))
#define EMAILS_UPDATES_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_EMAILS_UPDATES_TESTS, EmailsUpdatesTestsClass))

typedef struct _EmailsUpdatesTests EmailsUpdatesTests;
typedef struct _EmailsUpdatesTestsClass EmailsUpdatesTestsClass;
typedef struct _EmailsUpdatesTestsPrivate EmailsUpdatesTestsPrivate;
#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 _EmailsUpdatesTestsTestEmailsUpdatesAsyncData EmailsUpdatesTestsTestEmailsUpdatesAsyncData;
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _EmailsUpdatesTests {
	TrackerTestTestCase parent_instance;
	EmailsUpdatesTestsPrivate * priv;
};

struct _EmailsUpdatesTestsClass {
	TrackerTestTestCaseClass parent_class;
};

struct _EmailsUpdatesTestsPrivate {
	FolksIndividualAggregator* _aggregator;
	GMainLoop* _main_loop;
	gchar* _individual_id;
	gboolean _initial_email_found;
	gchar* _initial_fullname_1;
	gboolean _updated_email_found;
	gchar* _email_1;
	gchar* _email_2;
	gchar* _contact_urn_1;
};

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


static gpointer emails_updates_tests_parent_class = NULL;

GType emails_updates_tests_get_type (void) G_GNUC_CONST;
#define EMAILS_UPDATES_TESTS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_EMAILS_UPDATES_TESTS, EmailsUpdatesTestsPrivate))
enum  {
	EMAILS_UPDATES_TESTS_DUMMY_PROPERTY
};
EmailsUpdatesTests* emails_updates_tests_new (void);
EmailsUpdatesTests* emails_updates_tests_construct (GType object_type);
void emails_updates_tests_test_emails_updates (EmailsUpdatesTests* self);
static void _emails_updates_tests_test_emails_updates_folks_test_case_test_method (gpointer self);
static void _emails_updates_tests_test_emails_updates_async (EmailsUpdatesTests* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _emails_updates_tests_test_emails_updates_finish (EmailsUpdatesTests* self, GAsyncResult* _res_);
static void _emails_updates_tests_test_emails_updates_async_data_free (gpointer _data);
static gboolean _emails_updates_tests_test_emails_updates_async_co (EmailsUpdatesTestsTestEmailsUpdatesAsyncData* _data_);
static void _emails_updates_tests_test_emails_updates_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _emails_updates_tests_individuals_changed_cb (EmailsUpdatesTests* self, GeeMultiMap* changes);
static void __emails_updates_tests_individuals_changed_cb_folks_individual_aggregator_individuals_changed_detailed (FolksIndividualAggregator* _sender, GeeMultiMap* changes, gpointer self);
static void _emails_updates_tests_notify_email_cb (EmailsUpdatesTests* self, GObject* individual_obj, GParamSpec* ps);
static void __emails_updates_tests_notify_email_cb_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void emails_updates_tests_finalize (GObject* obj);
gint _vala_main (gchar** args, int args_length1);


static void _emails_updates_tests_test_emails_updates_folks_test_case_test_method (gpointer self) {
#line 42 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	emails_updates_tests_test_emails_updates ((EmailsUpdatesTests*) self);
#line 120 "emails-updates.c"
}


EmailsUpdatesTests* emails_updates_tests_construct (GType object_type) {
	EmailsUpdatesTests * self = NULL;
#line 40 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	self = (EmailsUpdatesTests*) tracker_test_test_case_construct (object_type, "EmailsUpdates");
#line 42 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	folks_test_case_add_test ((FolksTestCase*) self, "emails updates", _emails_updates_tests_test_emails_updates_folks_test_case_test_method, g_object_ref (self), g_object_unref);
#line 38 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	return self;
#line 132 "emails-updates.c"
}


EmailsUpdatesTests* emails_updates_tests_new (void) {
#line 38 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	return emails_updates_tests_construct (TYPE_EMAILS_UPDATES_TESTS);
#line 139 "emails-updates.c"
}


void emails_updates_tests_test_emails_updates (EmailsUpdatesTests* self) {
	GMainLoop* _tmp0_ = NULL;
	GeeHashMap* c1 = NULL;
	GeeHashMap* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	GeeHashMap* _tmp6_ = NULL;
	const gchar* _tmp7_ = NULL;
	GeeHashMap* _tmp8_ = NULL;
	const gchar* _tmp9_ = NULL;
	GeeHashMap* _tmp10_ = NULL;
	const gchar* _tmp11_ = NULL;
	TrackerTestBackend* _tmp12_ = NULL;
	GeeHashMap* _tmp13_ = NULL;
	TrackerTestBackend* _tmp14_ = NULL;
	gchar* _tmp15_ = NULL;
	GMainLoop* _tmp16_ = NULL;
	gboolean _tmp17_ = FALSE;
	gboolean initial_email_found_again = FALSE;
	FolksIndividual* i = NULL;
	FolksIndividualAggregator* _tmp18_ = NULL;
	GeeMap* _tmp19_ = NULL;
	GeeMap* _tmp20_ = NULL;
	const gchar* _tmp21_ = NULL;
	gpointer _tmp22_ = NULL;
	FolksIndividual* _tmp23_ = NULL;
	gboolean _tmp38_ = FALSE;
	gboolean _tmp39_ = FALSE;
#line 45 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	g_return_if_fail (self != NULL);
#line 47 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp0_ = g_main_loop_new (NULL, FALSE);
#line 47 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_g_main_loop_unref0 (self->priv->_main_loop);
#line 47 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	self->priv->_main_loop = _tmp0_;
#line 48 "/opt/gnome3/source/folks/tests/tracker/emails-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 48 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	c1 = _tmp1_;
#line 49 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp2_ = g_strdup ("persona #1");
#line 49 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_g_free0 (self->priv->_initial_fullname_1);
#line 49 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	self->priv->_initial_fullname_1 = _tmp2_;
#line 50 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp3_ = g_strdup ("<urn:contact001>");
#line 50 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_g_free0 (self->priv->_contact_urn_1);
#line 50 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	self->priv->_contact_urn_1 = _tmp3_;
#line 51 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp4_ = g_strdup ("persona-addr-1@example.org");
#line 51 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_g_free0 (self->priv->_email_1);
#line 51 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	self->priv->_email_1 = _tmp4_;
#line 52 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp5_ = g_strdup ("persona-addr-2@example.org");
#line 52 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_g_free0 (self->priv->_email_2);
#line 52 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	self->priv->_email_2 = _tmp5_;
#line 54 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp6_ = c1;
#line 54 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp7_ = self->priv->_contact_urn_1;
#line 54 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	gee_abstract_map_set ((GeeAbstractMap*) _tmp6_, TRACKER_TEST_BACKEND_URN, _tmp7_);
#line 55 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp8_ = c1;
#line 55 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp9_ = self->priv->_initial_fullname_1;
#line 55 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	gee_abstract_map_set ((GeeAbstractMap*) _tmp8_, TRF_ONTOLOGY_DEFS_NCO_FULLNAME, _tmp9_);
#line 56 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp10_ = c1;
#line 56 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp11_ = self->priv->_email_1;
#line 56 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	gee_abstract_map_set ((GeeAbstractMap*) _tmp10_, TRF_ONTOLOGY_DEFS_NCO_EMAIL_PROP, _tmp11_);
#line 57 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp12_ = ((TrackerTestTestCase*) self)->tracker_backend;
#line 57 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp13_ = c1;
#line 57 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	tracker_test_backend_add_contact (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, TRACKER_TEST_TYPE_BACKEND, TrackerTestBackend), _tmp13_);
#line 59 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp14_ = ((TrackerTestTestCase*) self)->tracker_backend;
#line 59 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	tracker_test_backend_set_up (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, TRACKER_TEST_TYPE_BACKEND, TrackerTestBackend));
#line 61 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp15_ = g_strdup ("");
#line 61 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_g_free0 (self->priv->_individual_id);
#line 61 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	self->priv->_individual_id = _tmp15_;
#line 62 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	self->priv->_initial_email_found = FALSE;
#line 63 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	self->priv->_updated_email_found = FALSE;
#line 65 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_emails_updates_tests_test_emails_updates_async (self, NULL, NULL);
#line 67 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp16_ = self->priv->_main_loop;
#line 67 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	folks_test_utils_loop_run_with_timeout (_tmp16_, 5);
#line 69 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp17_ = self->priv->_initial_email_found;
#line 69 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_vala_assert (_tmp17_ == TRUE, "this._initial_email_found == true");
#line 71 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	initial_email_found_again = FALSE;
#line 73 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp18_ = self->priv->_aggregator;
#line 73 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp19_ = folks_individual_aggregator_get_individuals (_tmp18_);
#line 73 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp20_ = _tmp19_;
#line 73 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp21_ = self->priv->_individual_id;
#line 73 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp22_ = gee_map_get (_tmp20_, _tmp21_);
#line 73 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	i = (FolksIndividual*) _tmp22_;
#line 74 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp23_ = i;
#line 74 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	if (_tmp23_ != NULL) {
#line 275 "emails-updates.c"
		{
			GeeIterator* _fd_it = NULL;
			FolksIndividual* _tmp24_ = NULL;
			GeeSet* _tmp25_ = NULL;
			GeeSet* _tmp26_ = NULL;
			GeeIterator* _tmp27_ = NULL;
#line 76 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_tmp24_ = i;
#line 76 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_tmp25_ = folks_email_details_get_email_addresses ((FolksEmailDetails*) _tmp24_);
#line 76 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_tmp26_ = _tmp25_;
#line 76 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_tmp27_ = gee_iterable_iterator ((GeeIterable*) _tmp26_);
#line 76 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_fd_it = _tmp27_;
#line 76 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			while (TRUE) {
#line 294 "emails-updates.c"
				GeeIterator* _tmp28_ = NULL;
				gboolean _tmp29_ = FALSE;
				FolksEmailFieldDetails* fd = NULL;
				GeeIterator* _tmp30_ = NULL;
				gpointer _tmp31_ = NULL;
				gchar* email = NULL;
				FolksEmailFieldDetails* _tmp32_ = NULL;
				gconstpointer _tmp33_ = NULL;
				const gchar* _tmp34_ = NULL;
				gchar* _tmp35_ = NULL;
				const gchar* _tmp36_ = NULL;
				const gchar* _tmp37_ = NULL;
#line 76 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
				_tmp28_ = _fd_it;
#line 76 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
				_tmp29_ = gee_iterator_next (_tmp28_);
#line 76 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
				if (!_tmp29_) {
#line 76 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
					break;
#line 315 "emails-updates.c"
				}
#line 76 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
				_tmp30_ = _fd_it;
#line 76 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
				_tmp31_ = gee_iterator_get (_tmp30_);
#line 76 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
				fd = (FolksEmailFieldDetails*) _tmp31_;
#line 78 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
				_tmp32_ = fd;
#line 78 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
				_tmp33_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp32_);
#line 78 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
				_tmp34_ = _tmp33_;
#line 78 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
				_tmp35_ = g_strdup ((const gchar*) _tmp34_);
#line 78 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
				email = _tmp35_;
#line 79 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
				_tmp36_ = email;
#line 79 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
				_tmp37_ = self->priv->_email_1;
#line 79 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
				if (g_strcmp0 (_tmp36_, _tmp37_) == 0) {
#line 81 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
					initial_email_found_again = TRUE;
#line 341 "emails-updates.c"
				}
#line 76 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
				_g_free0 (email);
#line 76 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
				_g_object_unref0 (fd);
#line 347 "emails-updates.c"
			}
#line 76 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_g_object_unref0 (_fd_it);
#line 351 "emails-updates.c"
		}
	}
#line 86 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp38_ = initial_email_found_again;
#line 86 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_vala_assert (_tmp38_ == FALSE, "initial_email_found_again == false");
#line 87 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp39_ = self->priv->_updated_email_found;
#line 87 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_vala_assert (_tmp39_ == TRUE, "this._updated_email_found == true");
#line 45 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_g_object_unref0 (i);
#line 45 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_g_object_unref0 (c1);
#line 366 "emails-updates.c"
}


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


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


static void _emails_updates_tests_test_emails_updates_async (EmailsUpdatesTests* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EmailsUpdatesTestsTestEmailsUpdatesAsyncData* _data_;
	EmailsUpdatesTests* _tmp0_ = NULL;
#line 26 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_data_ = g_slice_new0 (EmailsUpdatesTestsTestEmailsUpdatesAsyncData);
#line 26 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _emails_updates_tests_test_emails_updates_async);
#line 26 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _emails_updates_tests_test_emails_updates_async_data_free);
#line 26 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 26 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_data_->self = _tmp0_;
#line 26 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_emails_updates_tests_test_emails_updates_async_co (_data_);
#line 403 "emails-updates.c"
}


static void _emails_updates_tests_test_emails_updates_finish (EmailsUpdatesTests* self, GAsyncResult* _res_) {
	EmailsUpdatesTestsTestEmailsUpdatesAsyncData* _data_;
#line 26 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 411 "emails-updates.c"
}


static void _emails_updates_tests_test_emails_updates_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EmailsUpdatesTestsTestEmailsUpdatesAsyncData* _data_;
#line 93 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_data_ = _user_data_;
#line 93 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_data_->_source_object_ = source_object;
#line 93 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_data_->_res_ = _res_;
#line 93 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_emails_updates_tests_test_emails_updates_async_co (_data_);
#line 425 "emails-updates.c"
}


static void __emails_updates_tests_individuals_changed_cb_folks_individual_aggregator_individuals_changed_detailed (FolksIndividualAggregator* _sender, GeeMultiMap* changes, gpointer self) {
#line 95 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_emails_updates_tests_individuals_changed_cb ((EmailsUpdatesTests*) self, changes);
#line 432 "emails-updates.c"
}


static gboolean _emails_updates_tests_test_emails_updates_async_co (EmailsUpdatesTestsTestEmailsUpdatesAsyncData* _data_) {
#line 90 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	switch (_data_->_state_) {
#line 90 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		case 0:
#line 441 "emails-updates.c"
		goto _state_0;
#line 90 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		case 1:
#line 445 "emails-updates.c"
		goto _state_1;
#line 90 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		case 2:
#line 449 "emails-updates.c"
		goto _state_2;
		default:
#line 90 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		g_assert_not_reached ();
#line 454 "emails-updates.c"
	}
	_state_0:
#line 92 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_data_->_tmp0_ = NULL;
#line 92 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_data_->_tmp0_ = folks_backend_store_dup ();
#line 92 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_data_->store = _data_->_tmp0_;
#line 93 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_data_->_state_ = 1;
#line 93 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	folks_backend_store_prepare (_data_->store, _emails_updates_tests_test_emails_updates_async_ready, _data_);
#line 93 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	return FALSE;
#line 469 "emails-updates.c"
	_state_1:
#line 93 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	folks_backend_store_prepare_finish (_data_->store, _data_->_res_);
#line 94 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_data_->_tmp1_ = NULL;
#line 94 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_data_->_tmp1_ = folks_individual_aggregator_dup ();
#line 94 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_g_object_unref0 (_data_->self->priv->_aggregator);
#line 94 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_data_->self->priv->_aggregator = _data_->_tmp1_;
#line 95 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_data_->_tmp2_ = NULL;
#line 95 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_data_->_tmp2_ = _data_->self->priv->_aggregator;
#line 95 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	g_signal_connect_object (_data_->_tmp2_, "individuals-changed-detailed", (GCallback) __emails_updates_tests_individuals_changed_cb_folks_individual_aggregator_individuals_changed_detailed, _data_->self, 0);
#line 487 "emails-updates.c"
	{
#line 99 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		_data_->_tmp3_ = NULL;
#line 99 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		_data_->_tmp3_ = _data_->self->priv->_aggregator;
#line 99 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		_data_->_state_ = 2;
#line 99 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		folks_individual_aggregator_prepare (_data_->_tmp3_, _emails_updates_tests_test_emails_updates_async_ready, _data_);
#line 99 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		return FALSE;
#line 499 "emails-updates.c"
		_state_2:
#line 99 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		folks_individual_aggregator_prepare_finish (_data_->_tmp3_, _data_->_res_, &_data_->_inner_error_);
#line 99 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 505 "emails-updates.c"
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
#line 97 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		_data_->e = _data_->_inner_error_;
#line 97 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		_data_->_inner_error_ = NULL;
#line 103 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		_data_->_tmp4_ = NULL;
#line 103 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		_data_->_tmp4_ = _data_->e;
#line 103 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		_data_->_tmp5_ = NULL;
#line 103 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		_data_->_tmp5_ = _data_->_tmp4_->message;
#line 103 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		g_warning ("emails-updates.vala:103: Error when calling prepare: %s\n", _data_->_tmp5_);
#line 97 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		_g_error_free0 (_data_->e);
#line 528 "emails-updates.c"
	}
	__finally0:
#line 97 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 97 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		_g_object_unref0 (_data_->store);
#line 97 "/opt/gnome3/source/folks/tests/tracker/emails-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 97 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		g_clear_error (&_data_->_inner_error_);
#line 97 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		return FALSE;
#line 541 "emails-updates.c"
	}
#line 90 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_g_object_unref0 (_data_->store);
#line 90 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	if (_data_->_state_ == 0) {
#line 90 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 549 "emails-updates.c"
	} else {
#line 90 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 553 "emails-updates.c"
	}
#line 90 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	g_object_unref (_data_->_async_result);
#line 90 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	return FALSE;
#line 559 "emails-updates.c"
}


static void __emails_updates_tests_notify_email_cb_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
#line 120 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_emails_updates_tests_notify_email_cb ((EmailsUpdatesTests*) self, _sender, pspec);
#line 566 "emails-updates.c"
}


static void _emails_updates_tests_individuals_changed_cb (EmailsUpdatesTests* self, GeeMultiMap* changes) {
	GeeCollection* added = NULL;
	GeeMultiMap* _tmp0_ = NULL;
	GeeCollection* _tmp1_ = NULL;
	GeeSet* removed = NULL;
	GeeMultiMap* _tmp2_ = NULL;
	GeeSet* _tmp3_ = NULL;
	GeeSet* _tmp63_ = NULL;
	gint _tmp64_ = 0;
	gint _tmp65_ = 0;
#line 107 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	g_return_if_fail (self != NULL);
#line 107 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	g_return_if_fail (changes != NULL);
#line 110 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp0_ = changes;
#line 110 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp1_ = gee_multi_map_get_values (_tmp0_);
#line 110 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	added = _tmp1_;
#line 111 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp2_ = changes;
#line 111 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp3_ = gee_multi_map_get_keys (_tmp2_);
#line 111 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	removed = _tmp3_;
#line 596 "emails-updates.c"
	{
		GeeIterator* _i_it = NULL;
		GeeCollection* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
#line 113 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		_tmp4_ = added;
#line 113 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
#line 113 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		_i_it = _tmp5_;
#line 113 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		while (TRUE) {
#line 609 "emails-updates.c"
			GeeIterator* _tmp6_ = NULL;
			gboolean _tmp7_ = FALSE;
			FolksIndividual* i = NULL;
			GeeIterator* _tmp8_ = NULL;
			gpointer _tmp9_ = NULL;
			FolksIndividual* _tmp10_ = NULL;
			FolksIndividual* _tmp11_ = NULL;
			const gchar* _tmp12_ = NULL;
			const gchar* _tmp13_ = NULL;
			const gchar* _tmp14_ = NULL;
#line 113 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_tmp6_ = _i_it;
#line 113 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_tmp7_ = gee_iterator_next (_tmp6_);
#line 113 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			if (!_tmp7_) {
#line 113 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
				break;
#line 628 "emails-updates.c"
			}
#line 113 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_tmp8_ = _i_it;
#line 113 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_tmp9_ = gee_iterator_get (_tmp8_);
#line 113 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			i = (FolksIndividual*) _tmp9_;
#line 115 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_tmp10_ = i;
#line 115 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_vala_assert (_tmp10_ != NULL, "i != null");
#line 117 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_tmp11_ = i;
#line 117 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_tmp12_ = folks_name_details_get_full_name ((FolksNameDetails*) _tmp11_);
#line 117 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_tmp13_ = _tmp12_;
#line 117 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_tmp14_ = self->priv->_initial_fullname_1;
#line 117 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			if (g_strcmp0 (_tmp13_, _tmp14_) == 0) {
#line 650 "emails-updates.c"
				FolksIndividual* _tmp15_ = NULL;
				const gchar* _tmp16_ = NULL;
				const gchar* _tmp17_ = NULL;
				gchar* _tmp18_ = NULL;
				FolksIndividual* _tmp19_ = NULL;
#line 119 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
				_tmp15_ = i;
#line 119 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
				_tmp16_ = folks_individual_get_id (_tmp15_);
#line 119 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
				_tmp17_ = _tmp16_;
#line 119 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
				_tmp18_ = g_strdup (_tmp17_);
#line 119 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
				_g_free0 (self->priv->_individual_id);
#line 119 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
				self->priv->_individual_id = _tmp18_;
#line 120 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
				_tmp19_ = i;
#line 120 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
				g_signal_connect_object ((GObject*) _tmp19_, "notify::email-addresses", (GCallback) __emails_updates_tests_notify_email_cb_g_object_notify, self, 0);
#line 672 "emails-updates.c"
				{
					GeeIterator* _fd_it = NULL;
					FolksIndividual* _tmp20_ = NULL;
					GeeSet* _tmp21_ = NULL;
					GeeSet* _tmp22_ = NULL;
					GeeIterator* _tmp23_ = NULL;
#line 122 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
					_tmp20_ = i;
#line 122 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
					_tmp21_ = folks_email_details_get_email_addresses ((FolksEmailDetails*) _tmp20_);
#line 122 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
					_tmp22_ = _tmp21_;
#line 122 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
					_tmp23_ = gee_iterable_iterator ((GeeIterable*) _tmp22_);
#line 122 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
					_fd_it = _tmp23_;
#line 122 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
					while (TRUE) {
#line 691 "emails-updates.c"
						GeeIterator* _tmp24_ = NULL;
						gboolean _tmp25_ = FALSE;
						FolksEmailFieldDetails* fd = NULL;
						GeeIterator* _tmp26_ = NULL;
						gpointer _tmp27_ = NULL;
						gchar* email = NULL;
						FolksEmailFieldDetails* _tmp28_ = NULL;
						gconstpointer _tmp29_ = NULL;
						const gchar* _tmp30_ = NULL;
						gchar* _tmp31_ = NULL;
						const gchar* _tmp32_ = NULL;
						const gchar* _tmp33_ = NULL;
#line 122 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
						_tmp24_ = _fd_it;
#line 122 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
						_tmp25_ = gee_iterator_next (_tmp24_);
#line 122 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
						if (!_tmp25_) {
#line 122 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							break;
#line 712 "emails-updates.c"
						}
#line 122 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
						_tmp26_ = _fd_it;
#line 122 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
						_tmp27_ = gee_iterator_get (_tmp26_);
#line 122 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
						fd = (FolksEmailFieldDetails*) _tmp27_;
#line 124 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
						_tmp28_ = fd;
#line 124 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
						_tmp29_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp28_);
#line 124 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
						_tmp30_ = _tmp29_;
#line 124 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
						_tmp31_ = g_strdup ((const gchar*) _tmp30_);
#line 124 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
						email = _tmp31_;
#line 125 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
						_tmp32_ = email;
#line 125 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
						_tmp33_ = self->priv->_email_1;
#line 125 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
						if (g_strcmp0 (_tmp32_, _tmp33_) == 0) {
#line 736 "emails-updates.c"
							gchar* urn_email_1 = NULL;
							const gchar* _tmp34_ = NULL;
							gchar* _tmp35_ = NULL;
							gchar* _tmp36_ = NULL;
							gchar* _tmp37_ = NULL;
							gchar* _tmp38_ = NULL;
							TrackerTestBackend* _tmp39_ = NULL;
							const gchar* _tmp40_ = NULL;
							const gchar* _tmp41_ = NULL;
							gchar* urn_email_2 = NULL;
							const gchar* _tmp42_ = NULL;
							gchar* _tmp43_ = NULL;
							gchar* _tmp44_ = NULL;
							gchar* _tmp45_ = NULL;
							gchar* _tmp46_ = NULL;
							TrackerTestBackend* _tmp47_ = NULL;
							const gchar* _tmp48_ = NULL;
							const gchar* _tmp49_ = NULL;
							gchar* affl_2 = NULL;
							const gchar* _tmp50_ = NULL;
							gchar* _tmp51_ = NULL;
							gchar* _tmp52_ = NULL;
							gchar* _tmp53_ = NULL;
							gchar* _tmp54_ = NULL;
							TrackerTestBackend* _tmp55_ = NULL;
							const gchar* _tmp56_ = NULL;
							TrackerTestBackend* _tmp57_ = NULL;
							const gchar* _tmp58_ = NULL;
							const gchar* _tmp59_ = NULL;
							TrackerTestBackend* _tmp60_ = NULL;
							const gchar* _tmp61_ = NULL;
							const gchar* _tmp62_ = NULL;
#line 127 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							self->priv->_initial_email_found = TRUE;
#line 129 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_tmp34_ = self->priv->_email_1;
#line 129 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_tmp35_ = g_strconcat ("<", _tmp34_, NULL);
#line 129 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_tmp36_ = _tmp35_;
#line 129 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_tmp37_ = g_strconcat (_tmp36_, ">", NULL);
#line 129 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_tmp38_ = _tmp37_;
#line 129 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_g_free0 (_tmp36_);
#line 129 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							urn_email_1 = _tmp38_;
#line 130 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_tmp39_ = ((TrackerTestTestCase*) self)->tracker_backend;
#line 130 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_tmp40_ = self->priv->_contact_urn_1;
#line 130 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_tmp41_ = urn_email_1;
#line 130 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							tracker_test_backend_remove_triplet (G_TYPE_CHECK_INSTANCE_CAST (_tmp39_, TRACKER_TEST_TYPE_BACKEND, TrackerTestBackend), _tmp40_, TRF_ONTOLOGY_DEFS_NCO_HAS_AFFILIATION, _tmp41_);
#line 134 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_tmp42_ = self->priv->_email_2;
#line 134 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_tmp43_ = g_strconcat ("<email:", _tmp42_, NULL);
#line 134 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_tmp44_ = _tmp43_;
#line 134 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_tmp45_ = g_strconcat (_tmp44_, ">", NULL);
#line 134 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_tmp46_ = _tmp45_;
#line 134 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_g_free0 (_tmp44_);
#line 134 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							urn_email_2 = _tmp46_;
#line 135 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_tmp47_ = ((TrackerTestTestCase*) self)->tracker_backend;
#line 135 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_tmp48_ = urn_email_2;
#line 135 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_tmp49_ = self->priv->_email_2;
#line 135 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							tracker_test_backend_insert_triplet (G_TYPE_CHECK_INSTANCE_CAST (_tmp47_, TRACKER_TEST_TYPE_BACKEND, TrackerTestBackend), _tmp48_, "a", TRF_ONTOLOGY_DEFS_NCO_EMAIL, TRF_ONTOLOGY_DEFS_NCO_EMAIL_PROP, _tmp49_, NULL, NULL);
#line 140 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_tmp50_ = self->priv->_email_2;
#line 140 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_tmp51_ = g_strconcat ("<", _tmp50_, NULL);
#line 140 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_tmp52_ = _tmp51_;
#line 140 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_tmp53_ = g_strconcat (_tmp52_, ">", NULL);
#line 140 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_tmp54_ = _tmp53_;
#line 140 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_g_free0 (_tmp52_);
#line 140 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							affl_2 = _tmp54_;
#line 141 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_tmp55_ = ((TrackerTestTestCase*) self)->tracker_backend;
#line 141 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_tmp56_ = affl_2;
#line 141 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							tracker_test_backend_insert_triplet (G_TYPE_CHECK_INSTANCE_CAST (_tmp55_, TRACKER_TEST_TYPE_BACKEND, TrackerTestBackend), _tmp56_, "a", TRF_ONTOLOGY_DEFS_NCO_AFFILIATION, NULL, NULL, NULL, NULL);
#line 145 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_tmp57_ = ((TrackerTestTestCase*) self)->tracker_backend;
#line 145 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_tmp58_ = affl_2;
#line 145 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_tmp59_ = urn_email_2;
#line 145 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							tracker_test_backend_insert_triplet (G_TYPE_CHECK_INSTANCE_CAST (_tmp57_, TRACKER_TEST_TYPE_BACKEND, TrackerTestBackend), _tmp58_, TRF_ONTOLOGY_DEFS_NCO_HAS_EMAIL, _tmp59_, NULL, NULL, NULL, NULL);
#line 149 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_tmp60_ = ((TrackerTestTestCase*) self)->tracker_backend;
#line 149 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_tmp61_ = self->priv->_contact_urn_1;
#line 149 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_tmp62_ = affl_2;
#line 149 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							tracker_test_backend_insert_triplet (G_TYPE_CHECK_INSTANCE_CAST (_tmp60_, TRACKER_TEST_TYPE_BACKEND, TrackerTestBackend), _tmp61_, TRF_ONTOLOGY_DEFS_NCO_HAS_AFFILIATION, _tmp62_, NULL, NULL, NULL, NULL);
#line 125 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_g_free0 (affl_2);
#line 125 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_g_free0 (urn_email_2);
#line 125 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
							_g_free0 (urn_email_1);
#line 857 "emails-updates.c"
						}
#line 122 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
						_g_free0 (email);
#line 122 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
						_g_object_unref0 (fd);
#line 863 "emails-updates.c"
					}
#line 122 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
					_g_object_unref0 (_fd_it);
#line 867 "emails-updates.c"
				}
			}
#line 113 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_g_object_unref0 (i);
#line 872 "emails-updates.c"
		}
#line 113 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		_g_object_unref0 (_i_it);
#line 876 "emails-updates.c"
	}
#line 157 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp63_ = removed;
#line 157 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp64_ = gee_collection_get_size ((GeeCollection*) _tmp63_);
#line 157 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp65_ = _tmp64_;
#line 157 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_vala_assert (_tmp65_ == 1, "removed.size == 1");
#line 886 "emails-updates.c"
	{
		GeeIterator* _i_it = NULL;
		GeeSet* _tmp66_ = NULL;
		GeeIterator* _tmp67_ = NULL;
#line 159 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		_tmp66_ = removed;
#line 159 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		_tmp67_ = gee_iterable_iterator ((GeeIterable*) _tmp66_);
#line 159 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		_i_it = _tmp67_;
#line 159 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		while (TRUE) {
#line 899 "emails-updates.c"
			GeeIterator* _tmp68_ = NULL;
			gboolean _tmp69_ = FALSE;
			FolksIndividual* i = NULL;
			GeeIterator* _tmp70_ = NULL;
			gpointer _tmp71_ = NULL;
			FolksIndividual* _tmp72_ = NULL;
#line 159 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_tmp68_ = _i_it;
#line 159 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_tmp69_ = gee_iterator_next (_tmp68_);
#line 159 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			if (!_tmp69_) {
#line 159 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
				break;
#line 914 "emails-updates.c"
			}
#line 159 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_tmp70_ = _i_it;
#line 159 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_tmp71_ = gee_iterator_get (_tmp70_);
#line 159 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			i = (FolksIndividual*) _tmp71_;
#line 161 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_tmp72_ = i;
#line 161 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_vala_assert (_tmp72_ == NULL, "i == null");
#line 159 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_g_object_unref0 (i);
#line 928 "emails-updates.c"
		}
#line 159 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		_g_object_unref0 (_i_it);
#line 932 "emails-updates.c"
	}
#line 107 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_g_object_unref0 (removed);
#line 107 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_g_object_unref0 (added);
#line 938 "emails-updates.c"
}


static void _emails_updates_tests_notify_email_cb (EmailsUpdatesTests* self, GObject* individual_obj, GParamSpec* ps) {
	FolksIndividual* individual = NULL;
	GObject* _tmp0_ = NULL;
	FolksIndividual* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	FolksIndividual* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	const gchar* _tmp5_ = NULL;
#line 165 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	g_return_if_fail (self != NULL);
#line 165 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	g_return_if_fail (individual_obj != NULL);
#line 165 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	g_return_if_fail (ps != NULL);
#line 167 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp0_ = individual_obj;
#line 167 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, FOLKS_TYPE_INDIVIDUAL, FolksIndividual));
#line 167 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	individual = _tmp1_;
#line 169 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp2_ = self->priv->_individual_id;
#line 169 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp3_ = individual;
#line 169 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp4_ = folks_individual_get_id (_tmp3_);
#line 169 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp5_ = _tmp4_;
#line 169 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	if (g_strcmp0 (_tmp2_, _tmp5_) != 0) {
#line 170 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		_g_object_unref0 (individual);
#line 170 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		return;
#line 976 "emails-updates.c"
	}
	{
		GeeIterator* _fd_it = NULL;
		FolksIndividual* _tmp6_ = NULL;
		GeeSet* _tmp7_ = NULL;
		GeeSet* _tmp8_ = NULL;
		GeeIterator* _tmp9_ = NULL;
#line 172 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		_tmp6_ = individual;
#line 172 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		_tmp7_ = folks_email_details_get_email_addresses ((FolksEmailDetails*) _tmp6_);
#line 172 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		_tmp8_ = _tmp7_;
#line 172 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		_tmp9_ = gee_iterable_iterator ((GeeIterable*) _tmp8_);
#line 172 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		_fd_it = _tmp9_;
#line 172 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		while (TRUE) {
#line 996 "emails-updates.c"
			GeeIterator* _tmp10_ = NULL;
			gboolean _tmp11_ = FALSE;
			FolksEmailFieldDetails* fd = NULL;
			GeeIterator* _tmp12_ = NULL;
			gpointer _tmp13_ = NULL;
			gchar* email = NULL;
			FolksEmailFieldDetails* _tmp14_ = NULL;
			gconstpointer _tmp15_ = NULL;
			const gchar* _tmp16_ = NULL;
			gchar* _tmp17_ = NULL;
			const gchar* _tmp18_ = NULL;
			const gchar* _tmp19_ = NULL;
#line 172 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_tmp10_ = _fd_it;
#line 172 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_tmp11_ = gee_iterator_next (_tmp10_);
#line 172 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			if (!_tmp11_) {
#line 172 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
				break;
#line 1017 "emails-updates.c"
			}
#line 172 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_tmp12_ = _fd_it;
#line 172 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_tmp13_ = gee_iterator_get (_tmp12_);
#line 172 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			fd = (FolksEmailFieldDetails*) _tmp13_;
#line 174 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_tmp14_ = fd;
#line 174 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_tmp15_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp14_);
#line 174 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_tmp16_ = _tmp15_;
#line 174 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_tmp17_ = g_strdup ((const gchar*) _tmp16_);
#line 174 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			email = _tmp17_;
#line 175 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_tmp18_ = email;
#line 175 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_tmp19_ = self->priv->_email_2;
#line 175 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			if (g_strcmp0 (_tmp18_, _tmp19_) == 0) {
#line 1041 "emails-updates.c"
				GMainLoop* _tmp20_ = NULL;
#line 177 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
				self->priv->_updated_email_found = TRUE;
#line 178 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
				_tmp20_ = self->priv->_main_loop;
#line 178 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
				g_main_loop_quit (_tmp20_);
#line 1049 "emails-updates.c"
			}
#line 172 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_g_free0 (email);
#line 172 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
			_g_object_unref0 (fd);
#line 1055 "emails-updates.c"
		}
#line 172 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
		_g_object_unref0 (_fd_it);
#line 1059 "emails-updates.c"
	}
#line 165 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_g_object_unref0 (individual);
#line 1063 "emails-updates.c"
}


static void emails_updates_tests_class_init (EmailsUpdatesTestsClass * klass) {
#line 26 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	emails_updates_tests_parent_class = g_type_class_peek_parent (klass);
#line 26 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	g_type_class_add_private (klass, sizeof (EmailsUpdatesTestsPrivate));
#line 26 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	G_OBJECT_CLASS (klass)->finalize = emails_updates_tests_finalize;
#line 1074 "emails-updates.c"
}


static void emails_updates_tests_instance_init (EmailsUpdatesTests * self) {
#line 26 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	self->priv = EMAILS_UPDATES_TESTS_GET_PRIVATE (self);
#line 1081 "emails-updates.c"
}


static void emails_updates_tests_finalize (GObject* obj) {
	EmailsUpdatesTests * self;
#line 26 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_EMAILS_UPDATES_TESTS, EmailsUpdatesTests);
#line 28 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_g_object_unref0 (self->priv->_aggregator);
#line 29 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_g_main_loop_unref0 (self->priv->_main_loop);
#line 30 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_g_free0 (self->priv->_individual_id);
#line 32 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_g_free0 (self->priv->_initial_fullname_1);
#line 34 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_g_free0 (self->priv->_email_1);
#line 35 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_g_free0 (self->priv->_email_2);
#line 36 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_g_free0 (self->priv->_contact_urn_1);
#line 26 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	G_OBJECT_CLASS (emails_updates_tests_parent_class)->finalize (obj);
#line 1105 "emails-updates.c"
}


GType emails_updates_tests_get_type (void) {
	static volatile gsize emails_updates_tests_type_id__volatile = 0;
	if (g_once_init_enter (&emails_updates_tests_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (EmailsUpdatesTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) emails_updates_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (EmailsUpdatesTests), 0, (GInstanceInitFunc) emails_updates_tests_instance_init, NULL };
		GType emails_updates_tests_type_id;
		emails_updates_tests_type_id = g_type_register_static (TRACKER_TEST_TYPE_TEST_CASE, "EmailsUpdatesTests", &g_define_type_info, 0);
		g_once_init_leave (&emails_updates_tests_type_id__volatile, emails_updates_tests_type_id);
	}
	return emails_updates_tests_type_id__volatile;
}


gint _vala_main (gchar** args, int args_length1) {
	gint result = 0;
	EmailsUpdatesTests* tests = NULL;
	EmailsUpdatesTests* _tmp0_ = NULL;
#line 186 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	g_test_init (&args_length1, &args, NULL);
#line 188 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_tmp0_ = emails_updates_tests_new ();
#line 188 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	tests = _tmp0_;
#line 189 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	folks_test_case_register ((FolksTestCase*) tests);
#line 190 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	g_test_run ();
#line 191 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	folks_test_case_final_tear_down ((FolksTestCase*) tests);
#line 193 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	result = 0;
#line 193 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	_g_object_unref0 (tests);
#line 193 "/opt/gnome3/source/folks/tests/tracker/emails-updates.vala"
	return result;
#line 1143 "emails-updates.c"
}


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



