/* individual-retrieval.c generated by valac 0.26.0.36-540e, the Vala compiler
 * generated from individual-retrieval.vala, do not modify */

/*
 * Copyright (C) 2011, 2013 Collabora Ltd.
 * Copyright (C) 2013 Philip Withnall
 *
 * 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: Travis Reitter <travis.reitter@collabora.co.uk>
 *          Philip Withnall <philip@tecnocode.co.uk>
 */

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


#define TYPE_INDIVIDUAL_RETRIEVAL_TESTS (individual_retrieval_tests_get_type ())
#define INDIVIDUAL_RETRIEVAL_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_INDIVIDUAL_RETRIEVAL_TESTS, IndividualRetrievalTests))
#define INDIVIDUAL_RETRIEVAL_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_INDIVIDUAL_RETRIEVAL_TESTS, IndividualRetrievalTestsClass))
#define IS_INDIVIDUAL_RETRIEVAL_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_INDIVIDUAL_RETRIEVAL_TESTS))
#define IS_INDIVIDUAL_RETRIEVAL_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_INDIVIDUAL_RETRIEVAL_TESTS))
#define INDIVIDUAL_RETRIEVAL_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_INDIVIDUAL_RETRIEVAL_TESTS, IndividualRetrievalTestsClass))

typedef struct _IndividualRetrievalTests IndividualRetrievalTests;
typedef struct _IndividualRetrievalTestsClass IndividualRetrievalTestsClass;
typedef struct _IndividualRetrievalTestsPrivate IndividualRetrievalTestsPrivate;
typedef struct _Block1Data Block1Data;
#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)))
typedef struct _Block2Data Block2Data;
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _IndividualRetrievalTests {
	KfTestTestCase parent_instance;
	IndividualRetrievalTestsPrivate * priv;
};

struct _IndividualRetrievalTestsClass {
	KfTestTestCaseClass parent_class;
};

struct _Block1Data {
	int _ref_count_;
	IndividualRetrievalTests* self;
	GMainLoop* main_loop;
	GeeHashSet* expected_individuals;
};

struct _Block2Data {
	int _ref_count_;
	IndividualRetrievalTests* self;
	GMainLoop* main_loop;
	guint individuals_changed_count;
};


static gpointer individual_retrieval_tests_parent_class = NULL;

GType individual_retrieval_tests_get_type (void) G_GNUC_CONST;
enum  {
	INDIVIDUAL_RETRIEVAL_TESTS_DUMMY_PROPERTY
};
IndividualRetrievalTests* individual_retrieval_tests_new (void);
IndividualRetrievalTests* individual_retrieval_tests_construct (GType object_type);
void individual_retrieval_tests_test_singleton_individuals (IndividualRetrievalTests* self);
static void _individual_retrieval_tests_test_singleton_individuals_folks_test_case_test_method (gpointer self);
void individual_retrieval_tests_test_aliases (IndividualRetrievalTests* self);
static void _individual_retrieval_tests_test_aliases_folks_test_case_test_method (gpointer self);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static void __lambda4_ (Block1Data* _data1_, GeeMultiMap* changes);
static void ___lambda4__folks_individual_aggregator_individuals_changed_detailed (FolksIndividualAggregator* _sender, GeeMultiMap* changes, gpointer self);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static void __lambda5_ (Block2Data* _data2_, GeeMultiMap* changes);
static void ___lambda5__folks_individual_aggregator_individuals_changed_detailed (FolksIndividualAggregator* _sender, GeeMultiMap* changes, gpointer self);
gint _vala_main (gchar** args, int args_length1);


static void _individual_retrieval_tests_test_singleton_individuals_folks_test_case_test_method (gpointer self) {
#line 32 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	individual_retrieval_tests_test_singleton_individuals ((IndividualRetrievalTests*) self);
#line 102 "individual-retrieval.c"
}


