/* avatar-updates.c generated by valac 0.13.4, the Vala compiler
 * generated from avatar-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 <gio/gio.h>
#include <gee.h>
#include <folks/folks-tracker.h>


#define TYPE_AVATAR_UPDATES_TESTS (avatar_updates_tests_get_type ())
#define AVATAR_UPDATES_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_AVATAR_UPDATES_TESTS, AvatarUpdatesTests))
#define AVATAR_UPDATES_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_AVATAR_UPDATES_TESTS, AvatarUpdatesTestsClass))
#define IS_AVATAR_UPDATES_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_AVATAR_UPDATES_TESTS))
#define IS_AVATAR_UPDATES_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_AVATAR_UPDATES_TESTS))
#define AVATAR_UPDATES_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_AVATAR_UPDATES_TESTS, AvatarUpdatesTestsClass))

typedef struct _AvatarUpdatesTests AvatarUpdatesTests;
typedef struct _AvatarUpdatesTestsClass AvatarUpdatesTestsClass;
typedef struct _AvatarUpdatesTestsPrivate AvatarUpdatesTestsPrivate;
#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_free0(var) (var = (g_free (var), NULL))
#define _g_main_loop_unref0(var) ((var == NULL) ? NULL : (var = (g_main_loop_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _AvatarUpdatesTestsTestAvatarUpdatesAsyncData AvatarUpdatesTestsTestAvatarUpdatesAsyncData;

struct _AvatarUpdatesTests {
	FolksTestCase parent_instance;
	AvatarUpdatesTestsPrivate * priv;
};

struct _AvatarUpdatesTestsClass {
	FolksTestCaseClass parent_class;
};

struct _AvatarUpdatesTestsPrivate {
	TrackerTestBackend* _tracker_backend;
	FolksIndividualAggregator* _aggregator;
	gboolean _updated_avatar_found;
	gchar* _updated_avatar_uri;
	GLoadableIcon* _updated_avatar;
	gchar* _individual_id;
	GMainLoop* _main_loop;
	gboolean _initial_avatar_found;
	gchar* _initial_fullname;
	gchar* _initial_avatar_uri;
	gchar* _contact_urn;
	gchar* _photo_urn;
};

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


static gpointer avatar_updates_tests_parent_class = NULL;

GType avatar_updates_tests_get_type (void) G_GNUC_CONST;
#define AVATAR_UPDATES_TESTS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_AVATAR_UPDATES_TESTS, AvatarUpdatesTestsPrivate))
enum  {
	AVATAR_UPDATES_TESTS_DUMMY_PROPERTY
};
AvatarUpdatesTests* avatar_updates_tests_new (void);
AvatarUpdatesTests* avatar_updates_tests_construct (GType object_type);
void avatar_updates_tests_test_avatar_updates (AvatarUpdatesTests* self);
static void _avatar_updates_tests_test_avatar_updates_folks_test_case_test_method (gpointer self);
static void avatar_updates_tests_real_set_up (FolksTestCase* base);
static void avatar_updates_tests_real_tear_down (FolksTestCase* base);
static void avatar_updates_tests_test_avatar_updates_async (AvatarUpdatesTests* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void avatar_updates_tests_test_avatar_updates_finish (AvatarUpdatesTests* self, GAsyncResult* _res_);
static gboolean __lambda0_ (AvatarUpdatesTests* self);
static gboolean ___lambda0__gsource_func (gpointer self);
static void avatar_updates_tests_test_avatar_updates_async_data_free (gpointer _data);
static gboolean avatar_updates_tests_test_avatar_updates_async_co (AvatarUpdatesTestsTestAvatarUpdatesAsyncData* _data_);
static void avatar_updates_tests_test_avatar_updates_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _avatar_updates_tests_individuals_changed_cb (AvatarUpdatesTests* self, GeeMultiMap* changes);
static void __avatar_updates_tests_individuals_changed_cb_folks_individual_aggregator_individuals_changed_detailed (FolksIndividualAggregator* _sender, GeeMultiMap* changes, gpointer self);
static void _avatar_updates_tests_notify_avatar_cb (AvatarUpdatesTests* self);
static void __avatar_updates_tests_notify_avatar_cb_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void avatar_updates_tests_finalize (GObject* obj);
gint _vala_main (gchar** args, int args_length1);


static void _avatar_updates_tests_test_avatar_updates_folks_test_case_test_method (gpointer self) {
#line 48 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	avatar_updates_tests_test_avatar_updates (self);
#line 127 "avatar-updates.c"
}


AvatarUpdatesTests* avatar_updates_tests_construct (GType object_type) {
	AvatarUpdatesTests * self = NULL;
	TrackerTestBackend* _tmp0_;
	TrackerTestBackend* _tmp1_;
#line 43 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	self = (AvatarUpdatesTests*) folks_test_case_construct (object_type, "AvatarUpdates");
#line 45 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp0_ = tracker_test_backend_new ();
#line 45 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tracker_test_backend_unref0 (self->priv->_tracker_backend);
#line 45 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	self->priv->_tracker_backend = _tmp0_;
#line 46 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp1_ = self->priv->_tracker_backend;
#line 46 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	tracker_test_backend_set_debug (_tmp1_, FALSE);
#line 48 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	folks_test_case_add_test ((FolksTestCase*) self, "avatar updates", _avatar_updates_tests_test_avatar_updates_folks_test_case_test_method, self);
#line 41 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	return self;
#line 151 "avatar-updates.c"
}


AvatarUpdatesTests* avatar_updates_tests_new (void) {
#line 41 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	return avatar_updates_tests_construct (TYPE_AVATAR_UPDATES_TESTS);
#line 158 "avatar-updates.c"
}


static void avatar_updates_tests_real_set_up (FolksTestCase* base) {
	AvatarUpdatesTests * self;
#line 51 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	self = (AvatarUpdatesTests*) base;
#line 166 "avatar-updates.c"
}


static void avatar_updates_tests_real_tear_down (FolksTestCase* base) {
	AvatarUpdatesTests * self;
#line 55 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	self = (AvatarUpdatesTests*) base;
#line 174 "avatar-updates.c"
}


static gboolean __lambda0_ (AvatarUpdatesTests* self) {
	gboolean result = FALSE;
	GMainLoop* _tmp0_;
#line 86 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp0_ = self->priv->_main_loop;
#line 86 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	g_main_loop_quit (_tmp0_);
#line 87 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	g_assert_not_reached ();
#line 84 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	return result;
#line 189 "avatar-updates.c"
}


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


void avatar_updates_tests_test_avatar_updates (AvatarUpdatesTests* self) {
	GMainLoop* _tmp0_;
	GeeHashMap* _tmp1_;
	GeeHashMap* c1;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	const gchar* _tmp10_;
	GFile* _tmp11_ = NULL;
	GFile* _tmp12_;
	GFileIcon* _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	const gchar* _tmp16_;
	TrackerTestBackend* _tmp17_;
	TrackerTestBackend* _tmp18_;
	gchar* _tmp19_;
	GMainLoop* _tmp20_;
	gboolean _tmp21_;
	gboolean _tmp22_;
	TrackerTestBackend* _tmp23_;
#line 59 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	g_return_if_fail (self != NULL);
#line 61 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp0_ = g_main_loop_new (NULL, FALSE);
#line 61 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_g_main_loop_unref0 (self->priv->_main_loop);
#line 61 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	self->priv->_main_loop = _tmp0_;
#line 62 "/debian/rgs/devel/folks/tests/tracker/avatar-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 62 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	c1 = _tmp1_;
#line 63 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp2_ = g_strdup ("persona #1");
#line 63 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_g_free0 (self->priv->_initial_fullname);
#line 63 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	self->priv->_initial_fullname = _tmp2_;
#line 64 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp3_ = g_strdup ("file:///tmp/avatar-01");
#line 64 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_g_free0 (self->priv->_initial_avatar_uri);
#line 64 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	self->priv->_initial_avatar_uri = _tmp3_;
#line 65 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp4_ = g_strdup ("<urn:contact001>");
#line 65 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_g_free0 (self->priv->_contact_urn);
#line 65 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	self->priv->_contact_urn = _tmp4_;
#line 66 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp5_ = self->priv->_initial_avatar_uri;
#line 66 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp6_ = g_strconcat ("<", _tmp5_, NULL);
#line 66 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp7_ = _tmp6_;
#line 66 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp8_ = g_strconcat (_tmp7_, ">", NULL);
#line 66 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_g_free0 (self->priv->_photo_urn);
#line 66 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	self->priv->_photo_urn = _tmp8_;
#line 66 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_g_free0 (_tmp7_);
#line 67 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp9_ = g_strdup ("file:///tmp/avatar-02");
#line 67 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_g_free0 (self->priv->_updated_avatar_uri);
#line 67 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	self->priv->_updated_avatar_uri = _tmp9_;
#line 68 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp10_ = self->priv->_updated_avatar_uri;
#line 68 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp11_ = g_file_new_for_uri (_tmp10_);
#line 68 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp12_ = _tmp11_;
#line 68 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp13_ = (GFileIcon*) g_file_icon_new (_tmp12_);
#line 68 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_g_object_unref0 (self->priv->_updated_avatar);
#line 68 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	self->priv->_updated_avatar = (GLoadableIcon*) _tmp13_;
#line 68 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_g_object_unref0 (_tmp12_);
#line 71 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp14_ = self->priv->_contact_urn;
#line 71 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	gee_abstract_map_set ((GeeAbstractMap*) c1, TRACKER_TEST_BACKEND_URN, _tmp14_);
#line 72 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp15_ = self->priv->_initial_fullname;
#line 72 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	gee_abstract_map_set ((GeeAbstractMap*) c1, TRF_ONTOLOGY_DEFS_NCO_FULLNAME, _tmp15_);
#line 73 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp16_ = self->priv->_initial_avatar_uri;
#line 73 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	gee_abstract_map_set ((GeeAbstractMap*) c1, TRF_ONTOLOGY_DEFS_NCO_PHOTO, _tmp16_);
#line 74 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp17_ = self->priv->_tracker_backend;
#line 74 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	tracker_test_backend_add_contact (_tmp17_, c1);
#line 76 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp18_ = self->priv->_tracker_backend;
#line 76 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	tracker_test_backend_set_up (_tmp18_);
#line 78 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	self->priv->_initial_avatar_found = FALSE;
#line 79 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	self->priv->_updated_avatar_found = FALSE;
#line 80 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp19_ = g_strdup ("");
#line 80 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_g_free0 (self->priv->_individual_id);
#line 80 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	self->priv->_individual_id = _tmp19_;
#line 82 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	avatar_updates_tests_test_avatar_updates_async (self, NULL, NULL);
#line 84 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 5, ___lambda0__gsource_func, g_object_ref (self), g_object_unref);
#line 90 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp20_ = self->priv->_main_loop;
#line 90 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	g_main_loop_run (_tmp20_);
#line 92 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp21_ = self->priv->_initial_avatar_found;
#line 92 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	g_assert (_tmp21_ == TRUE);
#line 93 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp22_ = self->priv->_updated_avatar_found;
#line 93 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	g_assert (_tmp22_ == TRUE);
#line 95 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp23_ = self->priv->_tracker_backend;
#line 95 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	tracker_test_backend_tear_down (_tmp23_);
#line 59 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_g_object_unref0 (c1);
#line 344 "avatar-updates.c"
}


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


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


static void avatar_updates_tests_test_avatar_updates_async (AvatarUpdatesTests* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	AvatarUpdatesTestsTestAvatarUpdatesAsyncData* _data_;
	AvatarUpdatesTests* _tmp0_;
#line 26 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_data_ = g_slice_new0 (AvatarUpdatesTestsTestAvatarUpdatesAsyncData);
#line 26 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, avatar_updates_tests_test_avatar_updates_async);
#line 26 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, avatar_updates_tests_test_avatar_updates_async_data_free);
#line 26 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 26 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_data_->self = _tmp0_;
#line 26 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	avatar_updates_tests_test_avatar_updates_async_co (_data_);
#line 381 "avatar-updates.c"
}


static void avatar_updates_tests_test_avatar_updates_finish (AvatarUpdatesTests* self, GAsyncResult* _res_) {
	AvatarUpdatesTestsTestAvatarUpdatesAsyncData* _data_;
#line 26 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 389 "avatar-updates.c"
}


static void avatar_updates_tests_test_avatar_updates_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	AvatarUpdatesTestsTestAvatarUpdatesAsyncData* _data_;
#line 101 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_data_ = _user_data_;
#line 101 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_data_->_source_object_ = source_object;
#line 101 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_data_->_res_ = _res_;
#line 101 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	avatar_updates_tests_test_avatar_updates_async_co (_data_);
#line 403 "avatar-updates.c"
}


static void __avatar_updates_tests_individuals_changed_cb_folks_individual_aggregator_individuals_changed_detailed (FolksIndividualAggregator* _sender, GeeMultiMap* changes, gpointer self) {
#line 103 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_avatar_updates_tests_individuals_changed_cb (self, changes);
#line 410 "avatar-updates.c"
}


static gboolean avatar_updates_tests_test_avatar_updates_async_co (AvatarUpdatesTestsTestAvatarUpdatesAsyncData* _data_) {
#line 98 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	switch (_data_->_state_) {
#line 98 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		case 0:
#line 419 "avatar-updates.c"
		goto _state_0;
#line 98 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		case 1:
#line 423 "avatar-updates.c"
		goto _state_1;
#line 98 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		case 2:
#line 427 "avatar-updates.c"
		goto _state_2;
		default:
#line 98 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		g_assert_not_reached ();
#line 432 "avatar-updates.c"
	}
	_state_0:
#line 100 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_data_->_tmp0_ = NULL;
#line 100 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_data_->_tmp0_ = folks_backend_store_dup ();
#line 100 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_data_->store = _data_->_tmp0_;
#line 101 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_data_->_state_ = 1;
#line 101 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	folks_backend_store_prepare (_data_->store, avatar_updates_tests_test_avatar_updates_async_ready, _data_);
#line 101 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	return FALSE;
#line 447 "avatar-updates.c"
	_state_1:
#line 101 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	folks_backend_store_prepare_finish (_data_->store, _data_->_res_);
#line 102 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_data_->_tmp1_ = folks_individual_aggregator_new ();
#line 102 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_g_object_unref0 (_data_->self->priv->_aggregator);
#line 102 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_data_->self->priv->_aggregator = _data_->_tmp1_;
#line 103 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_data_->_tmp2_ = _data_->self->priv->_aggregator;
#line 103 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	g_signal_connect_object (_data_->_tmp2_, "individuals-changed-detailed", (GCallback) __avatar_updates_tests_individuals_changed_cb_folks_individual_aggregator_individuals_changed_detailed, _data_->self, 0);
#line 461 "avatar-updates.c"
	{
#line 107 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		_data_->_tmp3_ = _data_->self->priv->_aggregator;
#line 107 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		_data_->_state_ = 2;
#line 107 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		folks_individual_aggregator_prepare (_data_->_tmp3_, avatar_updates_tests_test_avatar_updates_async_ready, _data_);
#line 107 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		return FALSE;
#line 471 "avatar-updates.c"
		_state_2:
#line 107 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		folks_individual_aggregator_prepare_finish (_data_->_tmp3_, _data_->_res_, &_data_->_inner_error_);
#line 107 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		if (_data_->_inner_error_ != NULL) {
#line 477 "avatar-updates.c"
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
#line 105 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		_data_->e = _data_->_inner_error_;
#line 105 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		_data_->_inner_error_ = NULL;
#line 111 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		_data_->_tmp4_ = _data_->e;
#line 111 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		_data_->_tmp5_ = _data_->_tmp4_->message;
#line 111 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		g_warning ("avatar-updates.vala:111: Error when calling prepare: %s\n", _data_->_tmp5_);
#line 105 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		_g_error_free0 (_data_->e);
#line 496 "avatar-updates.c"
	}
	__finally0:
#line 105 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	if (_data_->_inner_error_ != NULL) {
#line 105 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		_g_object_unref0 (_data_->store);
#line 105 "/debian/rgs/devel/folks/tests/tracker/avatar-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 105 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		g_clear_error (&_data_->_inner_error_);
#line 105 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		return FALSE;
#line 509 "avatar-updates.c"
	}
#line 98 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_g_object_unref0 (_data_->store);
#line 98 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	if (_data_->_state_ == 0) {
#line 98 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 517 "avatar-updates.c"
	} else {
#line 98 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 521 "avatar-updates.c"
	}
#line 98 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	g_object_unref (_data_->_async_result);
#line 98 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	return FALSE;
#line 527 "avatar-updates.c"
}


static void __avatar_updates_tests_notify_avatar_cb_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
#line 127 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_avatar_updates_tests_notify_avatar_cb (self);
#line 534 "avatar-updates.c"
}


static void _avatar_updates_tests_individuals_changed_cb (AvatarUpdatesTests* self, GeeMultiMap* changes) {
	GeeMultiMap* _tmp0_;
	GeeCollection* _tmp1_ = NULL;
	GeeCollection* added;
	GeeMultiMap* _tmp2_;
	GeeSet* _tmp3_ = NULL;
	GeeSet* removed;
	GeeSet* _tmp48_;
	gint _tmp49_;
	gint _tmp50_;
#line 115 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	g_return_if_fail (self != NULL);
#line 115 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	g_return_if_fail (changes != NULL);
#line 118 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp0_ = changes;
#line 118 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp1_ = gee_multi_map_get_values (_tmp0_);
#line 118 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	added = _tmp1_;
#line 119 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp2_ = changes;
#line 119 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp3_ = gee_multi_map_get_keys (_tmp2_);
#line 119 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	removed = _tmp3_;
#line 564 "avatar-updates.c"
	{
		GeeCollection* _tmp4_;
		GeeIterator* _tmp5_ = NULL;
		GeeIterator* _i_it;
#line 121 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		_tmp4_ = added;
#line 121 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
#line 121 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		_i_it = _tmp5_;
#line 121 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		while (TRUE) {
#line 577 "avatar-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 121 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
			_tmp6_ = _i_it;
#line 121 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
			_tmp7_ = gee_iterator_next (_tmp6_);
#line 121 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
			if (!_tmp7_) {
#line 121 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
				break;
#line 596 "avatar-updates.c"
			}
#line 121 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
			_tmp8_ = _i_it;
#line 121 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
			_tmp9_ = gee_iterator_get (_tmp8_);
#line 121 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
			i = (FolksIndividual*) _tmp9_;
#line 123 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
			_tmp10_ = i;
#line 123 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
			g_assert (_tmp10_ != NULL);
#line 125 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
			_tmp11_ = i;
#line 125 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
			_tmp12_ = folks_name_details_get_full_name ((FolksNameDetails*) _tmp11_);
#line 125 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
			_tmp13_ = _tmp12_;
#line 125 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
			_tmp14_ = self->priv->_initial_fullname;
#line 125 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
			if (g_strcmp0 (_tmp13_, _tmp14_) == 0) {
#line 618 "avatar-updates.c"
				FolksIndividual* _tmp15_;
				FolksIndividual* _tmp16_;
				const gchar* _tmp17_;
				const gchar* _tmp18_;
				gchar* _tmp19_;
				const gchar* _tmp20_;
				GFile* _tmp21_ = NULL;
				GFile* _tmp22_;
				GFileIcon* _tmp23_;
				GFileIcon* _tmp24_;
				GFileIcon* initial_avatar;
				gboolean _tmp25_ = FALSE;
				FolksIndividual* _tmp26_;
				GLoadableIcon* _tmp27_;
				GLoadableIcon* _tmp28_;
				gboolean _tmp34_;
#line 127 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
				_tmp15_ = i;
#line 127 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
				g_signal_connect_object ((GObject*) _tmp15_, "notify::avatar", (GCallback) __avatar_updates_tests_notify_avatar_cb_g_object_notify, self, 0);
#line 128 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
				_tmp16_ = i;
#line 128 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
				_tmp17_ = folks_individual_get_id (_tmp16_);
#line 128 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
				_tmp18_ = _tmp17_;
#line 128 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
				_tmp19_ = g_strdup (_tmp18_);
#line 128 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
				_g_free0 (self->priv->_individual_id);
#line 128 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
				self->priv->_individual_id = _tmp19_;
#line 130 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
				_tmp20_ = self->priv->_initial_avatar_uri;
#line 130 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
				_tmp21_ = g_file_new_for_uri (_tmp20_);
#line 130 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
				_tmp22_ = _tmp21_;
#line 130 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
				_tmp23_ = (GFileIcon*) g_file_icon_new (_tmp22_);
#line 130 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
				_tmp24_ = _tmp23_;
#line 130 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
				_g_object_unref0 (_tmp22_);
#line 130 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
				initial_avatar = _tmp24_;
#line 133 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
				_tmp26_ = i;
#line 133 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
				_tmp27_ = folks_avatar_details_get_avatar ((FolksAvatarDetails*) _tmp26_);
#line 133 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
				_tmp28_ = _tmp27_;
#line 133 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
				if (_tmp28_ != NULL) {
#line 673 "avatar-updates.c"
					FolksIndividual* _tmp29_;
					GLoadableIcon* _tmp30_;
					GLoadableIcon* _tmp31_;
					GFileIcon* _tmp32_;
					gboolean _tmp33_ = FALSE;
#line 133 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
					_tmp29_ = i;
#line 133 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
					_tmp30_ = folks_avatar_details_get_avatar ((FolksAvatarDetails*) _tmp29_);
#line 133 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
					_tmp31_ = _tmp30_;
#line 133 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
					_tmp32_ = initial_avatar;
#line 133 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
					_tmp33_ = g_icon_equal ((GIcon*) _tmp31_, (GIcon*) _tmp32_);
#line 133 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
					_tmp25_ = _tmp33_ == TRUE;
#line 691 "avatar-updates.c"
				} else {
#line 133 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
					_tmp25_ = FALSE;
#line 695 "avatar-updates.c"
				}
#line 133 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
				_tmp34_ = _tmp25_;
#line 133 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
				if (_tmp34_) {
#line 701 "avatar-updates.c"
					TrackerTestBackend* _tmp35_;
					const gchar* _tmp36_;
					const gchar* _tmp37_;
					const gchar* _tmp38_;
					gchar* _tmp39_;
					gchar* photo_urn_2;
					const gchar* _tmp40_;
					gchar* _tmp41_;
					TrackerTestBackend* _tmp42_;
					const gchar* _tmp43_;
					const gchar* _tmp44_;
					TrackerTestBackend* _tmp45_;
					const gchar* _tmp46_;
					const gchar* _tmp47_;
#line 135 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
					self->priv->_initial_avatar_found = TRUE;
#line 137 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
					_tmp35_ = self->priv->_tracker_backend;
#line 137 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
					_tmp36_ = self->priv->_contact_urn;
#line 137 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
					_tmp37_ = self->priv->_photo_urn;
#line 137 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
					tracker_test_backend_remove_triplet (_tmp35_, _tmp36_, TRF_ONTOLOGY_DEFS_NCO_PHOTO, _tmp37_);
#line 140 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
					_tmp38_ = self->priv->_updated_avatar_uri;
#line 140 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
					_tmp39_ = g_strconcat ("<", _tmp38_, NULL);
#line 140 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
					photo_urn_2 = _tmp39_;
#line 141 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
					_tmp40_ = photo_urn_2;
#line 141 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
					_tmp41_ = g_strconcat (_tmp40_, ">", NULL);
#line 141 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
					_g_free0 (photo_urn_2);
#line 141 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
					photo_urn_2 = _tmp41_;
#line 142 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
					_tmp42_ = self->priv->_tracker_backend;
#line 142 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
					_tmp43_ = photo_urn_2;
#line 142 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
					_tmp44_ = self->priv->_updated_avatar_uri;
#line 142 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
					tracker_test_backend_insert_triplet (_tmp42_, _tmp43_, "a", "nfo:Image, nie:DataObject", TRF_ONTOLOGY_DEFS_NIE_URL, _tmp44_, NULL, NULL);
#line 147 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
					_tmp45_ = self->priv->_tracker_backend;
#line 147 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
					_tmp46_ = self->priv->_contact_urn;
#line 147 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
					_tmp47_ = photo_urn_2;
#line 147 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
					tracker_test_backend_insert_triplet (_tmp45_, _tmp46_, TRF_ONTOLOGY_DEFS_NCO_PHOTO, _tmp47_, NULL, NULL, NULL, NULL);
#line 133 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
					_g_free0 (photo_urn_2);
#line 758 "avatar-updates.c"
				}
#line 125 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
				_g_object_unref0 (initial_avatar);
#line 762 "avatar-updates.c"
			}
#line 121 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
			_g_object_unref0 (i);
#line 766 "avatar-updates.c"
		}
#line 121 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		_g_object_unref0 (_i_it);
#line 770 "avatar-updates.c"
	}
#line 155 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp48_ = removed;
#line 155 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp49_ = gee_collection_get_size ((GeeCollection*) _tmp48_);
#line 155 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp50_ = _tmp49_;
#line 155 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	g_assert (_tmp50_ == 1);
#line 780 "avatar-updates.c"
	{
		GeeSet* _tmp51_;
		GeeIterator* _tmp52_ = NULL;
		GeeIterator* _i_it;
#line 157 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		_tmp51_ = removed;
#line 157 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		_tmp52_ = gee_iterable_iterator ((GeeIterable*) _tmp51_);
#line 157 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		_i_it = _tmp52_;
#line 157 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		while (TRUE) {
#line 793 "avatar-updates.c"
			GeeIterator* _tmp53_;
			gboolean _tmp54_ = FALSE;
			GeeIterator* _tmp55_;
			gpointer _tmp56_ = NULL;
			FolksIndividual* i;
			FolksIndividual* _tmp57_;
#line 157 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
			_tmp53_ = _i_it;
#line 157 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
			_tmp54_ = gee_iterator_next (_tmp53_);
#line 157 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
			if (!_tmp54_) {
#line 157 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
				break;
#line 808 "avatar-updates.c"
			}
#line 157 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
			_tmp55_ = _i_it;
#line 157 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
			_tmp56_ = gee_iterator_get (_tmp55_);
#line 157 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
			i = (FolksIndividual*) _tmp56_;
#line 159 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
			_tmp57_ = i;
#line 159 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
			g_assert (_tmp57_ == NULL);
#line 157 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
			_g_object_unref0 (i);
#line 822 "avatar-updates.c"
		}
#line 157 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		_g_object_unref0 (_i_it);
#line 826 "avatar-updates.c"
	}
#line 115 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_g_object_unref0 (removed);
#line 115 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_g_object_unref0 (added);
#line 832 "avatar-updates.c"
}


static void _avatar_updates_tests_notify_avatar_cb (AvatarUpdatesTests* self) {
	FolksIndividualAggregator* _tmp0_;
	GeeMap* _tmp1_;
	GeeMap* _tmp2_;
	const gchar* _tmp3_;
	gpointer _tmp4_ = NULL;
	FolksIndividual* i;
	FolksIndividual* _tmp5_;
	gboolean _tmp6_ = FALSE;
	FolksIndividual* _tmp7_;
	GLoadableIcon* _tmp8_;
	GLoadableIcon* _tmp9_;
	gboolean _tmp15_;
#line 163 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	g_return_if_fail (self != NULL);
#line 165 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp0_ = self->priv->_aggregator;
#line 165 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp1_ = folks_individual_aggregator_get_individuals (_tmp0_);
#line 165 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp2_ = _tmp1_;
#line 165 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp3_ = self->priv->_individual_id;
#line 165 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp4_ = gee_map_get (_tmp2_, _tmp3_);
#line 165 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	i = (FolksIndividual*) _tmp4_;
#line 166 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp5_ = i;
#line 166 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	if (_tmp5_ == NULL) {
#line 167 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		_g_object_unref0 (i);
#line 167 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		return;
#line 871 "avatar-updates.c"
	}
#line 169 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp7_ = i;
#line 169 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp8_ = folks_avatar_details_get_avatar ((FolksAvatarDetails*) _tmp7_);
#line 169 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp9_ = _tmp8_;
#line 169 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	if (_tmp9_ != NULL) {
#line 881 "avatar-updates.c"
		FolksIndividual* _tmp10_;
		GLoadableIcon* _tmp11_;
		GLoadableIcon* _tmp12_;
		GLoadableIcon* _tmp13_;
		gboolean _tmp14_ = FALSE;
#line 170 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		_tmp10_ = i;
#line 170 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		_tmp11_ = folks_avatar_details_get_avatar ((FolksAvatarDetails*) _tmp10_);
#line 170 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		_tmp12_ = _tmp11_;
#line 170 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		_tmp13_ = self->priv->_updated_avatar;
#line 170 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		_tmp14_ = g_icon_equal ((GIcon*) _tmp12_, (GIcon*) _tmp13_);
#line 170 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		_tmp6_ = _tmp14_;
#line 899 "avatar-updates.c"
	} else {
#line 169 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		_tmp6_ = FALSE;
#line 903 "avatar-updates.c"
	}
#line 169 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp15_ = _tmp6_;
#line 169 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	if (_tmp15_) {
#line 909 "avatar-updates.c"
		GMainLoop* _tmp16_;
#line 172 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		_tmp16_ = self->priv->_main_loop;
#line 172 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		g_main_loop_quit (_tmp16_);
#line 173 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
		self->priv->_updated_avatar_found = TRUE;
#line 917 "avatar-updates.c"
	}
#line 163 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_g_object_unref0 (i);
#line 921 "avatar-updates.c"
}


static void avatar_updates_tests_class_init (AvatarUpdatesTestsClass * klass) {
#line 26 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	avatar_updates_tests_parent_class = g_type_class_peek_parent (klass);
#line 26 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	g_type_class_add_private (klass, sizeof (AvatarUpdatesTestsPrivate));
#line 26 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	FOLKS_TEST_CASE_CLASS (klass)->set_up = avatar_updates_tests_real_set_up;
#line 26 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	FOLKS_TEST_CASE_CLASS (klass)->tear_down = avatar_updates_tests_real_tear_down;
#line 26 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	G_OBJECT_CLASS (klass)->finalize = avatar_updates_tests_finalize;
#line 936 "avatar-updates.c"
}


static void avatar_updates_tests_instance_init (AvatarUpdatesTests * self) {
#line 26 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	self->priv = AVATAR_UPDATES_TESTS_GET_PRIVATE (self);
#line 943 "avatar-updates.c"
}


static void avatar_updates_tests_finalize (GObject* obj) {
	AvatarUpdatesTests * self;
#line 26 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	self = AVATAR_UPDATES_TESTS (obj);
#line 28 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tracker_test_backend_unref0 (self->priv->_tracker_backend);
#line 29 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_g_object_unref0 (self->priv->_aggregator);
#line 31 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_g_free0 (self->priv->_updated_avatar_uri);
#line 32 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_g_object_unref0 (self->priv->_updated_avatar);
#line 33 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_g_free0 (self->priv->_individual_id);
#line 34 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_g_main_loop_unref0 (self->priv->_main_loop);
#line 36 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_g_free0 (self->priv->_initial_fullname);
#line 37 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_g_free0 (self->priv->_initial_avatar_uri);
#line 38 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_g_free0 (self->priv->_contact_urn);
#line 39 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_g_free0 (self->priv->_photo_urn);
#line 26 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	G_OBJECT_CLASS (avatar_updates_tests_parent_class)->finalize (obj);
#line 973 "avatar-updates.c"
}


GType avatar_updates_tests_get_type (void) {
	static volatile gsize avatar_updates_tests_type_id__volatile = 0;
	if (g_once_init_enter (&avatar_updates_tests_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (AvatarUpdatesTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) avatar_updates_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (AvatarUpdatesTests), 0, (GInstanceInitFunc) avatar_updates_tests_instance_init, NULL };
		GType avatar_updates_tests_type_id;
		avatar_updates_tests_type_id = g_type_register_static (FOLKS_TYPE_TEST_CASE, "AvatarUpdatesTests", &g_define_type_info, 0);
		g_once_init_leave (&avatar_updates_tests_type_id__volatile, avatar_updates_tests_type_id);
	}
	return avatar_updates_tests_type_id__volatile;
}


gint _vala_main (gchar** args, int args_length1) {
	gint result = 0;
	GTestSuite* _tmp0_ = NULL;
	GTestSuite* root;
	AvatarUpdatesTests* _tmp1_;
	AvatarUpdatesTests* _tmp2_;
	GTestSuite* _tmp3_ = NULL;
#line 180 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	g_test_init (&args_length1, &args, NULL);
#line 182 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp0_ = g_test_get_root ();
#line 182 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	root = _tmp0_;
#line 183 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp1_ = avatar_updates_tests_new ();
#line 183 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp2_ = _tmp1_;
#line 183 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_tmp3_ = folks_test_case_get_suite ((FolksTestCase*) _tmp2_);
#line 183 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	g_test_suite_add_suite (root, _tmp3_);
#line 183 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	_g_object_unref0 (_tmp2_);
#line 185 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	g_test_run ();
#line 187 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	result = 0;
#line 187 "/debian/rgs/devel/folks/tests/tracker/avatar-updates.vala"
	return result;
#line 1018 "avatar-updates.c"
}


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



