/* add-contacts-stress-test.c generated by valac 0.14.0.15-f8b5, the Vala compiler
 * generated from add-contacts-stress-test.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 <eds-test.h>
#include <folks/folks.h>
#include <folks/folks-eds.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <stdio.h>
#include <gee.h>


#define TYPE_ADD_CONTACTS_STRESS_TEST_TESTS (add_contacts_stress_test_tests_get_type ())
#define ADD_CONTACTS_STRESS_TEST_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ADD_CONTACTS_STRESS_TEST_TESTS, AddContactsStressTestTests))
#define ADD_CONTACTS_STRESS_TEST_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ADD_CONTACTS_STRESS_TEST_TESTS, AddContactsStressTestTestsClass))
#define IS_ADD_CONTACTS_STRESS_TEST_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ADD_CONTACTS_STRESS_TEST_TESTS))
#define IS_ADD_CONTACTS_STRESS_TEST_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ADD_CONTACTS_STRESS_TEST_TESTS))
#define ADD_CONTACTS_STRESS_TEST_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ADD_CONTACTS_STRESS_TEST_TESTS, AddContactsStressTestTestsClass))

typedef struct _AddContactsStressTestTests AddContactsStressTestTests;
typedef struct _AddContactsStressTestTestsClass AddContactsStressTestTestsClass;
typedef struct _AddContactsStressTestTestsPrivate AddContactsStressTestTestsPrivate;
#define _g_main_loop_unref0(var) ((var == NULL) ? NULL : (var = (g_main_loop_unref (var), NULL)))
#define _eds_test_backend_unref0(var) ((var == NULL) ? NULL : (var = (eds_test_backend_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _AddContactsStressTestTestsTestAddPersonaAsyncData AddContactsStressTestTestsTestAddPersonaAsyncData;
#define __vala_GValue_free0(var) ((var == NULL) ? NULL : (var = (_vala_GValue_free (var), NULL)))
typedef struct _AddContactsStressTestTestsAddContactsData AddContactsStressTestTestsAddContactsData;

struct _AddContactsStressTestTests {
	FolksTestCase parent_instance;
	AddContactsStressTestTestsPrivate * priv;
};

struct _AddContactsStressTestTestsClass {
	FolksTestCaseClass parent_class;
};

struct _AddContactsStressTestTestsPrivate {
	GMainLoop* _main_loop;
	EdsTestBackend* _eds_backend;
	FolksIndividualAggregator* _aggregator;
	EdsfPersonaStore* _pstore;
	gboolean _added_contacts;
	GStaticRecMutex __lock__added_contacts;
	GHashTable* _contacts_found;
	gint _contacts_cnt;
	GDateTime* _start_time;
};

struct _AddContactsStressTestTestsTestAddPersonaAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	AddContactsStressTestTests* self;
	FolksBackendStore* _tmp0_;
	FolksBackendStore* store;
	FolksIndividualAggregator* _tmp1_;
	FolksIndividualAggregator* _tmp2_;
	FolksIndividualAggregator* _tmp3_;
	GeeMap* _tmp4_;
	GeeMap* _tmp5_;
	GeeCollection* _tmp6_;
	GeeCollection* _tmp7_;
	GeeCollection* _tmp8_;
	GeeIterator* _tmp9_;
	GeeIterator* _tmp10_;
	GeeIterator* _backend_it;
	GeeIterator* _tmp11_;
	gboolean _tmp12_;
	GeeIterator* _tmp13_;
	gpointer _tmp14_;
	FolksBackend* backend;
	FolksBackend* _tmp15_;
	GeeMap* _tmp16_;
	GeeMap* _tmp17_;
	EdsTestBackend* _tmp18_;
	const gchar* _tmp19_;
	const gchar* _tmp20_;
	gpointer _tmp21_;
	EdsfPersonaStore* _tmp22_;
	EdsfPersonaStore* _tmp23_;
	EdsfPersonaStore* _tmp24_;
	GError* e;
	GError* _tmp25_;
	const gchar* _tmp26_;
	GError * _inner_error_;
};

struct _AddContactsStressTestTestsAddContactsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	AddContactsStressTestTests* self;
	gint i;
	gboolean _tmp0_;
	gboolean _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	gchar* _tmp6_;
	gchar* persona_name;
	GHashFunc _tmp7_;
	GEqualFunc _tmp8_;
	GHashTable* _tmp9_;
	GHashTable* details;
	GValue _tmp10_;
	GValue _tmp11_;
	GValue* _tmp12_;
	GValue* _tmp13_;
	GValue* v1;
	GValue* _tmp14_;
	const gchar* _tmp15_;
	GHashTable* _tmp16_;
	const gchar* _tmp17_;
	gchar* _tmp18_;
	GValue* _tmp19_;
	FolksIndividualAggregator* _tmp20_;
	EdsfPersonaStore* _tmp21_;
	GHashTable* _tmp22_;
	FolksPersona* _tmp23_;
	FolksPersona* _tmp24_;
	GError* e;
	gint _tmp25_;
	GError* _tmp26_;
	const gchar* _tmp27_;
	GError * _inner_error_;
};


static gpointer add_contacts_stress_test_tests_parent_class = NULL;

GType add_contacts_stress_test_tests_get_type (void) G_GNUC_CONST;
#define ADD_CONTACTS_STRESS_TEST_TESTS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_ADD_CONTACTS_STRESS_TEST_TESTS, AddContactsStressTestTestsPrivate))
enum  {
	ADD_CONTACTS_STRESS_TEST_TESTS_DUMMY_PROPERTY
};
AddContactsStressTestTests* add_contacts_stress_test_tests_new (void);
AddContactsStressTestTests* add_contacts_stress_test_tests_construct (GType object_type);
void add_contacts_stress_test_tests_test_add_contacts (AddContactsStressTestTests* self);
static void _add_contacts_stress_test_tests_test_add_contacts_folks_test_case_test_method (gpointer self);
static void add_contacts_stress_test_tests_real_set_up (FolksTestCase* base);
static void add_contacts_stress_test_tests_real_tear_down (FolksTestCase* base);
static void _g_free0_ (gpointer var);
static void _add_contacts_stress_test_tests_test_add_persona_async (AddContactsStressTestTests* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _add_contacts_stress_test_tests_test_add_persona_finish (AddContactsStressTestTests* self, GAsyncResult* _res_);
static void _add_contacts_stress_test_tests_test_add_persona_async_data_free (gpointer _data);
static gboolean _add_contacts_stress_test_tests_test_add_persona_async_co (AddContactsStressTestTestsTestAddPersonaAsyncData* _data_);
static void _add_contacts_stress_test_tests_test_add_persona_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _add_contacts_stress_test_tests_individuals_changed_cb (AddContactsStressTestTests* self, GeeMultiMap* changes);
static void __add_contacts_stress_test_tests_individuals_changed_cb_folks_individual_aggregator_individuals_changed_detailed (FolksIndividualAggregator* _sender, GeeMultiMap* changes, gpointer self);
static void _add_contacts_stress_test_tests_notify_pstore_cb (AddContactsStressTestTests* self, GObject* _pstore, GParamSpec* ps);
static void __add_contacts_stress_test_tests_notify_pstore_cb_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void _add_contacts_stress_test_tests_try_to_add (AddContactsStressTestTests* self);
static void _add_contacts_stress_test_tests_add_contacts_data_free (gpointer _data);
static void _add_contacts_stress_test_tests_add_contacts (AddContactsStressTestTests* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _add_contacts_stress_test_tests_add_contacts_finish (AddContactsStressTestTests* self, GAsyncResult* _res_);
static gboolean _add_contacts_stress_test_tests_add_contacts_co (AddContactsStressTestTestsAddContactsData* _data_);
static void _vala_GValue_free (GValue* self);
static void __vala_GValue_free0_ (gpointer var);
static GValue* _g_value_dup (GValue* self);
static void _add_contacts_stress_test_tests_add_contacts_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _add_contacts_stress_test_tests_exit_if_all_contacts_found (AddContactsStressTestTests* self);
static void add_contacts_stress_test_tests_finalize (GObject* obj);
gint _vala_main (gchar** args, int args_length1);


static void _add_contacts_stress_test_tests_test_add_contacts_folks_test_case_test_method (gpointer self) {
#line 43 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	add_contacts_stress_test_tests_test_add_contacts (self);
#line 204 "add-contacts-stress-test.c"
}


AddContactsStressTestTests* add_contacts_stress_test_tests_construct (GType object_type) {
	AddContactsStressTestTests * self = NULL;
	EdsTestBackend* _tmp0_;
	gint _tmp1_;
	gchar* _tmp2_ = NULL;
	gchar* test_desc;
#line 37 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	self = (AddContactsStressTestTests*) folks_test_case_construct (object_type, "AddContactsStressTestTests");
#line 39 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp0_ = eds_test_backend_new ();
#line 39 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_eds_test_backend_unref0 (self->priv->_eds_backend);
#line 39 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	self->priv->_eds_backend = _tmp0_;
#line 41 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp1_ = self->priv->_contacts_cnt;
#line 41 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp2_ = g_strdup_printf ("stress testing adding (%d) contacts to e-d-s ", _tmp1_);
#line 41 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	test_desc = _tmp2_;
#line 43 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	folks_test_case_add_test ((FolksTestCase*) self, test_desc, _add_contacts_stress_test_tests_test_add_contacts_folks_test_case_test_method, self);
#line 35 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_g_free0 (test_desc);
#line 35 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	return self;
#line 234 "add-contacts-stress-test.c"
}


AddContactsStressTestTests* add_contacts_stress_test_tests_new (void) {
#line 35 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	return add_contacts_stress_test_tests_construct (TYPE_ADD_CONTACTS_STRESS_TEST_TESTS);
#line 241 "add-contacts-stress-test.c"
}


static void add_contacts_stress_test_tests_real_set_up (FolksTestCase* base) {
	AddContactsStressTestTests * self;
	EdsTestBackend* _tmp0_;
#line 46 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	self = (AddContactsStressTestTests*) base;
#line 48 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp0_ = self->priv->_eds_backend;
#line 48 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	eds_test_backend_set_up (_tmp0_, FALSE);
#line 254 "add-contacts-stress-test.c"
}


static void add_contacts_stress_test_tests_real_tear_down (FolksTestCase* base) {
	AddContactsStressTestTests * self;
	EdsTestBackend* _tmp0_;
#line 51 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	self = (AddContactsStressTestTests*) base;
#line 53 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp0_ = self->priv->_eds_backend;
#line 53 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	eds_test_backend_tear_down (_tmp0_);
#line 267 "add-contacts-stress-test.c"
}


static void _g_free0_ (gpointer var) {
#line 60 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	var = (g_free (var), NULL);
#line 274 "add-contacts-stress-test.c"
}


void add_contacts_stress_test_tests_test_add_contacts (AddContactsStressTestTests* self) {
	GMainLoop* _tmp0_;
	GHashFunc _tmp1_;
	GEqualFunc _tmp2_;
	GHashTable* _tmp3_;
	GDateTime* _tmp14_;
	GMainLoop* _tmp15_;
	GDateTime* _tmp16_;
	GDateTime* now;
	GDateTime* _tmp17_;
	GDateTime* _tmp18_;
	GTimeSpan _tmp19_ = 0LL;
	GTimeSpan difference;
	GTimeSpan _tmp20_;
	GTimeSpan diff;
	FILE* _tmp21_;
	GTimeSpan _tmp22_;
	GTimeSpan _tmp23_;
	gint found;
	GHashTable* _tmp24_;
	GList* _tmp25_ = NULL;
	gint _tmp28_;
	gint _tmp29_;
#line 56 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	g_return_if_fail (self != NULL);
#line 58 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp0_ = g_main_loop_new (NULL, FALSE);
#line 58 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_g_main_loop_unref0 (self->priv->_main_loop);
#line 58 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	self->priv->_main_loop = _tmp0_;
#line 60 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp1_ = g_str_hash;
#line 60 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp2_ = g_str_equal;
#line 60 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp3_ = g_hash_table_new_full (_tmp1_, _tmp2_, _g_free0_, NULL);
#line 60 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_g_hash_table_unref0 (self->priv->_contacts_found);
#line 60 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	self->priv->_contacts_found = _tmp3_;
#line 319 "add-contacts-stress-test.c"
	{
		gint i;
#line 61 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		i = 0;
#line 324 "add-contacts-stress-test.c"
		{
			gboolean _tmp4_;
#line 61 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp4_ = TRUE;
#line 61 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			while (TRUE) {
#line 331 "add-contacts-stress-test.c"
				gboolean _tmp5_;
				gint _tmp7_;
				gint _tmp8_;
				gint _tmp9_;
				gchar* _tmp10_ = NULL;
				gchar* persona_name;
				GHashTable* _tmp11_;
				const gchar* _tmp12_;
				gchar* _tmp13_;
#line 61 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_tmp5_ = _tmp4_;
#line 61 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				if (!_tmp5_) {
#line 345 "add-contacts-stress-test.c"
					gint _tmp6_;
#line 61 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					_tmp6_ = i;
#line 61 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					i = _tmp6_ + 1;
#line 351 "add-contacts-stress-test.c"
				}
#line 61 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_tmp4_ = FALSE;
#line 61 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_tmp7_ = i;
#line 61 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_tmp8_ = self->priv->_contacts_cnt;
#line 61 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				if (!(_tmp7_ < _tmp8_)) {
#line 61 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					break;
#line 363 "add-contacts-stress-test.c"
				}
#line 63 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_tmp9_ = i;
#line 63 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_tmp10_ = g_strdup_printf ("full_name -%d", _tmp9_);
#line 63 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				persona_name = _tmp10_;
#line 64 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_tmp11_ = self->priv->_contacts_found;
#line 64 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_tmp12_ = persona_name;
#line 64 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_tmp13_ = g_strdup (_tmp12_);
#line 64 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				g_hash_table_insert (_tmp11_, _tmp13_, GINT_TO_POINTER (FALSE));
#line 61 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_g_free0 (persona_name);
#line 381 "add-contacts-stress-test.c"
			}
		}
	}
#line 67 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp14_ = g_date_time_new_now_utc ();
#line 67 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_g_date_time_unref0 (self->priv->_start_time);
#line 67 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	self->priv->_start_time = _tmp14_;
#line 69 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_add_contacts_stress_test_tests_test_add_persona_async (self, NULL, NULL);
#line 71 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp15_ = self->priv->_main_loop;
#line 71 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	g_main_loop_run (_tmp15_);
#line 73 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp16_ = g_date_time_new_now_utc ();
#line 73 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	now = _tmp16_;
#line 74 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp17_ = now;
#line 74 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp18_ = self->priv->_start_time;
#line 74 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp19_ = g_date_time_difference (_tmp17_, _tmp18_);
#line 74 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	difference = _tmp19_;
#line 76 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp20_ = difference;
#line 76 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	diff = _tmp20_ / G_TIME_SPAN_SECOND;
#line 77 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp21_ = stdout;
#line 77 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp22_ = diff;
#line 77 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp23_ = diff;
#line 77 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	fprintf (_tmp21_, "(Elapsed time: %" G_GINT64_FORMAT " secs) ", _tmp23_);
#line 79 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	found = 0;
#line 80 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp24_ = self->priv->_contacts_found;
#line 80 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp25_ = g_hash_table_get_values (_tmp24_);
#line 427 "add-contacts-stress-test.c"
	{
		GList* k_collection = NULL;
		GList* k_it = NULL;
#line 80 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		k_collection = _tmp25_;
#line 80 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		for (k_it = k_collection; k_it != NULL; k_it = k_it->next) {
#line 435 "add-contacts-stress-test.c"
			gboolean k = FALSE;
#line 80 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			k = GPOINTER_TO_INT (k_it->data);
#line 439 "add-contacts-stress-test.c"
			{
				gboolean _tmp26_;
#line 82 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_tmp26_ = k;
#line 82 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				if (_tmp26_) {
#line 446 "add-contacts-stress-test.c"
					gint _tmp27_;
#line 83 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					_tmp27_ = found;
#line 83 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					found = _tmp27_ + 1;
#line 452 "add-contacts-stress-test.c"
				}
			}
		}
#line 80 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		_g_list_free0 (k_collection);
#line 458 "add-contacts-stress-test.c"
	}
#line 86 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp28_ = found;
#line 86 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp29_ = self->priv->_contacts_cnt;
#line 86 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	g_assert (_tmp28_ == _tmp29_);
#line 56 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_g_date_time_unref0 (now);
#line 468 "add-contacts-stress-test.c"
}


static void _add_contacts_stress_test_tests_test_add_persona_async_data_free (gpointer _data) {
	AddContactsStressTestTestsTestAddPersonaAsyncData* _data_;
	_data_ = _data;
#line 24 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_g_object_unref0 (_data_->self);
#line 24 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	g_slice_free (AddContactsStressTestTestsTestAddPersonaAsyncData, _data_);
#line 479 "add-contacts-stress-test.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 24 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	return self ? g_object_ref (self) : NULL;
#line 486 "add-contacts-stress-test.c"
}


static void _add_contacts_stress_test_tests_test_add_persona_async (AddContactsStressTestTests* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	AddContactsStressTestTestsTestAddPersonaAsyncData* _data_;
	AddContactsStressTestTests* _tmp0_;
#line 24 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_data_ = g_slice_new0 (AddContactsStressTestTestsTestAddPersonaAsyncData);
#line 24 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _add_contacts_stress_test_tests_test_add_persona_async);
#line 24 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _add_contacts_stress_test_tests_test_add_persona_async_data_free);
#line 24 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 24 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_data_->self = _tmp0_;
#line 24 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_add_contacts_stress_test_tests_test_add_persona_async_co (_data_);
#line 505 "add-contacts-stress-test.c"
}


static void _add_contacts_stress_test_tests_test_add_persona_finish (AddContactsStressTestTests* self, GAsyncResult* _res_) {
	AddContactsStressTestTestsTestAddPersonaAsyncData* _data_;
#line 24 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 513 "add-contacts-stress-test.c"
}


static void _add_contacts_stress_test_tests_test_add_persona_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	AddContactsStressTestTestsTestAddPersonaAsyncData* _data_;
#line 92 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_data_ = _user_data_;
#line 92 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_data_->_source_object_ = source_object;
#line 92 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_data_->_res_ = _res_;
#line 92 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_add_contacts_stress_test_tests_test_add_persona_async_co (_data_);
#line 527 "add-contacts-stress-test.c"
}


static void __add_contacts_stress_test_tests_individuals_changed_cb_folks_individual_aggregator_individuals_changed_detailed (FolksIndividualAggregator* _sender, GeeMultiMap* changes, gpointer self) {
#line 94 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_add_contacts_stress_test_tests_individuals_changed_cb (self, changes);
#line 534 "add-contacts-stress-test.c"
}


static void __add_contacts_stress_test_tests_notify_pstore_cb_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
#line 110 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_add_contacts_stress_test_tests_notify_pstore_cb (self, _sender, pspec);
#line 541 "add-contacts-stress-test.c"
}


static gboolean _add_contacts_stress_test_tests_test_add_persona_async_co (AddContactsStressTestTestsTestAddPersonaAsyncData* _data_) {
#line 89 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	switch (_data_->_state_) {
#line 89 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		case 0:
#line 550 "add-contacts-stress-test.c"
		goto _state_0;
#line 89 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		case 1:
#line 554 "add-contacts-stress-test.c"
		goto _state_1;
#line 89 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		case 2:
#line 558 "add-contacts-stress-test.c"
		goto _state_2;
		default:
#line 89 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		g_assert_not_reached ();
#line 563 "add-contacts-stress-test.c"
	}
	_state_0:
#line 91 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_data_->_tmp0_ = NULL;
#line 91 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_data_->_tmp0_ = folks_backend_store_dup ();
#line 91 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_data_->store = _data_->_tmp0_;
#line 92 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_data_->_state_ = 1;
#line 92 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	folks_backend_store_prepare (_data_->store, _add_contacts_stress_test_tests_test_add_persona_async_ready, _data_);
#line 92 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	return FALSE;
#line 578 "add-contacts-stress-test.c"
	_state_1:
#line 92 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	folks_backend_store_prepare_finish (_data_->store, _data_->_res_);
#line 93 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_data_->_tmp1_ = folks_individual_aggregator_new ();
#line 93 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_g_object_unref0 (_data_->self->priv->_aggregator);
#line 93 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_data_->self->priv->_aggregator = _data_->_tmp1_;
#line 94 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_data_->_tmp2_ = _data_->self->priv->_aggregator;
#line 94 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	g_signal_connect_object (_data_->_tmp2_, "individuals-changed-detailed", (GCallback) __add_contacts_stress_test_tests_individuals_changed_cb_folks_individual_aggregator_individuals_changed_detailed, _data_->self, 0);
#line 592 "add-contacts-stress-test.c"
	{
#line 98 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		_data_->_tmp3_ = _data_->self->priv->_aggregator;
#line 98 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		_data_->_state_ = 2;
#line 98 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		folks_individual_aggregator_prepare (_data_->_tmp3_, _add_contacts_stress_test_tests_test_add_persona_async_ready, _data_);
#line 98 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		return FALSE;
#line 602 "add-contacts-stress-test.c"
		_state_2:
#line 98 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		folks_individual_aggregator_prepare_finish (_data_->_tmp3_, _data_->_res_, &_data_->_inner_error_);
#line 98 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		if (_data_->_inner_error_ != NULL) {
#line 608 "add-contacts-stress-test.c"
			goto __catch0_g_error;
		}
#line 100 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		_g_object_unref0 (_data_->self->priv->_pstore);
#line 100 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		_data_->self->priv->_pstore = NULL;
#line 615 "add-contacts-stress-test.c"
		{
#line 101 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_data_->_tmp4_ = folks_backend_store_get_enabled_backends (_data_->store);
#line 101 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_data_->_tmp5_ = _data_->_tmp4_;
#line 101 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_data_->_tmp6_ = gee_map_get_values (_data_->_tmp5_);
#line 101 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_data_->_tmp7_ = _data_->_tmp6_;
#line 101 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_data_->_tmp8_ = _data_->_tmp7_;
#line 101 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_data_->_tmp9_ = NULL;
#line 101 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_data_->_tmp9_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp8_);
#line 101 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_data_->_tmp10_ = _data_->_tmp9_;
#line 101 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_g_object_unref0 (_data_->_tmp8_);
#line 101 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_data_->_backend_it = _data_->_tmp10_;
#line 101 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			while (TRUE) {
#line 101 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp11_ = _data_->_backend_it;
#line 101 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp12_ = FALSE;
#line 101 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp12_ = gee_iterator_next (_data_->_tmp11_);
#line 101 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				if (!_data_->_tmp12_) {
#line 101 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					break;
#line 649 "add-contacts-stress-test.c"
				}
#line 101 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp13_ = _data_->_backend_it;
#line 101 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp14_ = NULL;
#line 101 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp14_ = gee_iterator_get (_data_->_tmp13_);
#line 101 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->backend = (FolksBackend*) _data_->_tmp14_;
#line 103 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp15_ = _data_->backend;
#line 103 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp16_ = folks_backend_get_persona_stores (_data_->_tmp15_);
#line 103 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp17_ = _data_->_tmp16_;
#line 103 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp18_ = _data_->self->priv->_eds_backend;
#line 103 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp19_ = eds_test_backend_get_address_book_uid (_data_->_tmp18_);
#line 103 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp20_ = _data_->_tmp19_;
#line 103 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp21_ = NULL;
#line 103 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp21_ = gee_map_get (_data_->_tmp17_, _data_->_tmp20_);
#line 103 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_g_object_unref0 (_data_->self->priv->_pstore);
#line 103 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->self->priv->_pstore = EDSF_PERSONA_STORE ((FolksPersonaStore*) _data_->_tmp21_);
#line 106 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp22_ = _data_->self->priv->_pstore;
#line 106 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				if (_data_->_tmp22_ != NULL) {
#line 107 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					_g_object_unref0 (_data_->backend);
#line 107 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					break;
#line 687 "add-contacts-stress-test.c"
				}
#line 101 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_g_object_unref0 (_data_->backend);
#line 691 "add-contacts-stress-test.c"
			}
#line 101 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_g_object_unref0 (_data_->_backend_it);
#line 695 "add-contacts-stress-test.c"
		}
#line 109 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		_data_->_tmp23_ = _data_->self->priv->_pstore;
#line 109 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		g_assert (_data_->_tmp23_ != NULL);
#line 110 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		_data_->_tmp24_ = _data_->self->priv->_pstore;
#line 110 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		g_signal_connect_object ((GObject*) _data_->_tmp24_, "notify::is-prepared", (GCallback) __add_contacts_stress_test_tests_notify_pstore_cb_g_object_notify, _data_->self, 0);
#line 111 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		_add_contacts_stress_test_tests_try_to_add (_data_->self);
#line 707 "add-contacts-stress-test.c"
	}
	goto __finally0;
	__catch0_g_error:
	{
#line 96 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		_data_->e = _data_->_inner_error_;
#line 96 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		_data_->_inner_error_ = NULL;
#line 115 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		_data_->_tmp25_ = _data_->e;
#line 115 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		_data_->_tmp26_ = _data_->_tmp25_->message;
#line 115 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		g_warning ("add-contacts-stress-test.vala:115: Error when calling prepare: %s\n", _data_->_tmp26_);
#line 96 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		_g_error_free0 (_data_->e);
#line 724 "add-contacts-stress-test.c"
	}
	__finally0:
#line 96 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	if (_data_->_inner_error_ != NULL) {
#line 96 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		_g_object_unref0 (_data_->store);
#line 96 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.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 96 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		g_clear_error (&_data_->_inner_error_);
#line 96 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		return FALSE;
#line 737 "add-contacts-stress-test.c"
	}
#line 89 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_g_object_unref0 (_data_->store);
#line 89 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	if (_data_->_state_ == 0) {
#line 89 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 745 "add-contacts-stress-test.c"
	} else {
#line 89 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 749 "add-contacts-stress-test.c"
	}
#line 89 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	g_object_unref (_data_->_async_result);
#line 89 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	return FALSE;
#line 755 "add-contacts-stress-test.c"
}


static void _add_contacts_stress_test_tests_add_contacts_data_free (gpointer _data) {
	AddContactsStressTestTestsAddContactsData* _data_;
	_data_ = _data;
#line 24 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_g_object_unref0 (_data_->self);
#line 24 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	g_slice_free (AddContactsStressTestTestsAddContactsData, _data_);
#line 766 "add-contacts-stress-test.c"
}


static void _add_contacts_stress_test_tests_add_contacts (AddContactsStressTestTests* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	AddContactsStressTestTestsAddContactsData* _data_;
	AddContactsStressTestTests* _tmp0_;
#line 24 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_data_ = g_slice_new0 (AddContactsStressTestTestsAddContactsData);
#line 24 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _add_contacts_stress_test_tests_add_contacts);
#line 24 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _add_contacts_stress_test_tests_add_contacts_data_free);
#line 24 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 24 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_data_->self = _tmp0_;
#line 24 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_add_contacts_stress_test_tests_add_contacts_co (_data_);
#line 785 "add-contacts-stress-test.c"
}


static void _add_contacts_stress_test_tests_add_contacts_finish (AddContactsStressTestTests* self, GAsyncResult* _res_) {
	AddContactsStressTestTestsAddContactsData* _data_;
#line 24 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 793 "add-contacts-stress-test.c"
}


static void _vala_GValue_free (GValue* self) {
#line 124 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	g_value_unset (self);
#line 124 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	g_free (self);
#line 802 "add-contacts-stress-test.c"
}


static void __vala_GValue_free0_ (gpointer var) {
#line 124 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	(var == NULL) ? NULL : (var = (_vala_GValue_free (var), NULL));
#line 809 "add-contacts-stress-test.c"
}


static GValue* _g_value_dup (GValue* self) {
#line 127 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	return g_boxed_copy (G_TYPE_VALUE, self);
#line 816 "add-contacts-stress-test.c"
}


static gpointer __g_value_dup0 (gpointer self) {
#line 127 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	return self ? _g_value_dup (self) : NULL;
#line 823 "add-contacts-stress-test.c"
}


static void _add_contacts_stress_test_tests_add_contacts_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	AddContactsStressTestTestsAddContactsData* _data_;
#line 135 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_data_ = _user_data_;
#line 135 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_data_->_source_object_ = source_object;
#line 135 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_data_->_res_ = _res_;
#line 135 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_add_contacts_stress_test_tests_add_contacts_co (_data_);
#line 837 "add-contacts-stress-test.c"
}


static gboolean _add_contacts_stress_test_tests_add_contacts_co (AddContactsStressTestTestsAddContactsData* _data_) {
#line 119 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	switch (_data_->_state_) {
#line 119 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		case 0:
#line 846 "add-contacts-stress-test.c"
		goto _state_0;
#line 119 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		case 1:
#line 850 "add-contacts-stress-test.c"
		goto _state_1;
		default:
#line 119 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		g_assert_not_reached ();
#line 855 "add-contacts-stress-test.c"
	}
	_state_0:
	{
#line 121 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		_data_->i = 0;
#line 861 "add-contacts-stress-test.c"
		{
#line 121 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_data_->_tmp0_ = TRUE;
#line 121 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			while (TRUE) {
#line 121 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp1_ = _data_->_tmp0_;
#line 121 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				if (!_data_->_tmp1_) {
#line 121 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->_tmp2_ = _data_->i;
#line 121 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->i = _data_->_tmp2_ + 1;
#line 875 "add-contacts-stress-test.c"
				}
#line 121 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp0_ = FALSE;
#line 121 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp3_ = _data_->i;
#line 121 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp4_ = _data_->self->priv->_contacts_cnt;
#line 121 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				if (!(_data_->_tmp3_ < _data_->_tmp4_)) {
#line 121 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					break;
#line 887 "add-contacts-stress-test.c"
				}
#line 123 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp5_ = _data_->i;
#line 123 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp6_ = NULL;
#line 123 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp6_ = g_strdup_printf ("full_name -%d", _data_->_tmp5_);
#line 123 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->persona_name = _data_->_tmp6_;
#line 124 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp7_ = g_str_hash;
#line 124 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp8_ = g_str_equal;
#line 124 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp9_ = g_hash_table_new_full (_data_->_tmp7_, _data_->_tmp8_, _g_free0_, __vala_GValue_free0_);
#line 124 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->details = _data_->_tmp9_;
#line 127 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				memset (&_data_->_tmp10_, 0, sizeof (GValue));
#line 127 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				g_value_init (&_data_->_tmp10_, G_TYPE_STRING);
#line 127 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp11_ = _data_->_tmp10_;
#line 127 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp12_ = __g_value_dup0 (&_data_->_tmp11_);
#line 127 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp13_ = _data_->_tmp12_;
#line 127 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				G_IS_VALUE (&_data_->_tmp11_) ? (g_value_unset (&_data_->_tmp11_), NULL) : NULL;
#line 127 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->v1 = _data_->_tmp13_;
#line 128 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp14_ = _data_->v1;
#line 128 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp15_ = _data_->persona_name;
#line 128 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				g_value_set_string (_data_->_tmp14_, _data_->_tmp15_);
#line 129 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp16_ = _data_->details;
#line 129 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp17_ = NULL;
#line 129 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp17_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_FULL_NAME);
#line 129 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp18_ = g_strdup (_data_->_tmp17_);
#line 129 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp19_ = _data_->v1;
#line 129 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->v1 = NULL;
#line 129 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				g_hash_table_insert (_data_->_tmp16_, _data_->_tmp18_, _data_->_tmp19_);
#line 939 "add-contacts-stress-test.c"
				{
#line 135 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->_tmp20_ = _data_->self->priv->_aggregator;
#line 135 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->_tmp21_ = _data_->self->priv->_pstore;
#line 135 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->_tmp22_ = _data_->details;
#line 135 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->_state_ = 1;
#line 135 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					folks_individual_aggregator_add_persona_from_details (_data_->_tmp20_, NULL, (FolksPersonaStore*) _data_->_tmp21_, _data_->_tmp22_, _add_contacts_stress_test_tests_add_contacts_ready, _data_);
#line 135 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					return FALSE;
#line 953 "add-contacts-stress-test.c"
					_state_1:
#line 135 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->_tmp23_ = NULL;
#line 135 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->_tmp23_ = folks_individual_aggregator_add_persona_from_details_finish (_data_->_tmp20_, _data_->_res_, &_data_->_inner_error_);
#line 135 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->_tmp24_ = _data_->_tmp23_;
#line 135 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					_g_object_unref0 (_data_->_tmp24_);
#line 135 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					if (_data_->_inner_error_ != NULL) {
#line 135 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
						if (_data_->_inner_error_->domain == FOLKS_INDIVIDUAL_AGGREGATOR_ERROR) {
#line 967 "add-contacts-stress-test.c"
							goto __catch1_folks_individual_aggregator_error;
						}
#line 135 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
						__vala_GValue_free0 (_data_->v1);
#line 135 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
						_g_hash_table_unref0 (_data_->details);
#line 135 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
						_g_free0 (_data_->persona_name);
#line 135 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
						g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
#line 135 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
						g_clear_error (&_data_->_inner_error_);
#line 135 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
						return FALSE;
#line 982 "add-contacts-stress-test.c"
					}
				}
				goto __finally1;
				__catch1_folks_individual_aggregator_error:
				{
#line 133 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->e = _data_->_inner_error_;
#line 133 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->_inner_error_ = NULL;
#line 140 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->_tmp25_ = _data_->i;
#line 140 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->_tmp26_ = _data_->e;
#line 140 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->_tmp27_ = _data_->_tmp26_->message;
#line 140 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					g_warning ("add-contacts-stress-test.vala:140: [AddContactsStressTest]: %d: %s\n", _data_->_tmp25_, _data_->_tmp27_);
#line 133 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					_g_error_free0 (_data_->e);
#line 1002 "add-contacts-stress-test.c"
				}
				__finally1:
#line 133 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				if (_data_->_inner_error_ != NULL) {
#line 133 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					__vala_GValue_free0 (_data_->v1);
#line 133 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					_g_hash_table_unref0 (_data_->details);
#line 133 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					_g_free0 (_data_->persona_name);
#line 133 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.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 133 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					g_clear_error (&_data_->_inner_error_);
#line 133 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					return FALSE;
#line 1019 "add-contacts-stress-test.c"
				}
#line 121 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				__vala_GValue_free0 (_data_->v1);
#line 121 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_g_hash_table_unref0 (_data_->details);
#line 121 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_g_free0 (_data_->persona_name);
#line 1027 "add-contacts-stress-test.c"
			}
		}
	}
#line 119 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	if (_data_->_state_ == 0) {
#line 119 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1035 "add-contacts-stress-test.c"
	} else {
#line 119 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 1039 "add-contacts-stress-test.c"
	}
#line 119 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	g_object_unref (_data_->_async_result);
#line 119 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	return FALSE;
#line 1045 "add-contacts-stress-test.c"
}


static void _add_contacts_stress_test_tests_individuals_changed_cb (AddContactsStressTestTests* self, GeeMultiMap* changes) {
	GeeMultiMap* _tmp0_;
	GeeCollection* _tmp1_ = NULL;
	GeeCollection* added;
	GeeMultiMap* _tmp2_;
	GeeSet* _tmp3_ = NULL;
	GeeSet* removed;
	GeeSet* _tmp21_;
	gint _tmp22_;
	gint _tmp23_;
#line 146 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	g_return_if_fail (self != NULL);
#line 146 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	g_return_if_fail (changes != NULL);
#line 149 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp0_ = changes;
#line 149 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp1_ = gee_multi_map_get_values (_tmp0_);
#line 149 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	added = _tmp1_;
#line 150 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp2_ = changes;
#line 150 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp3_ = gee_multi_map_get_keys (_tmp2_);
#line 150 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	removed = _tmp3_;
#line 1075 "add-contacts-stress-test.c"
	{
		GeeCollection* _tmp4_;
		GeeIterator* _tmp5_ = NULL;
		GeeIterator* _i_it;
#line 152 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		_tmp4_ = added;
#line 152 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
#line 152 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		_i_it = _tmp5_;
#line 152 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		while (TRUE) {
#line 1088 "add-contacts-stress-test.c"
			GeeIterator* _tmp6_;
			gboolean _tmp7_ = FALSE;
			GeeIterator* _tmp8_;
			gpointer _tmp9_ = NULL;
			FolksIndividual* i;
			FolksIndividual* _tmp10_;
			GHashTable* _tmp11_;
			FolksIndividual* _tmp12_;
			const gchar* _tmp13_;
			const gchar* _tmp14_;
			gconstpointer _tmp15_ = NULL;
			GHashTable* _tmp16_;
			FolksIndividual* _tmp17_;
			const gchar* _tmp18_;
			const gchar* _tmp19_;
			gchar* _tmp20_;
#line 152 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp6_ = _i_it;
#line 152 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp7_ = gee_iterator_next (_tmp6_);
#line 152 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			if (!_tmp7_) {
#line 152 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				break;
#line 1113 "add-contacts-stress-test.c"
			}
#line 152 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp8_ = _i_it;
#line 152 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp9_ = gee_iterator_get (_tmp8_);
#line 152 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			i = (FolksIndividual*) _tmp9_;
#line 154 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp10_ = i;
#line 154 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			g_assert (_tmp10_ != NULL);
#line 156 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp11_ = self->priv->_contacts_found;
#line 156 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp12_ = i;
#line 156 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp13_ = folks_name_details_get_full_name ((FolksNameDetails*) _tmp12_);
#line 156 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp14_ = _tmp13_;
#line 156 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp15_ = g_hash_table_lookup (_tmp11_, _tmp14_);
#line 156 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			g_assert (GPOINTER_TO_INT (_tmp15_) == FALSE);
#line 157 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp16_ = self->priv->_contacts_found;
#line 157 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp17_ = i;
#line 157 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp18_ = folks_name_details_get_full_name ((FolksNameDetails*) _tmp17_);
#line 157 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp19_ = _tmp18_;
#line 157 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp20_ = g_strdup (_tmp19_);
#line 157 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			g_hash_table_replace (_tmp16_, _tmp20_, GINT_TO_POINTER (TRUE));
#line 152 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_g_object_unref0 (i);
#line 1151 "add-contacts-stress-test.c"
		}
#line 152 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		_g_object_unref0 (_i_it);
#line 1155 "add-contacts-stress-test.c"
	}
#line 160 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp21_ = removed;
#line 160 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp22_ = gee_collection_get_size ((GeeCollection*) _tmp21_);
#line 160 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp23_ = _tmp22_;
#line 160 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	g_assert (_tmp23_ == 1);
#line 1165 "add-contacts-stress-test.c"
	{
		GeeSet* _tmp24_;
		GeeIterator* _tmp25_ = NULL;
		GeeIterator* _i_it;
#line 162 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		_tmp24_ = removed;
#line 162 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		_tmp25_ = gee_iterable_iterator ((GeeIterable*) _tmp24_);
#line 162 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		_i_it = _tmp25_;
#line 162 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		while (TRUE) {
#line 1178 "add-contacts-stress-test.c"
			GeeIterator* _tmp26_;
			gboolean _tmp27_ = FALSE;
			GeeIterator* _tmp28_;
			gpointer _tmp29_ = NULL;
			FolksIndividual* i;
			FolksIndividual* _tmp30_;
#line 162 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp26_ = _i_it;
#line 162 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp27_ = gee_iterator_next (_tmp26_);
#line 162 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			if (!_tmp27_) {
#line 162 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				break;
#line 1193 "add-contacts-stress-test.c"
			}
#line 162 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp28_ = _i_it;
#line 162 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp29_ = gee_iterator_get (_tmp28_);
#line 162 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			i = (FolksIndividual*) _tmp29_;
#line 164 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp30_ = i;
#line 164 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			g_assert (_tmp30_ == NULL);
#line 162 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_g_object_unref0 (i);
#line 1207 "add-contacts-stress-test.c"
		}
#line 162 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		_g_object_unref0 (_i_it);
#line 1211 "add-contacts-stress-test.c"
	}
#line 167 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_add_contacts_stress_test_tests_exit_if_all_contacts_found (self);
#line 146 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_g_object_unref0 (removed);
#line 146 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_g_object_unref0 (added);
#line 1219 "add-contacts-stress-test.c"
}


static void _add_contacts_stress_test_tests_notify_pstore_cb (AddContactsStressTestTests* self, GObject* _pstore, GParamSpec* ps) {
#line 170 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	g_return_if_fail (self != NULL);
#line 170 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	g_return_if_fail (_pstore != NULL);
#line 170 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	g_return_if_fail (ps != NULL);
#line 172 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_add_contacts_stress_test_tests_try_to_add (self);
#line 1232 "add-contacts-stress-test.c"
}


static void _add_contacts_stress_test_tests_try_to_add (AddContactsStressTestTests* self) {
	GError * _inner_error_ = NULL;
#line 175 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	g_return_if_fail (self != NULL);
#line 1240 "add-contacts-stress-test.c"
	{
		gboolean _tmp0_;
#line 177 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		_tmp0_ = self->priv->_added_contacts;
#line 177 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		g_static_rec_mutex_lock (&self->priv->__lock__added_contacts);
#line 1247 "add-contacts-stress-test.c"
		{
			gboolean _tmp1_ = FALSE;
			EdsfPersonaStore* _tmp2_;
			gboolean _tmp3_;
			gboolean _tmp4_;
			gboolean _tmp6_;
#line 179 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp2_ = self->priv->_pstore;
#line 179 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp3_ = folks_persona_store_get_is_prepared ((FolksPersonaStore*) _tmp2_);
#line 179 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp4_ = _tmp3_;
#line 179 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			if (_tmp4_) {
#line 1262 "add-contacts-stress-test.c"
				gboolean _tmp5_;
#line 180 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_tmp5_ = self->priv->_added_contacts;
#line 180 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_tmp1_ = _tmp5_ == FALSE;
#line 1268 "add-contacts-stress-test.c"
			} else {
#line 179 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_tmp1_ = FALSE;
#line 1272 "add-contacts-stress-test.c"
			}
#line 179 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp6_ = _tmp1_;
#line 179 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			if (_tmp6_) {
#line 182 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				self->priv->_added_contacts = TRUE;
#line 183 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_add_contacts_stress_test_tests_add_contacts (self, NULL, NULL);
#line 1282 "add-contacts-stress-test.c"
			}
		}
		__finally2:
		{
			gboolean _tmp7_;
#line 177 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp7_ = self->priv->_added_contacts;
#line 177 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			g_static_rec_mutex_unlock (&self->priv->__lock__added_contacts);
#line 1292 "add-contacts-stress-test.c"
		}
#line 177 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		if (_inner_error_ != NULL) {
#line 177 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 177 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			g_clear_error (&_inner_error_);
#line 177 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			return;
#line 1302 "add-contacts-stress-test.c"
		}
	}
}


static void _add_contacts_stress_test_tests_exit_if_all_contacts_found (AddContactsStressTestTests* self) {
	GHashTable* _tmp0_;
	GList* _tmp1_ = NULL;
	GMainLoop* _tmp6_;
#line 188 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	g_return_if_fail (self != NULL);
#line 190 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp0_ = self->priv->_contacts_found;
#line 190 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp1_ = g_hash_table_get_keys (_tmp0_);
#line 1318 "add-contacts-stress-test.c"
	{
		GList* k_collection = NULL;
		GList* k_it = NULL;
#line 190 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		k_collection = _tmp1_;
#line 190 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		for (k_it = k_collection; k_it != NULL; k_it = k_it->next) {
#line 1326 "add-contacts-stress-test.c"
			const gchar* k = NULL;
#line 190 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
			k = (const gchar*) k_it->data;
#line 1330 "add-contacts-stress-test.c"
			{
				GHashTable* _tmp2_;
				const gchar* _tmp3_;
				gconstpointer _tmp4_ = NULL;
				gboolean v;
				gboolean _tmp5_;
#line 192 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_tmp2_ = self->priv->_contacts_found;
#line 192 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_tmp3_ = k;
#line 192 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_tmp4_ = g_hash_table_lookup (_tmp2_, _tmp3_);
#line 192 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				v = GPOINTER_TO_INT (_tmp4_);
#line 193 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				_tmp5_ = v;
#line 193 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
				if (_tmp5_ == FALSE) {
#line 194 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					_g_list_free0 (k_collection);
#line 194 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
					return;
#line 1353 "add-contacts-stress-test.c"
				}
			}
		}
#line 190 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
		_g_list_free0 (k_collection);
#line 1359 "add-contacts-stress-test.c"
	}
#line 196 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp6_ = self->priv->_main_loop;
#line 196 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	g_main_loop_quit (_tmp6_);
#line 1365 "add-contacts-stress-test.c"
}


static void add_contacts_stress_test_tests_class_init (AddContactsStressTestTestsClass * klass) {
#line 24 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	add_contacts_stress_test_tests_parent_class = g_type_class_peek_parent (klass);
#line 24 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	g_type_class_add_private (klass, sizeof (AddContactsStressTestTestsPrivate));
#line 24 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	FOLKS_TEST_CASE_CLASS (klass)->set_up = add_contacts_stress_test_tests_real_set_up;
#line 24 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	FOLKS_TEST_CASE_CLASS (klass)->tear_down = add_contacts_stress_test_tests_real_tear_down;
#line 24 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	G_OBJECT_CLASS (klass)->finalize = add_contacts_stress_test_tests_finalize;
#line 1380 "add-contacts-stress-test.c"
}


static void add_contacts_stress_test_tests_instance_init (AddContactsStressTestTests * self) {
#line 24 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	self->priv = ADD_CONTACTS_STRESS_TEST_TESTS_GET_PRIVATE (self);
#line 30 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	g_static_rec_mutex_init (&self->priv->__lock__added_contacts);
#line 30 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	self->priv->_added_contacts = FALSE;
#line 32 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	self->priv->_contacts_cnt = 1000;
#line 1393 "add-contacts-stress-test.c"
}


static void add_contacts_stress_test_tests_finalize (GObject* obj) {
	AddContactsStressTestTests * self;
#line 24 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	self = ADD_CONTACTS_STRESS_TEST_TESTS (obj);
#line 26 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_g_main_loop_unref0 (self->priv->_main_loop);
#line 27 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_eds_test_backend_unref0 (self->priv->_eds_backend);
#line 28 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_g_object_unref0 (self->priv->_aggregator);
#line 29 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_g_object_unref0 (self->priv->_pstore);
#line 30 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	g_static_rec_mutex_free (&self->priv->__lock__added_contacts);
#line 31 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_g_hash_table_unref0 (self->priv->_contacts_found);
#line 33 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_g_date_time_unref0 (self->priv->_start_time);
#line 24 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	G_OBJECT_CLASS (add_contacts_stress_test_tests_parent_class)->finalize (obj);
#line 1417 "add-contacts-stress-test.c"
}


GType add_contacts_stress_test_tests_get_type (void) {
	static volatile gsize add_contacts_stress_test_tests_type_id__volatile = 0;
	if (g_once_init_enter (&add_contacts_stress_test_tests_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (AddContactsStressTestTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) add_contacts_stress_test_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (AddContactsStressTestTests), 0, (GInstanceInitFunc) add_contacts_stress_test_tests_instance_init, NULL };
		GType add_contacts_stress_test_tests_type_id;
		add_contacts_stress_test_tests_type_id = g_type_register_static (FOLKS_TYPE_TEST_CASE, "AddContactsStressTestTests", &g_define_type_info, 0);
		g_once_init_leave (&add_contacts_stress_test_tests_type_id__volatile, add_contacts_stress_test_tests_type_id);
	}
	return add_contacts_stress_test_tests_type_id__volatile;
}


gint _vala_main (gchar** args, int args_length1) {
	gint result = 0;
	GTestSuite* _tmp0_ = NULL;
	GTestSuite* root;
	AddContactsStressTestTests* _tmp1_;
	AddContactsStressTestTests* _tmp2_;
	GTestSuite* _tmp3_ = NULL;
#line 202 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	g_test_init (&args_length1, &args, NULL);
#line 204 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp0_ = g_test_get_root ();
#line 204 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	root = _tmp0_;
#line 205 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp1_ = add_contacts_stress_test_tests_new ();
#line 205 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp2_ = _tmp1_;
#line 205 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp3_ = folks_test_case_get_suite ((FolksTestCase*) _tmp2_);
#line 205 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	g_test_suite_add_suite (root, _tmp3_);
#line 205 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	_g_object_unref0 (_tmp2_);
#line 207 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	g_test_run ();
#line 209 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	result = 0;
#line 209 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	return result;
#line 1462 "add-contacts-stress-test.c"
}


int main (int argc, char ** argv) {
#line 200 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	g_type_init ();
#line 200 "/home/treitter/collabora/folks/tests/eds/add-contacts-stress-test.vala"
	return _vala_main (argv, argc);
#line 1471 "add-contacts-stress-test.c"
}