static void _individual_retrieval_tests_test_aliases_folks_test_case_test_method (gpointer self) {
#line 33 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	individual_retrieval_tests_test_aliases ((IndividualRetrievalTests*) self);
#line 109 "individual-retrieval.c"
}


IndividualRetrievalTests* individual_retrieval_tests_construct (GType object_type) {
	IndividualRetrievalTests * self = NULL;
#line 30 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	self = (IndividualRetrievalTests*) kf_test_test_case_construct (object_type, "IndividualRetrieval");
#line 32 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	folks_test_case_add_test ((FolksTestCase*) self, "singleton individuals", _individual_retrieval_tests_test_singleton_individuals_folks_test_case_test_method, self);
#line 33 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	folks_test_case_add_test ((FolksTestCase*) self, "aliases", _individual_retrieval_tests_test_aliases_folks_test_case_test_method, self);
#line 28 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	return self;
#line 123 "individual-retrieval.c"
}


IndividualRetrievalTests* individual_retrieval_tests_new (void) {
#line 28 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	return individual_retrieval_tests_construct (TYPE_INDIVIDUAL_RETRIEVAL_TESTS);
#line 130 "individual-retrieval.c"
}


static Block1Data* block1_data_ref (Block1Data* _data1_) {
#line 36 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	g_atomic_int_inc (&_data1_->_ref_count_);
#line 36 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	return _data1_;
#line 139 "individual-retrieval.c"
}


static void block1_data_unref (void * _userdata_) {
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
#line 36 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
#line 148 "individual-retrieval.c"
		IndividualRetrievalTests* self;
#line 36 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
		self = _data1_->self;
#line 36 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
		_g_object_unref0 (_data1_->expected_individuals);
#line 36 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
		_g_main_loop_unref0 (_data1_->main_loop);
#line 36 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
		_g_object_unref0 (self);
#line 36 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
		g_slice_free (Block1Data, _data1_);
#line 160 "individual-retrieval.c"
	}
}


