/* emails-updates.c generated by valac 0.13.4, 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 <folks-test.h>
#include <tracker-test.h>
#include <folks/folks.h>
#include <stdlib.h>
#include <string.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 _tracker_test_backend_unref0(var) ((var == NULL) ? NULL : (var = (tracker_test_backend_unref (var), NULL)))
#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;

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

struct _EmailsUpdatesTestsClass {
	FolksTestCaseClass parent_class;
};

struct _EmailsUpdatesTestsPrivate {
	TrackerTestBackend* _tracker_backend;
	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* _tmp0_;
	FolksBackendStore* store;
	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_real_set_up (FolksTestCase* base);
static void emails_updates_tests_real_tear_down (FolksTestCase* base);
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 gboolean __lambda0_ (EmailsUpdatesTests* self);
static gboolean ___lambda0__gsource_func (gpointer self);
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 46 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	emails_updates_tests_test_emails_updates (self);
#line 125 "emails-updates.c"
}


EmailsUpdatesTests* emails_updates_tests_construct (GType object_type) {
	EmailsUpdatesTests * self = NULL;
	TrackerTestBackend* _tmp0_;
	TrackerTestBackend* _tmp1_;
#line 41 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	self = (EmailsUpdatesTests*) folks_test_case_construct (object_type, "EmailsUpdates");
#line 43 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp0_ = tracker_test_backend_new ();
#line 43 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tracker_test_backend_unref0 (self->priv->_tracker_backend);
#line 43 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	self->priv->_tracker_backend = _tmp0_;
#line 44 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp1_ = self->priv->_tracker_backend;
#line 44 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	tracker_test_backend_set_debug (_tmp1_, FALSE);
#line 46 "/debian/rgs/devel/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, self);
#line 39 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	return self;
#line 149 "emails-updates.c"
}


EmailsUpdatesTests* emails_updates_tests_new (void) {
#line 39 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	return emails_updates_tests_construct (TYPE_EMAILS_UPDATES_TESTS);
#line 156 "emails-updates.c"
}


static void emails_updates_tests_real_set_up (FolksTestCase* base) {
	EmailsUpdatesTests * self;
#line 49 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	self = (EmailsUpdatesTests*) base;
#line 164 "emails-updates.c"
}


static void emails_updates_tests_real_tear_down (FolksTestCase* base) {
	EmailsUpdatesTests * self;
#line 53 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	self = (EmailsUpdatesTests*) base;
#line 172 "emails-updates.c"
}


static gboolean __lambda0_ (EmailsUpdatesTests* self) {
	gboolean result = FALSE;
	GMainLoop* _tmp0_;
#line 81 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp0_ = self->priv->_main_loop;
#line 81 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	g_main_loop_quit (_tmp0_);
#line 82 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	g_assert_not_reached ();
#line 79 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	return result;
#line 187 "emails-updates.c"
}


static gboolean ___lambda0__gsource_func (gpointer self) {
	gboolean result;
	result = __lambda0_ (self);
#line 79 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	return result;
#line 196 "emails-updates.c"
}


void emails_updates_tests_test_emails_updates (EmailsUpdatesTests* self) {
	GMainLoop* _tmp0_;
	GeeHashMap* _tmp1_;
	GeeHashMap* c1;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	GeeHashMap* _tmp6_;
	const gchar* _tmp7_;
	GeeHashMap* _tmp8_;
	const gchar* _tmp9_;
	GeeHashMap* _tmp10_;
	const gchar* _tmp11_;
	TrackerTestBackend* _tmp12_;
	GeeHashMap* _tmp13_;
	TrackerTestBackend* _tmp14_;
	gchar* _tmp15_;
	GMainLoop* _tmp16_;
	gboolean _tmp17_;
	gboolean initial_email_found_again;
	FolksIndividualAggregator* _tmp18_;
	GeeMap* _tmp19_;
	GeeMap* _tmp20_;
	const gchar* _tmp21_;
	gpointer _tmp22_ = NULL;
	FolksIndividual* i;
	FolksIndividual* _tmp23_;
	gboolean _tmp38_;
	gboolean _tmp39_;
	TrackerTestBackend* _tmp40_;
#line 57 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	g_return_if_fail (self != NULL);
#line 59 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp0_ = g_main_loop_new (NULL, FALSE);
#line 59 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_g_main_loop_unref0 (self->priv->_main_loop);
#line 59 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	self->priv->_main_loop = _tmp0_;
#line 60 "/debian/rgs/devel/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);
#line 60 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	c1 = _tmp1_;
#line 61 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp2_ = g_strdup ("persona #1");
#line 61 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_g_free0 (self->priv->_initial_fullname_1);
#line 61 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	self->priv->_initial_fullname_1 = _tmp2_;
#line 62 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp3_ = g_strdup ("<urn:contact001>");
#line 62 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_g_free0 (self->priv->_contact_urn_1);
#line 62 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	self->priv->_contact_urn_1 = _tmp3_;
#line 63 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp4_ = g_strdup ("persona-addr-1@example.org");
#line 63 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_g_free0 (self->priv->_email_1);
#line 63 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	self->priv->_email_1 = _tmp4_;
#line 64 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp5_ = g_strdup ("persona-addr-2@example.org");
#line 64 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_g_free0 (self->priv->_email_2);
#line 64 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	self->priv->_email_2 = _tmp5_;
#line 66 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp6_ = c1;
#line 66 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp7_ = self->priv->_contact_urn_1;
#line 66 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	gee_abstract_map_set ((GeeAbstractMap*) _tmp6_, TRACKER_TEST_BACKEND_URN, _tmp7_);
#line 67 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp8_ = c1;
#line 67 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp9_ = self->priv->_initial_fullname_1;
#line 67 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	gee_abstract_map_set ((GeeAbstractMap*) _tmp8_, TRF_ONTOLOGY_DEFS_NCO_FULLNAME, _tmp9_);
#line 68 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp10_ = c1;
#line 68 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp11_ = self->priv->_email_1;
#line 68 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	gee_abstract_map_set ((GeeAbstractMap*) _tmp10_, TRF_ONTOLOGY_DEFS_NCO_EMAIL_PROP, _tmp11_);
#line 69 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp12_ = self->priv->_tracker_backend;
#line 69 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp13_ = c1;
#line 69 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	tracker_test_backend_add_contact (_tmp12_, _tmp13_);
#line 71 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp14_ = self->priv->_tracker_backend;
#line 71 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	tracker_test_backend_set_up (_tmp14_);
#line 73 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp15_ = g_strdup ("");
#line 73 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_g_free0 (self->priv->_individual_id);
#line 73 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	self->priv->_individual_id = _tmp15_;
#line 74 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	self->priv->_initial_email_found = FALSE;
#line 75 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	self->priv->_updated_email_found = FALSE;
#line 77 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_emails_updates_tests_test_emails_updates_async (self, NULL, NULL);
#line 79 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 5, ___lambda0__gsource_func, g_object_ref (self), g_object_unref);
#line 85 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp16_ = self->priv->_main_loop;
#line 85 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	g_main_loop_run (_tmp16_);
#line 87 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp17_ = self->priv->_initial_email_found;
#line 87 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	g_assert (_tmp17_ == TRUE);
#line 89 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	initial_email_found_again = FALSE;
#line 91 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp18_ = self->priv->_aggregator;
#line 91 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp19_ = folks_individual_aggregator_get_individuals (_tmp18_);
#line 91 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp20_ = _tmp19_;
#line 91 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp21_ = self->priv->_individual_id;
#line 91 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp22_ = gee_map_get (_tmp20_, _tmp21_);
#line 91 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	i = (FolksIndividual*) _tmp22_;
#line 92 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp23_ = i;
#line 92 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	if (_tmp23_ != NULL) {
#line 335 "emails-updates.c"
		{
			FolksIndividual* _tmp24_;
			GeeSet* _tmp25_;
			GeeSet* _tmp26_;
			GeeIterator* _tmp27_ = NULL;
			GeeIterator* _fd_it;
#line 94 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_tmp24_ = i;
#line 94 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_tmp25_ = folks_email_details_get_email_addresses ((FolksEmailDetails*) _tmp24_);
#line 94 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_tmp26_ = _tmp25_;
#line 94 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_tmp27_ = gee_iterable_iterator ((GeeIterable*) _tmp26_);
#line 94 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_fd_it = _tmp27_;
#line 94 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			while (TRUE) {
#line 354 "emails-updates.c"
				GeeIterator* _tmp28_;
				gboolean _tmp29_ = FALSE;
				GeeIterator* _tmp30_;
				gpointer _tmp31_ = NULL;
				FolksEmailFieldDetails* fd;
				FolksEmailFieldDetails* _tmp32_;
				gconstpointer _tmp33_;
				const gchar* _tmp34_;
				gchar* _tmp35_;
				gchar* email;
				const gchar* _tmp36_;
				const gchar* _tmp37_;
#line 94 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
				_tmp28_ = _fd_it;
#line 94 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
				_tmp29_ = gee_iterator_next (_tmp28_);
#line 94 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
				if (!_tmp29_) {
#line 94 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
					break;
#line 375 "emails-updates.c"
				}
#line 94 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
				_tmp30_ = _fd_it;
#line 94 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
				_tmp31_ = gee_iterator_get (_tmp30_);
#line 94 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
				fd = (FolksEmailFieldDetails*) _tmp31_;
#line 96 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
				_tmp32_ = fd;
#line 96 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
				_tmp33_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp32_);
#line 96 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
				_tmp34_ = _tmp33_;
#line 96 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
				_tmp35_ = g_strdup ((const gchar*) _tmp34_);
#line 96 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
				email = _tmp35_;
#line 97 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
				_tmp36_ = email;
#line 97 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
				_tmp37_ = self->priv->_email_1;
#line 97 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
				if (g_strcmp0 (_tmp36_, _tmp37_) == 0) {
#line 99 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
					initial_email_found_again = TRUE;
#line 401 "emails-updates.c"
				}
#line 94 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
				_g_free0 (email);
#line 94 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
				_g_object_unref0 (fd);
#line 407 "emails-updates.c"
			}
#line 94 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_g_object_unref0 (_fd_it);
#line 411 "emails-updates.c"
		}
	}
#line 104 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp38_ = initial_email_found_again;
#line 104 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	g_assert (_tmp38_ == FALSE);
#line 105 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp39_ = self->priv->_updated_email_found;
#line 105 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	g_assert (_tmp39_ == TRUE);
#line 107 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp40_ = self->priv->_tracker_backend;
#line 107 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	tracker_test_backend_tear_down (_tmp40_);
#line 57 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_g_object_unref0 (i);
#line 57 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_g_object_unref0 (c1);
#line 430 "emails-updates.c"
}


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


static gpointer _g_object_ref0 (gpointer self) {
#line 26 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	return self ? g_object_ref (self) : NULL;
#line 448 "emails-updates.c"
}


static void _emails_updates_tests_test_emails_updates_async (EmailsUpdatesTests* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EmailsUpdatesTestsTestEmailsUpdatesAsyncData* _data_;
	EmailsUpdatesTests* _tmp0_;
#line 26 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_data_ = g_slice_new0 (EmailsUpdatesTestsTestEmailsUpdatesAsyncData);
#line 26 "/debian/rgs/devel/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 "/debian/rgs/devel/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 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 26 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_data_->self = _tmp0_;
#line 26 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_emails_updates_tests_test_emails_updates_async_co (_data_);
#line 467 "emails-updates.c"
}


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


static void _emails_updates_tests_test_emails_updates_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EmailsUpdatesTestsTestEmailsUpdatesAsyncData* _data_;
#line 113 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_data_ = _user_data_;
#line 113 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_data_->_source_object_ = source_object;
#line 113 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_data_->_res_ = _res_;
#line 113 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_emails_updates_tests_test_emails_updates_async_co (_data_);
#line 489 "emails-updates.c"
}


static void __emails_updates_tests_individuals_changed_cb_folks_individual_aggregator_individuals_changed_detailed (FolksIndividualAggregator* _sender, GeeMultiMap* changes, gpointer self) {
#line 115 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_emails_updates_tests_individuals_changed_cb (self, changes);
#line 496 "emails-updates.c"
}


static gboolean _emails_updates_tests_test_emails_updates_async_co (EmailsUpdatesTestsTestEmailsUpdatesAsyncData* _data_) {
#line 110 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	switch (_data_->_state_) {
#line 110 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		case 0:
#line 505 "emails-updates.c"
		goto _state_0;
#line 110 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		case 1:
#line 509 "emails-updates.c"
		goto _state_1;
#line 110 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		case 2:
#line 513 "emails-updates.c"
		goto _state_2;
		default:
#line 110 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		g_assert_not_reached ();
#line 518 "emails-updates.c"
	}
	_state_0:
#line 112 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_data_->_tmp0_ = NULL;
#line 112 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_data_->_tmp0_ = folks_backend_store_dup ();
#line 112 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_data_->store = _data_->_tmp0_;
#line 113 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_data_->_state_ = 1;
#line 113 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	folks_backend_store_prepare (_data_->store, _emails_updates_tests_test_emails_updates_async_ready, _data_);
#line 113 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	return FALSE;
#line 533 "emails-updates.c"
	_state_1:
#line 113 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	folks_backend_store_prepare_finish (_data_->store, _data_->_res_);
#line 114 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_data_->_tmp1_ = folks_individual_aggregator_new ();
#line 114 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_g_object_unref0 (_data_->self->priv->_aggregator);
#line 114 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_data_->self->priv->_aggregator = _data_->_tmp1_;
#line 115 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_data_->_tmp2_ = _data_->self->priv->_aggregator;
#line 115 "/debian/rgs/devel/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 547 "emails-updates.c"
	{
#line 119 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		_data_->_tmp3_ = _data_->self->priv->_aggregator;
#line 119 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		_data_->_state_ = 2;
#line 119 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		folks_individual_aggregator_prepare (_data_->_tmp3_, _emails_updates_tests_test_emails_updates_async_ready, _data_);
#line 119 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		return FALSE;
#line 557 "emails-updates.c"
		_state_2:
#line 119 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		folks_individual_aggregator_prepare_finish (_data_->_tmp3_, _data_->_res_, &_data_->_inner_error_);
#line 119 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		if (_data_->_inner_error_ != NULL) {
#line 563 "emails-updates.c"
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
#line 117 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		_data_->e = _data_->_inner_error_;
#line 117 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		_data_->_inner_error_ = NULL;
#line 123 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		_data_->_tmp4_ = _data_->e;
#line 123 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		_data_->_tmp5_ = _data_->_tmp4_->message;
#line 123 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		g_warning ("emails-updates.vala:123: Error when calling prepare: %s\n", _data_->_tmp5_);
#line 117 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		_g_error_free0 (_data_->e);
#line 582 "emails-updates.c"
	}
	__finally0:
#line 117 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	if (_data_->_inner_error_ != NULL) {
#line 117 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		_g_object_unref0 (_data_->store);
#line 117 "/debian/rgs/devel/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 117 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		g_clear_error (&_data_->_inner_error_);
#line 117 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		return FALSE;
#line 595 "emails-updates.c"
	}
#line 110 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_g_object_unref0 (_data_->store);
#line 110 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	if (_data_->_state_ == 0) {
#line 110 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 603 "emails-updates.c"
	} else {
#line 110 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 607 "emails-updates.c"
	}
#line 110 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	g_object_unref (_data_->_async_result);
#line 110 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	return FALSE;
#line 613 "emails-updates.c"
}


static void __emails_updates_tests_notify_email_cb_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
#line 140 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_emails_updates_tests_notify_email_cb (self, _sender, pspec);
#line 620 "emails-updates.c"
}


static void _emails_updates_tests_individuals_changed_cb (EmailsUpdatesTests* self, GeeMultiMap* changes) {
	GeeMultiMap* _tmp0_;
	GeeCollection* _tmp1_ = NULL;
	GeeCollection* added;
	GeeMultiMap* _tmp2_;
	GeeSet* _tmp3_ = NULL;
	GeeSet* removed;
	GeeSet* _tmp63_;
	gint _tmp64_;
	gint _tmp65_;
#line 127 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	g_return_if_fail (self != NULL);
#line 127 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	g_return_if_fail (changes != NULL);
#line 130 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp0_ = changes;
#line 130 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp1_ = gee_multi_map_get_values (_tmp0_);
#line 130 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	added = _tmp1_;
#line 131 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp2_ = changes;
#line 131 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp3_ = gee_multi_map_get_keys (_tmp2_);
#line 131 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	removed = _tmp3_;
#line 650 "emails-updates.c"
	{
		GeeCollection* _tmp4_;
		GeeIterator* _tmp5_ = NULL;
		GeeIterator* _i_it;
#line 133 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		_tmp4_ = added;
#line 133 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
#line 133 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		_i_it = _tmp5_;
#line 133 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		while (TRUE) {
#line 663 "emails-updates.c"
			GeeIterator* _tmp6_;
			gboolean _tmp7_ = FALSE;
			GeeIterator* _tmp8_;
			gpointer _tmp9_ = NULL;
			FolksIndividual* i;
			FolksIndividual* _tmp10_;
			FolksIndividual* _tmp11_;
			const gchar* _tmp12_;
			const gchar* _tmp13_;
			const gchar* _tmp14_;
#line 133 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_tmp6_ = _i_it;
#line 133 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_tmp7_ = gee_iterator_next (_tmp6_);
#line 133 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			if (!_tmp7_) {
#line 133 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
				break;
#line 682 "emails-updates.c"
			}
#line 133 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_tmp8_ = _i_it;
#line 133 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_tmp9_ = gee_iterator_get (_tmp8_);
#line 133 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			i = (FolksIndividual*) _tmp9_;
#line 135 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_tmp10_ = i;
#line 135 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			g_assert (_tmp10_ != NULL);
#line 137 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_tmp11_ = i;
#line 137 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_tmp12_ = folks_name_details_get_full_name ((FolksNameDetails*) _tmp11_);
#line 137 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_tmp13_ = _tmp12_;
#line 137 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_tmp14_ = self->priv->_initial_fullname_1;
#line 137 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			if (g_strcmp0 (_tmp13_, _tmp14_) == 0) {
#line 704 "emails-updates.c"
				FolksIndividual* _tmp15_;
				const gchar* _tmp16_;
				const gchar* _tmp17_;
				gchar* _tmp18_;
				FolksIndividual* _tmp19_;
#line 139 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
				_tmp15_ = i;
#line 139 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
				_tmp16_ = folks_individual_get_id (_tmp15_);
#line 139 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
				_tmp17_ = _tmp16_;
#line 139 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
				_tmp18_ = g_strdup (_tmp17_);
#line 139 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
				_g_free0 (self->priv->_individual_id);
#line 139 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
				self->priv->_individual_id = _tmp18_;
#line 140 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
				_tmp19_ = i;
#line 140 "/debian/rgs/devel/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 726 "emails-updates.c"
				{
					FolksIndividual* _tmp20_;
					GeeSet* _tmp21_;
					GeeSet* _tmp22_;
					GeeIterator* _tmp23_ = NULL;
					GeeIterator* _fd_it;
#line 142 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
					_tmp20_ = i;
#line 142 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
					_tmp21_ = folks_email_details_get_email_addresses ((FolksEmailDetails*) _tmp20_);
#line 142 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
					_tmp22_ = _tmp21_;
#line 142 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
					_tmp23_ = gee_iterable_iterator ((GeeIterable*) _tmp22_);
#line 142 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
					_fd_it = _tmp23_;
#line 142 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
					while (TRUE) {
#line 745 "emails-updates.c"
						GeeIterator* _tmp24_;
						gboolean _tmp25_ = FALSE;
						GeeIterator* _tmp26_;
						gpointer _tmp27_ = NULL;
						FolksEmailFieldDetails* fd;
						FolksEmailFieldDetails* _tmp28_;
						gconstpointer _tmp29_;
						const gchar* _tmp30_;
						gchar* _tmp31_;
						gchar* email;
						const gchar* _tmp32_;
						const gchar* _tmp33_;
#line 142 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
						_tmp24_ = _fd_it;
#line 142 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
						_tmp25_ = gee_iterator_next (_tmp24_);
#line 142 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
						if (!_tmp25_) {
#line 142 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							break;
#line 766 "emails-updates.c"
						}
#line 142 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
						_tmp26_ = _fd_it;
#line 142 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
						_tmp27_ = gee_iterator_get (_tmp26_);
#line 142 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
						fd = (FolksEmailFieldDetails*) _tmp27_;
#line 144 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
						_tmp28_ = fd;
#line 144 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
						_tmp29_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp28_);
#line 144 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
						_tmp30_ = _tmp29_;
#line 144 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
						_tmp31_ = g_strdup ((const gchar*) _tmp30_);
#line 144 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
						email = _tmp31_;
#line 145 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
						_tmp32_ = email;
#line 145 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
						_tmp33_ = self->priv->_email_1;
#line 145 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
						if (g_strcmp0 (_tmp32_, _tmp33_) == 0) {
#line 790 "emails-updates.c"
							const gchar* _tmp34_;
							gchar* _tmp35_;
							gchar* _tmp36_;
							gchar* _tmp37_;
							gchar* _tmp38_;
							gchar* urn_email_1;
							TrackerTestBackend* _tmp39_;
							const gchar* _tmp40_;
							const gchar* _tmp41_;
							const gchar* _tmp42_;
							gchar* _tmp43_;
							gchar* _tmp44_;
							gchar* _tmp45_;
							gchar* _tmp46_;
							gchar* urn_email_2;
							TrackerTestBackend* _tmp47_;
							const gchar* _tmp48_;
							const gchar* _tmp49_;
							const gchar* _tmp50_;
							gchar* _tmp51_;
							gchar* _tmp52_;
							gchar* _tmp53_;
							gchar* _tmp54_;
							gchar* affl_2;
							TrackerTestBackend* _tmp55_;
							const gchar* _tmp56_;
							TrackerTestBackend* _tmp57_;
							const gchar* _tmp58_;
							const gchar* _tmp59_;
							TrackerTestBackend* _tmp60_;
							const gchar* _tmp61_;
							const gchar* _tmp62_;
#line 147 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							self->priv->_initial_email_found = TRUE;
#line 149 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_tmp34_ = self->priv->_email_1;
#line 149 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_tmp35_ = g_strconcat ("<", _tmp34_, NULL);
#line 149 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_tmp36_ = _tmp35_;
#line 149 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_tmp37_ = g_strconcat (_tmp36_, ">", NULL);
#line 149 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_tmp38_ = _tmp37_;
#line 149 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_g_free0 (_tmp36_);
#line 149 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							urn_email_1 = _tmp38_;
#line 150 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_tmp39_ = self->priv->_tracker_backend;
#line 150 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_tmp40_ = self->priv->_contact_urn_1;
#line 150 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_tmp41_ = urn_email_1;
#line 150 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							tracker_test_backend_remove_triplet (_tmp39_, _tmp40_, TRF_ONTOLOGY_DEFS_NCO_HAS_AFFILIATION, _tmp41_);
#line 153 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_tmp42_ = self->priv->_email_2;
#line 153 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_tmp43_ = g_strconcat ("<email:", _tmp42_, NULL);
#line 153 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_tmp44_ = _tmp43_;
#line 153 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_tmp45_ = g_strconcat (_tmp44_, ">", NULL);
#line 153 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_tmp46_ = _tmp45_;
#line 153 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_g_free0 (_tmp44_);
#line 153 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							urn_email_2 = _tmp46_;
#line 154 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_tmp47_ = self->priv->_tracker_backend;
#line 154 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_tmp48_ = urn_email_2;
#line 154 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_tmp49_ = self->priv->_email_2;
#line 154 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							tracker_test_backend_insert_triplet (_tmp47_, _tmp48_, "a", TRF_ONTOLOGY_DEFS_NCO_EMAIL, TRF_ONTOLOGY_DEFS_NCO_EMAIL_PROP, _tmp49_, NULL, NULL);
#line 159 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_tmp50_ = self->priv->_email_2;
#line 159 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_tmp51_ = g_strconcat ("<", _tmp50_, NULL);
#line 159 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_tmp52_ = _tmp51_;
#line 159 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_tmp53_ = g_strconcat (_tmp52_, ">", NULL);
#line 159 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_tmp54_ = _tmp53_;
#line 159 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_g_free0 (_tmp52_);
#line 159 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							affl_2 = _tmp54_;
#line 160 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_tmp55_ = self->priv->_tracker_backend;
#line 160 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_tmp56_ = affl_2;
#line 160 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							tracker_test_backend_insert_triplet (_tmp55_, _tmp56_, "a", TRF_ONTOLOGY_DEFS_NCO_AFFILIATION, NULL, NULL, NULL, NULL);
#line 164 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_tmp57_ = self->priv->_tracker_backend;
#line 164 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_tmp58_ = affl_2;
#line 164 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_tmp59_ = urn_email_2;
#line 164 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							tracker_test_backend_insert_triplet (_tmp57_, _tmp58_, TRF_ONTOLOGY_DEFS_NCO_HAS_EMAIL, _tmp59_, NULL, NULL, NULL, NULL);
#line 168 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_tmp60_ = self->priv->_tracker_backend;
#line 168 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_tmp61_ = self->priv->_contact_urn_1;
#line 168 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_tmp62_ = affl_2;
#line 168 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							tracker_test_backend_insert_triplet (_tmp60_, _tmp61_, TRF_ONTOLOGY_DEFS_NCO_HAS_AFFILIATION, _tmp62_, NULL, NULL, NULL, NULL);
#line 145 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_g_free0 (affl_2);
#line 145 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_g_free0 (urn_email_2);
#line 145 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
							_g_free0 (urn_email_1);
#line 911 "emails-updates.c"
						}
#line 142 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
						_g_free0 (email);
#line 142 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
						_g_object_unref0 (fd);
#line 917 "emails-updates.c"
					}
#line 142 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
					_g_object_unref0 (_fd_it);
#line 921 "emails-updates.c"
				}
			}
#line 133 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_g_object_unref0 (i);
#line 926 "emails-updates.c"
		}
#line 133 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		_g_object_unref0 (_i_it);
#line 930 "emails-updates.c"
	}
#line 176 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp63_ = removed;
#line 176 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp64_ = gee_collection_get_size ((GeeCollection*) _tmp63_);
#line 176 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp65_ = _tmp64_;
#line 176 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	g_assert (_tmp65_ == 1);
#line 940 "emails-updates.c"
	{
		GeeSet* _tmp66_;
		GeeIterator* _tmp67_ = NULL;
		GeeIterator* _i_it;
#line 178 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		_tmp66_ = removed;
#line 178 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		_tmp67_ = gee_iterable_iterator ((GeeIterable*) _tmp66_);
#line 178 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		_i_it = _tmp67_;
#line 178 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		while (TRUE) {
#line 953 "emails-updates.c"
			GeeIterator* _tmp68_;
			gboolean _tmp69_ = FALSE;
			GeeIterator* _tmp70_;
			gpointer _tmp71_ = NULL;
			FolksIndividual* i;
			FolksIndividual* _tmp72_;
#line 178 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_tmp68_ = _i_it;
#line 178 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_tmp69_ = gee_iterator_next (_tmp68_);
#line 178 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			if (!_tmp69_) {
#line 178 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
				break;
#line 968 "emails-updates.c"
			}
#line 178 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_tmp70_ = _i_it;
#line 178 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_tmp71_ = gee_iterator_get (_tmp70_);
#line 178 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			i = (FolksIndividual*) _tmp71_;
#line 180 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_tmp72_ = i;
#line 180 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			g_assert (_tmp72_ == NULL);
#line 178 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_g_object_unref0 (i);
#line 982 "emails-updates.c"
		}
#line 178 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		_g_object_unref0 (_i_it);
#line 986 "emails-updates.c"
	}
#line 127 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_g_object_unref0 (removed);
#line 127 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_g_object_unref0 (added);
#line 992 "emails-updates.c"
}


static void _emails_updates_tests_notify_email_cb (EmailsUpdatesTests* self, GObject* individual_obj, GParamSpec* ps) {
	GObject* _tmp0_;
	FolksIndividual* _tmp1_;
	FolksIndividual* individual;
	const gchar* _tmp2_;
	FolksIndividual* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
#line 184 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	g_return_if_fail (self != NULL);
#line 184 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	g_return_if_fail (individual_obj != NULL);
#line 184 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	g_return_if_fail (ps != NULL);
#line 186 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp0_ = individual_obj;
#line 186 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp1_ = _g_object_ref0 (FOLKS_INDIVIDUAL (_tmp0_));
#line 186 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	individual = _tmp1_;
#line 188 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp2_ = self->priv->_individual_id;
#line 188 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp3_ = individual;
#line 188 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp4_ = folks_individual_get_id (_tmp3_);
#line 188 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp5_ = _tmp4_;
#line 188 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	if (g_strcmp0 (_tmp2_, _tmp5_) != 0) {
#line 189 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		_g_object_unref0 (individual);
#line 189 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		return;
#line 1030 "emails-updates.c"
	}
	{
		FolksIndividual* _tmp6_;
		GeeSet* _tmp7_;
		GeeSet* _tmp8_;
		GeeIterator* _tmp9_ = NULL;
		GeeIterator* _fd_it;
#line 191 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		_tmp6_ = individual;
#line 191 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		_tmp7_ = folks_email_details_get_email_addresses ((FolksEmailDetails*) _tmp6_);
#line 191 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		_tmp8_ = _tmp7_;
#line 191 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		_tmp9_ = gee_iterable_iterator ((GeeIterable*) _tmp8_);
#line 191 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		_fd_it = _tmp9_;
#line 191 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		while (TRUE) {
#line 1050 "emails-updates.c"
			GeeIterator* _tmp10_;
			gboolean _tmp11_ = FALSE;
			GeeIterator* _tmp12_;
			gpointer _tmp13_ = NULL;
			FolksEmailFieldDetails* fd;
			FolksEmailFieldDetails* _tmp14_;
			gconstpointer _tmp15_;
			const gchar* _tmp16_;
			gchar* _tmp17_;
			gchar* email;
			const gchar* _tmp18_;
			const gchar* _tmp19_;
#line 191 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_tmp10_ = _fd_it;
#line 191 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_tmp11_ = gee_iterator_next (_tmp10_);
#line 191 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			if (!_tmp11_) {
#line 191 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
				break;
#line 1071 "emails-updates.c"
			}
#line 191 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_tmp12_ = _fd_it;
#line 191 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_tmp13_ = gee_iterator_get (_tmp12_);
#line 191 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			fd = (FolksEmailFieldDetails*) _tmp13_;
#line 193 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_tmp14_ = fd;
#line 193 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_tmp15_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp14_);
#line 193 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_tmp16_ = _tmp15_;
#line 193 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_tmp17_ = g_strdup ((const gchar*) _tmp16_);
#line 193 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			email = _tmp17_;
#line 194 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_tmp18_ = email;
#line 194 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_tmp19_ = self->priv->_email_2;
#line 194 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			if (g_strcmp0 (_tmp18_, _tmp19_) == 0) {
#line 1095 "emails-updates.c"
				GMainLoop* _tmp20_;
#line 196 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
				self->priv->_updated_email_found = TRUE;
#line 197 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
				_tmp20_ = self->priv->_main_loop;
#line 197 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
				g_main_loop_quit (_tmp20_);
#line 1103 "emails-updates.c"
			}
#line 191 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_g_free0 (email);
#line 191 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
			_g_object_unref0 (fd);
#line 1109 "emails-updates.c"
		}
#line 191 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
		_g_object_unref0 (_fd_it);
#line 1113 "emails-updates.c"
	}
#line 184 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_g_object_unref0 (individual);
#line 1117 "emails-updates.c"
}


static void emails_updates_tests_class_init (EmailsUpdatesTestsClass * klass) {
#line 26 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	emails_updates_tests_parent_class = g_type_class_peek_parent (klass);
#line 26 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	g_type_class_add_private (klass, sizeof (EmailsUpdatesTestsPrivate));
#line 26 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	FOLKS_TEST_CASE_CLASS (klass)->set_up = emails_updates_tests_real_set_up;
#line 26 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	FOLKS_TEST_CASE_CLASS (klass)->tear_down = emails_updates_tests_real_tear_down;
#line 26 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	G_OBJECT_CLASS (klass)->finalize = emails_updates_tests_finalize;
#line 1132 "emails-updates.c"
}


static void emails_updates_tests_instance_init (EmailsUpdatesTests * self) {
#line 26 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	self->priv = EMAILS_UPDATES_TESTS_GET_PRIVATE (self);
#line 1139 "emails-updates.c"
}


static void emails_updates_tests_finalize (GObject* obj) {
	EmailsUpdatesTests * self;
#line 26 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	self = EMAILS_UPDATES_TESTS (obj);
#line 28 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tracker_test_backend_unref0 (self->priv->_tracker_backend);
#line 29 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_g_object_unref0 (self->priv->_aggregator);
#line 30 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_g_main_loop_unref0 (self->priv->_main_loop);
#line 31 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_g_free0 (self->priv->_individual_id);
#line 33 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_g_free0 (self->priv->_initial_fullname_1);
#line 35 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_g_free0 (self->priv->_email_1);
#line 36 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_g_free0 (self->priv->_email_2);
#line 37 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_g_free0 (self->priv->_contact_urn_1);
#line 26 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	G_OBJECT_CLASS (emails_updates_tests_parent_class)->finalize (obj);
#line 1165 "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 (FOLKS_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;
	GTestSuite* _tmp0_ = NULL;
	GTestSuite* root;
	EmailsUpdatesTests* _tmp1_;
	EmailsUpdatesTests* _tmp2_;
	GTestSuite* _tmp3_ = NULL;
#line 205 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	g_test_init (&args_length1, &args, NULL);
#line 207 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp0_ = g_test_get_root ();
#line 207 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	root = _tmp0_;
#line 208 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp1_ = emails_updates_tests_new ();
#line 208 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp2_ = _tmp1_;
#line 208 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_tmp3_ = folks_test_case_get_suite ((FolksTestCase*) _tmp2_);
#line 208 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	g_test_suite_add_suite (root, _tmp3_);
#line 208 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	_g_object_unref0 (_tmp2_);
#line 210 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	g_test_run ();
#line 212 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	result = 0;
#line 212 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	return result;
#line 1210 "emails-updates.c"
}


int main (int argc, char ** argv) {
#line 203 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	g_type_init ();
#line 203 "/debian/rgs/devel/folks/tests/tracker/emails-updates.vala"
	return _vala_main (argv, argc);
#line 1219 "emails-updates.c"
}