static void __lambda4_ (Block1Data* _data1_, GeeMultiMap* changes) {
	IndividualRetrievalTests* self;
	GeeCollection* added = NULL;
	GeeMultiMap* _tmp0_ = NULL;
	GeeCollection* _tmp1_ = NULL;
	GeeSet* removed = NULL;
	GeeMultiMap* _tmp2_ = NULL;
	GeeSet* _tmp3_ = NULL;
	GeeSet* _tmp27_ = NULL;
	gint _tmp28_ = 0;
	gint _tmp29_ = 0;
	gint _tmp37_ = 0;
	gint _tmp38_ = 0;
#line 54 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	self = _data1_->self;
#line 54 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	g_return_if_fail (changes != NULL);
#line 56 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_tmp0_ = changes;
#line 56 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_tmp1_ = gee_multi_map_get_values (_tmp0_);
#line 56 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	added = _tmp1_;
#line 57 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_tmp2_ = changes;
#line 57 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_tmp3_ = gee_multi_map_get_keys (_tmp2_);
#line 57 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	removed = _tmp3_;
#line 194 "individual-retrieval.c"
	{
		GeeIterator* _i_it = NULL;
		GeeCollection* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
#line 59 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
		_tmp4_ = added;
#line 59 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
#line 59 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
		_i_it = _tmp5_;
#line 59 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
		while (TRUE) {
#line 207 "individual-retrieval.c"
			GeeIterator* _tmp6_ = NULL;
			gboolean _tmp7_ = FALSE;
			FolksIndividual* i = NULL;
			GeeIterator* _tmp8_ = NULL;
			gpointer _tmp9_ = NULL;
			FolksIndividual* _tmp10_ = NULL;
			FolksIndividual* _tmp11_ = NULL;
			GeeSet* _tmp12_ = NULL;
			GeeSet* _tmp13_ = NULL;
			gint _tmp14_ = 0;
			gint _tmp15_ = 0;
#line 59 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_tmp6_ = _i_it;
#line 59 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_tmp7_ = gee_iterator_next (_tmp6_);
#line 59 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			if (!_tmp7_) {
#line 59 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
				break;
#line 227 "individual-retrieval.c"
			}
#line 59 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_tmp8_ = _i_it;
#line 59 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_tmp9_ = gee_iterator_get (_tmp8_);
#line 59 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			i = (FolksIndividual*) _tmp9_;
#line 61 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_tmp10_ = i;
#line 61 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_vala_assert (_tmp10_ != NULL, "i != null");
#line 62 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_tmp11_ = i;
#line 62 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_tmp12_ = folks_individual_get_personas (_tmp11_);
#line 62 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_tmp13_ = _tmp12_;
#line 62 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_tmp14_ = gee_collection_get_size ((GeeCollection*) _tmp13_);
#line 62 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_tmp15_ = _tmp14_;
#line 62 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_vala_assert (_tmp15_ == 1, "i.personas.size == 1");
#line 251 "individual-retrieval.c"
			{
				GeeIterator* _persona_it = NULL;
				FolksIndividual* _tmp16_ = NULL;
				GeeSet* _tmp17_ = NULL;
				GeeSet* _tmp18_ = NULL;
				GeeIterator* _tmp19_ = NULL;
#line 67 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
				_tmp16_ = i;
#line 67 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
				_tmp17_ = folks_individual_get_personas (_tmp16_);
#line 67 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
				_tmp18_ = _tmp17_;
#line 67 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
				_tmp19_ = gee_iterable_iterator ((GeeIterable*) _tmp18_);
#line 67 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
				_persona_it = _tmp19_;
#line 67 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
				while (TRUE) {
#line 270 "individual-retrieval.c"
					GeeIterator* _tmp20_ = NULL;
					gboolean _tmp21_ = FALSE;
					FolksPersona* persona = NULL;
					GeeIterator* _tmp22_ = NULL;
					gpointer _tmp23_ = NULL;
					FolksPersona* _tmp24_ = NULL;
					const gchar* _tmp25_ = NULL;
					const gchar* _tmp26_ = NULL;
#line 67 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
					_tmp20_ = _persona_it;
#line 67 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
					_tmp21_ = gee_iterator_next (_tmp20_);
#line 67 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
					if (!_tmp21_) {
#line 67 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
						break;
#line 287 "individual-retrieval.c"
					}
#line 67 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
					_tmp22_ = _persona_it;
#line 67 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
					_tmp23_ = gee_iterator_get (_tmp22_);
#line 67 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
					persona = (FolksPersona*) _tmp23_;
#line 69 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
					_tmp24_ = persona;
#line 69 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
					_tmp25_ = folks_persona_get_display_id (_tmp24_);
#line 69 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
					_tmp26_ = _tmp25_;
#line 69 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
					gee_abstract_collection_remove ((GeeAbstractCollection*) _data1_->expected_individuals, _tmp26_);
#line 67 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
					_g_object_unref0 (persona);
#line 305 "individual-retrieval.c"
				}
#line 67 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
				_g_object_unref0 (_persona_it);
#line 309 "individual-retrieval.c"
			}
#line 59 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_g_object_unref0 (i);
#line 313 "individual-retrieval.c"
		}
#line 59 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
		_g_object_unref0 (_i_it);
#line 317 "individual-retrieval.c"
	}
#line 73 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_tmp27_ = removed;
#line 73 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_tmp28_ = gee_collection_get_size ((GeeCollection*) _tmp27_);
#line 73 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_tmp29_ = _tmp28_;
#line 73 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_vala_assert (_tmp29_ == 1, "removed.size == 1");
#line 327 "individual-retrieval.c"
	{
		GeeIterator* _i_it = NULL;
		GeeSet* _tmp30_ = NULL;
		GeeIterator* _tmp31_ = NULL;
#line 75 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
		_tmp30_ = removed;
#line 75 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
		_tmp31_ = gee_iterable_iterator ((GeeIterable*) _tmp30_);
#line 75 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
		_i_it = _tmp31_;
#line 75 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
		while (TRUE) {
#line 340 "individual-retrieval.c"
			GeeIterator* _tmp32_ = NULL;
			gboolean _tmp33_ = FALSE;
			FolksIndividual* i = NULL;
			GeeIterator* _tmp34_ = NULL;
			gpointer _tmp35_ = NULL;
			FolksIndividual* _tmp36_ = NULL;
#line 75 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_tmp32_ = _i_it;
#line 75 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_tmp33_ = gee_iterator_next (_tmp32_);
#line 75 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			if (!_tmp33_) {
#line 75 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
				break;
#line 355 "individual-retrieval.c"
			}
#line 75 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_tmp34_ = _i_it;
#line 75 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_tmp35_ = gee_iterator_get (_tmp34_);
#line 75 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			i = (FolksIndividual*) _tmp35_;
#line 77 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_tmp36_ = i;
#line 77 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_vala_assert (_tmp36_ == NULL, "i == null");
#line 75 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_g_object_unref0 (i);
#line 369 "individual-retrieval.c"
		}
#line 75 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
		_g_object_unref0 (_i_it);
#line 373 "individual-retrieval.c"
	}
#line 81 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_tmp37_ = gee_abstract_collection_get_size ((GeeCollection*) _data1_->expected_individuals);
#line 81 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_tmp38_ = _tmp37_;
#line 81 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	if (_tmp38_ == 0) {
#line 82 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
		g_main_loop_quit (_data1_->main_loop);
#line 383 "individual-retrieval.c"
	}
#line 54 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_g_object_unref0 (removed);
#line 54 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_g_object_unref0 (added);
#line 389 "individual-retrieval.c"
}


static void ___lambda4__folks_individual_aggregator_individuals_changed_detailed (FolksIndividualAggregator* _sender, GeeMultiMap* changes, gpointer self) {
#line 54 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	__lambda4_ (self, changes);
#line 396 "individual-retrieval.c"
}


void individual_retrieval_tests_test_singleton_individuals (IndividualRetrievalTests* self) {
	Block1Data* _data1_;
	GMainLoop* _tmp0_ = NULL;
	KfTestBackend* _tmp1_ = NULL;
	GeeHashSet* _tmp2_ = NULL;
	FolksIndividualAggregator* aggregator = NULL;
	FolksIndividualAggregator* _tmp3_ = NULL;
	gint _tmp4_ = 0;
	gint _tmp5_ = 0;
	KfTestBackend* _tmp6_ = NULL;
#line 36 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	g_return_if_fail (self != NULL);
#line 36 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_data1_ = g_slice_new0 (Block1Data);
#line 36 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_data1_->_ref_count_ = 1;
#line 36 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_data1_->self = g_object_ref (self);
#line 38 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_tmp0_ = g_main_loop_new (NULL, FALSE);
#line 38 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_data1_->main_loop = _tmp0_;
#line 39 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_tmp1_ = ((KfTestTestCase*) self)->kf_backend;
#line 39 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	kf_test_backend_set_up (_tmp1_, "[0]\n" "msn=foo@hotmail.com\n" "[1]\n" "__alias=Bar McBadgerson\n" "jabber=bar@jabber.org\n");
#line 47 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_tmp2_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL, NULL, NULL);
#line 47 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_data1_->expected_individuals = _tmp2_;
#line 49 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	gee_abstract_collection_add ((GeeAbstractCollection*) _data1_->expected_individuals, "0");
#line 50 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	gee_abstract_collection_add ((GeeAbstractCollection*) _data1_->expected_individuals, "1");
#line 53 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_tmp3_ = folks_individual_aggregator_dup ();
#line 53 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	aggregator = _tmp3_;
#line 54 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	g_signal_connect_data (aggregator, "individuals-changed-detailed", (GCallback) ___lambda4__folks_individual_aggregator_individuals_changed_detailed, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
#line 84 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	folks_individual_aggregator_prepare (aggregator, NULL, NULL);
#line 89 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	folks_test_utils_loop_run_with_timeout (_data1_->main_loop, 3);
#line 92 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_tmp4_ = gee_abstract_collection_get_size ((GeeCollection*) _data1_->expected_individuals);
#line 92 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_tmp5_ = _tmp4_;
#line 92 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_vala_assert (_tmp5_ == 0, "expected_individuals.size == 0");
#line 94 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_tmp6_ = ((KfTestTestCase*) self)->kf_backend;
#line 94 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	kf_test_backend_tear_down (_tmp6_);
#line 36 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_g_object_unref0 (aggregator);
#line 36 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	block1_data_unref (_data1_);
#line 36 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_data1_ = NULL;
#line 460 "individual-retrieval.c"
}


static Block2Data* block2_data_ref (Block2Data* _data2_) {
#line 97 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	g_atomic_int_inc (&_data2_->_ref_count_);
#line 97 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	return _data2_;
#line 469 "individual-retrieval.c"
}


static void block2_data_unref (void * _userdata_) {
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
#line 97 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
#line 478 "individual-retrieval.c"
		IndividualRetrievalTests* self;
#line 97 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
		self = _data2_->self;
#line 97 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
		_g_main_loop_unref0 (_data2_->main_loop);
#line 97 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
		_g_object_unref0 (self);
#line 97 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
		g_slice_free (Block2Data, _data2_);
#line 488 "individual-retrieval.c"
	}
}


static void __lambda5_ (Block2Data* _data2_, GeeMultiMap* changes) {
	IndividualRetrievalTests* self;
	GeeCollection* added = NULL;
	GeeMultiMap* _tmp0_ = NULL;
	GeeCollection* _tmp1_ = NULL;
	GeeSet* removed = NULL;
	GeeMultiMap* _tmp2_ = NULL;
	GeeSet* _tmp3_ = NULL;
	guint _tmp4_ = 0U;
	GeeCollection* _tmp5_ = NULL;
	gint _tmp6_ = 0;
	gint _tmp7_ = 0;
	GeeSet* _tmp8_ = NULL;
	gint _tmp9_ = 0;
	gint _tmp10_ = 0;
#line 108 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	self = _data2_->self;
#line 108 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	g_return_if_fail (changes != NULL);
#line 110 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_tmp0_ = changes;
#line 110 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_tmp1_ = gee_multi_map_get_values (_tmp0_);
#line 110 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	added = _tmp1_;
#line 111 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_tmp2_ = changes;
#line 111 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_tmp3_ = gee_multi_map_get_keys (_tmp2_);
#line 111 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	removed = _tmp3_;
#line 113 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_tmp4_ = _data2_->individuals_changed_count;
#line 113 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_data2_->individuals_changed_count = _tmp4_ + 1;
#line 115 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_tmp5_ = added;
#line 115 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_tmp6_ = gee_collection_get_size (_tmp5_);
#line 115 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_tmp7_ = _tmp6_;
#line 115 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_vala_assert (_tmp7_ == 1, "added.size == 1");
#line 116 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_tmp8_ = removed;
#line 116 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_tmp9_ = gee_collection_get_size ((GeeCollection*) _tmp8_);
#line 116 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_tmp10_ = _tmp9_;
#line 116 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_vala_assert (_tmp10_ == 1, "removed.size == 1");
#line 544 "individual-retrieval.c"
	{
		GeeIterator* _i_it = NULL;
		GeeCollection* _tmp11_ = NULL;
		GeeIterator* _tmp12_ = NULL;
#line 119 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
		_tmp11_ = added;
#line 119 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
		_tmp12_ = gee_iterable_iterator ((GeeIterable*) _tmp11_);
#line 119 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
		_i_it = _tmp12_;
#line 119 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
		while (TRUE) {
#line 557 "individual-retrieval.c"
			GeeIterator* _tmp13_ = NULL;
			gboolean _tmp14_ = FALSE;
			FolksIndividual* i = NULL;
			GeeIterator* _tmp15_ = NULL;
			gpointer _tmp16_ = NULL;
			FolksIndividual* _tmp17_ = NULL;
			const gchar* _tmp18_ = NULL;
			const gchar* _tmp19_ = NULL;
#line 119 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_tmp13_ = _i_it;
#line 119 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_tmp14_ = gee_iterator_next (_tmp13_);
#line 119 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			if (!_tmp14_) {
#line 119 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
				break;
#line 574 "individual-retrieval.c"
			}
#line 119 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_tmp15_ = _i_it;
#line 119 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_tmp16_ = gee_iterator_get (_tmp15_);
#line 119 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			i = (FolksIndividual*) _tmp16_;
#line 121 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_tmp17_ = i;
#line 121 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_tmp18_ = folks_alias_details_get_alias ((FolksAliasDetails*) _tmp17_);
#line 121 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_tmp19_ = _tmp18_;
#line 121 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_vala_assert (g_strcmp0 (_tmp19_, "Brian Briansson") == 0, "i.alias == \"Brian Briansson\"");
#line 119 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_g_object_unref0 (i);
#line 592 "individual-retrieval.c"
		}
#line 119 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
		_g_object_unref0 (_i_it);
#line 596 "individual-retrieval.c"
	}
	{
		GeeIterator* _i_it = NULL;
		GeeSet* _tmp20_ = NULL;
		GeeIterator* _tmp21_ = NULL;
#line 124 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
		_tmp20_ = removed;
#line 124 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
		_tmp21_ = gee_iterable_iterator ((GeeIterable*) _tmp20_);
#line 124 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
		_i_it = _tmp21_;
#line 124 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
		while (TRUE) {
#line 610 "individual-retrieval.c"
			GeeIterator* _tmp22_ = NULL;
			gboolean _tmp23_ = FALSE;
			FolksIndividual* i = NULL;
			GeeIterator* _tmp24_ = NULL;
			gpointer _tmp25_ = NULL;
			FolksIndividual* _tmp26_ = NULL;
#line 124 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_tmp22_ = _i_it;
#line 124 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_tmp23_ = gee_iterator_next (_tmp22_);
#line 124 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			if (!_tmp23_) {
#line 124 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
				break;
#line 625 "individual-retrieval.c"
			}
#line 124 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_tmp24_ = _i_it;
#line 124 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_tmp25_ = gee_iterator_get (_tmp24_);
#line 124 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			i = (FolksIndividual*) _tmp25_;
#line 126 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_tmp26_ = i;
#line 126 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_vala_assert (_tmp26_ == NULL, "i == null");
#line 124 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
			_g_object_unref0 (i);
#line 639 "individual-retrieval.c"
		}
#line 124 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
		_g_object_unref0 (_i_it);
#line 643 "individual-retrieval.c"
	}
#line 130 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	if (_data2_->individuals_changed_count == ((guint) 1)) {
#line 131 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
		g_main_loop_quit (_data2_->main_loop);
#line 649 "individual-retrieval.c"
	}
#line 108 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_g_object_unref0 (removed);
#line 108 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_g_object_unref0 (added);
#line 655 "individual-retrieval.c"
}


static void ___lambda5__folks_individual_aggregator_individuals_changed_detailed (FolksIndividualAggregator* _sender, GeeMultiMap* changes, gpointer self) {
#line 108 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	__lambda5_ (self, changes);
#line 662 "individual-retrieval.c"
}


void individual_retrieval_tests_test_aliases (IndividualRetrievalTests* self) {
	Block2Data* _data2_;
	GMainLoop* _tmp0_ = NULL;
	KfTestBackend* _tmp1_ = NULL;
	FolksIndividualAggregator* aggregator = NULL;
	FolksIndividualAggregator* _tmp2_ = NULL;
	KfTestBackend* _tmp3_ = NULL;
#line 97 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	g_return_if_fail (self != NULL);
#line 97 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_data2_ = g_slice_new0 (Block2Data);
#line 97 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_data2_->_ref_count_ = 1;
#line 97 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_data2_->self = g_object_ref (self);
#line 99 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_tmp0_ = g_main_loop_new (NULL, FALSE);
#line 99 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_data2_->main_loop = _tmp0_;
#line 100 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_tmp1_ = ((KfTestTestCase*) self)->kf_backend;
#line 100 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	kf_test_backend_set_up (_tmp1_, "[0]\n" "__alias=Brian Briansson\n" "msn=foo@hotmail.com\n");
#line 106 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_tmp2_ = folks_individual_aggregator_dup ();
#line 106 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	aggregator = _tmp2_;
#line 107 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_data2_->individuals_changed_count = (guint) 0;
#line 108 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	g_signal_connect_data (aggregator, "individuals-changed-detailed", (GCallback) ___lambda5__folks_individual_aggregator_individuals_changed_detailed, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
#line 133 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	folks_individual_aggregator_prepare (aggregator, NULL, NULL);
#line 138 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	folks_test_utils_loop_run_with_timeout (_data2_->main_loop, 3);
#line 141 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_vala_assert (_data2_->individuals_changed_count == ((guint) 1), "individuals_changed_count == 1");
#line 143 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_tmp3_ = ((KfTestTestCase*) self)->kf_backend;
#line 143 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	kf_test_backend_tear_down (_tmp3_);
#line 97 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_g_object_unref0 (aggregator);
#line 97 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	block2_data_unref (_data2_);
#line 97 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_data2_ = NULL;
#line 713 "individual-retrieval.c"
}


static void individual_retrieval_tests_class_init (IndividualRetrievalTestsClass * klass) {
#line 26 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	individual_retrieval_tests_parent_class = g_type_class_peek_parent (klass);
#line 720 "individual-retrieval.c"
}


static void individual_retrieval_tests_instance_init (IndividualRetrievalTests * self) {
}


GType individual_retrieval_tests_get_type (void) {
	static volatile gsize individual_retrieval_tests_type_id__volatile = 0;
	if (g_once_init_enter (&individual_retrieval_tests_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (IndividualRetrievalTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) individual_retrieval_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (IndividualRetrievalTests), 0, (GInstanceInitFunc) individual_retrieval_tests_instance_init, NULL };
		GType individual_retrieval_tests_type_id;
		individual_retrieval_tests_type_id = g_type_register_static (KF_TEST_TYPE_TEST_CASE, "IndividualRetrievalTests", &g_define_type_info, 0);
		g_once_init_leave (&individual_retrieval_tests_type_id__volatile, individual_retrieval_tests_type_id);
	}
	return individual_retrieval_tests_type_id__volatile;
}


gint _vala_main (gchar** args, int args_length1) {
	gint result = 0;
	IndividualRetrievalTests* tests = NULL;
	IndividualRetrievalTests* _tmp0_ = NULL;
#line 149 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	g_test_init (&args_length1, &args, NULL);
#line 151 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_tmp0_ = individual_retrieval_tests_new ();
#line 151 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	tests = _tmp0_;
#line 152 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	folks_test_case_register ((FolksTestCase*) tests);
#line 153 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	g_test_run ();
#line 154 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	folks_test_case_final_tear_down ((FolksTestCase*) tests);
#line 156 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	result = 0;
#line 156 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	_g_object_unref0 (tests);
#line 156 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	return result;
#line 762 "individual-retrieval.c"
}


int main (int argc, char ** argv) {
#if !GLIB_CHECK_VERSION (2,35,0)
	g_type_init ();
#endif
#line 147 "/opt/gnome3/source/folks/tests/key-file/individual-retrieval.vala"
	return _vala_main (argv, argc);
#line 772 "individual-retrieval.c"
}



