/* add-contacts-stress-test.c generated by valac 0.26.0.36-540e, 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 <eds-test.h>
#include <folks/folks.h>
#include <folks/folks-eds.h>
#include <stdlib.h>
#include <string.h>
#include <folks-test.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 _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;
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

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

struct _AddContactsStressTestTestsClass {
	EdsTestTestCaseClass parent_class;
};

struct _AddContactsStressTestTestsPrivate {
	GMainLoop* _main_loop;
	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* store;
	FolksBackendStore* _tmp0_;
	FolksIndividualAggregator* _tmp1_;
	FolksIndividualAggregator* _tmp2_;
	FolksIndividualAggregator* _tmp3_;
	GeeIterator* _backend_it;
	GeeMap* _tmp4_;
	GeeMap* _tmp5_;
	GeeCollection* _tmp6_;
	GeeCollection* _tmp7_;
	GeeCollection* _tmp8_;
	GeeIterator* _tmp9_;
	GeeIterator* _tmp10_;
	GeeIterator* _tmp11_;
	gboolean _tmp12_;
	FolksBackend* backend;
	GeeIterator* _tmp13_;
	gpointer _tmp14_;
	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_;
	gint _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gchar* persona_name;
	gint _tmp4_;
	gchar* _tmp5_;
	GHashTable* details;
	GHashFunc _tmp6_;
	GEqualFunc _tmp7_;
	GHashTable* _tmp8_;
	GValue* v1;
	GValue _tmp9_;
	GValue _tmp10_;
	GValue* _tmp11_;
	GValue* _tmp12_;
	GValue* _tmp13_;
	const gchar* _tmp14_;
	GHashTable* _tmp15_;
	const gchar* _tmp16_;
	gchar* _tmp17_;
	GValue* _tmp18_;
	FolksIndividualAggregator* _tmp19_;
	EdsfPersonaStore* _tmp20_;
	GHashTable* _tmp21_;
	FolksPersona* _tmp22_;
	FolksPersona* _tmp23_;
	GError* e;
	gint _tmp24_;
	GError* _tmp25_;
	const gchar* _tmp26_;
	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 _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 40 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	add_contacts_stress_test_tests_test_add_contacts ((AddContactsStressTestTests*) self);
#line 200 "add-contacts-stress-test.c"
}


AddContactsStressTestTests* add_contacts_stress_test_tests_construct (GType object_type) {
	AddContactsStressTestTests * self = NULL;
	gchar* test_desc = NULL;
	gint _tmp0_ = 0;
	gchar* _tmp1_ = NULL;
#line 36 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	self = (AddContactsStressTestTests*) eds_test_test_case_construct (object_type, "AddContactsStressTestTests");
#line 38 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp0_ = self->priv->_contacts_cnt;
#line 38 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp1_ = g_strdup_printf ("stress testing adding (%d) contacts to e-d-s ", _tmp0_);
#line 38 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	test_desc = _tmp1_;
#line 40 "/opt/gnome3/source/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 34 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_g_free0 (test_desc);
#line 34 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	return self;
#line 223 "add-contacts-stress-test.c"
}


AddContactsStressTestTests* add_contacts_stress_test_tests_new (void) {
#line 34 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	return add_contacts_stress_test_tests_construct (TYPE_ADD_CONTACTS_STRESS_TEST_TESTS);
#line 230 "add-contacts-stress-test.c"
}


static void _g_free0_ (gpointer var) {
#line 47 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	var = (g_free (var), NULL);
#line 237 "add-contacts-stress-test.c"
}


void add_contacts_stress_test_tests_test_add_contacts (AddContactsStressTestTests* self) {
	GMainLoop* _tmp0_ = NULL;
	GHashFunc _tmp1_ = NULL;
	GEqualFunc _tmp2_ = NULL;
	GHashTable* _tmp3_ = NULL;
	GDateTime* _tmp13_ = NULL;
	GDateTime* _tmp14_ = NULL;
	GMainLoop* _tmp15_ = NULL;
	GDateTime* now = NULL;
	GDateTime* _tmp16_ = NULL;
	GDateTime* _tmp17_ = NULL;
	GTimeSpan difference = 0LL;
	GDateTime* _tmp18_ = NULL;
	GDateTime* _tmp19_ = NULL;
	GTimeSpan _tmp20_ = 0LL;
	GTimeSpan diff = 0LL;
	GTimeSpan _tmp21_ = 0LL;
	FILE* _tmp22_ = NULL;
	GTimeSpan _tmp23_ = 0LL;
	gint found = 0;
	GHashTable* _tmp24_ = NULL;
	GList* _tmp25_ = NULL;
	gint _tmp28_ = 0;
	gint _tmp29_ = 0;
#line 43 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	g_return_if_fail (self != NULL);
#line 45 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp0_ = g_main_loop_new (NULL, FALSE);
#line 45 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_g_main_loop_unref0 (self->priv->_main_loop);
#line 45 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	self->priv->_main_loop = _tmp0_;
#line 47 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp1_ = g_str_hash;
#line 47 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp2_ = g_str_equal;
#line 47 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp3_ = g_hash_table_new_full (_tmp1_, _tmp2_, _g_free0_, NULL);
#line 47 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_g_hash_table_unref0 (self->priv->_contacts_found);
#line 47 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	self->priv->_contacts_found = _tmp3_;
#line 283 "add-contacts-stress-test.c"
	{
		gint i = 0;
#line 48 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		i = 0;
#line 288 "add-contacts-stress-test.c"
		{
			gboolean _tmp4_ = FALSE;
#line 48 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp4_ = TRUE;
#line 48 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			while (TRUE) {
#line 295 "add-contacts-stress-test.c"
				gint _tmp6_ = 0;
				gint _tmp7_ = 0;
				gchar* persona_name = NULL;
				gint _tmp8_ = 0;
				gchar* _tmp9_ = NULL;
				GHashTable* _tmp10_ = NULL;
				const gchar* _tmp11_ = NULL;
				gchar* _tmp12_ = NULL;
#line 48 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				if (!_tmp4_) {
#line 306 "add-contacts-stress-test.c"
					gint _tmp5_ = 0;
#line 48 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					_tmp5_ = i;
#line 48 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					i = _tmp5_ + 1;
#line 312 "add-contacts-stress-test.c"
				}
#line 48 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_tmp4_ = FALSE;
#line 48 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_tmp6_ = i;
#line 48 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_tmp7_ = self->priv->_contacts_cnt;
#line 48 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				if (!(_tmp6_ < _tmp7_)) {
#line 48 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					break;
#line 324 "add-contacts-stress-test.c"
				}
#line 50 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_tmp8_ = i;
#line 50 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_tmp9_ = g_strdup_printf ("full_name -%d", _tmp8_);
#line 50 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				persona_name = _tmp9_;
#line 51 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_tmp10_ = self->priv->_contacts_found;
#line 51 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_tmp11_ = persona_name;
#line 51 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_tmp12_ = g_strdup (_tmp11_);
#line 51 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				g_hash_table_insert (_tmp10_, _tmp12_, (gpointer) ((gintptr) FALSE));
#line 48 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_g_free0 (persona_name);
#line 342 "add-contacts-stress-test.c"
			}
		}
	}
#line 54 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp13_ = g_date_time_new_now_utc ();
#line 54 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_g_date_time_unref0 (self->priv->_start_time);
#line 54 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	self->priv->_start_time = _tmp13_;
#line 55 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp14_ = self->priv->_start_time;
#line 55 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_vala_assert (_tmp14_ != NULL, "this._start_time != null");
#line 57 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_add_contacts_stress_test_tests_test_add_persona_async (self, NULL, NULL);
#line 59 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp15_ = self->priv->_main_loop;
#line 59 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	g_main_loop_run (_tmp15_);
#line 61 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp16_ = g_date_time_new_now_utc ();
#line 61 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	now = _tmp16_;
#line 62 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp17_ = now;
#line 62 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_vala_assert (_tmp17_ != NULL, "now != null");
#line 63 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp18_ = now;
#line 63 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp19_ = self->priv->_start_time;
#line 63 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp20_ = g_date_time_difference (_tmp18_, _tmp19_);
#line 63 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	difference = _tmp20_;
#line 65 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp21_ = difference;
#line 65 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	diff = _tmp21_ / G_TIME_SPAN_SECOND;
#line 66 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp22_ = stdout;
#line 66 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp23_ = diff;
#line 66 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	fprintf (_tmp22_, "(Elapsed time: %" G_GINT64_FORMAT " secs) ", _tmp23_);
#line 68 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	found = 0;
#line 69 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp24_ = self->priv->_contacts_found;
#line 69 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp25_ = g_hash_table_get_values (_tmp24_);
#line 394 "add-contacts-stress-test.c"
	{
		GList* k_collection = NULL;
		GList* k_it = NULL;
#line 69 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		k_collection = _tmp25_;
#line 69 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		for (k_it = k_collection; k_it != NULL; k_it = k_it->next) {
#line 402 "add-contacts-stress-test.c"
			gboolean k = FALSE;
#line 69 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			k = (gboolean) ((gintptr) k_it->data);
#line 406 "add-contacts-stress-test.c"
			{
				gboolean _tmp26_ = FALSE;
#line 71 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_tmp26_ = k;
#line 71 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				if (_tmp26_) {
#line 413 "add-contacts-stress-test.c"
					gint _tmp27_ = 0;
#line 72 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					_tmp27_ = found;
#line 72 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					found = _tmp27_ + 1;
#line 419 "add-contacts-stress-test.c"
				}
			}
		}
#line 69 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		_g_list_free0 (k_collection);
#line 425 "add-contacts-stress-test.c"
	}
#line 75 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp28_ = found;
#line 75 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp29_ = self->priv->_contacts_cnt;
#line 75 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_vala_assert (_tmp28_ == _tmp29_, "found == this._contacts_cnt");
#line 43 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_g_date_time_unref0 (now);
#line 435 "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 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_g_object_unref0 (_data_->self);
#line 24 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	g_slice_free (AddContactsStressTestTestsTestAddPersonaAsyncData, _data_);
#line 446 "add-contacts-stress-test.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 24 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	return self ? g_object_ref (self) : NULL;
#line 453 "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_ = NULL;
#line 24 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_data_ = g_slice_new0 (AddContactsStressTestTestsTestAddPersonaAsyncData);
#line 24 "/opt/gnome3/source/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 "/opt/gnome3/source/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 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 24 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_data_->self = _tmp0_;
#line 24 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_add_contacts_stress_test_tests_test_add_persona_async_co (_data_);
#line 472 "add-contacts-stress-test.c"
}


static void _add_contacts_stress_test_tests_test_add_persona_finish (AddContactsStressTestTests* self, GAsyncResult* _res_) {
	AddContactsStressTestTestsTestAddPersonaAsyncData* _data_;
#line 24 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 480 "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 81 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_data_ = _user_data_;
#line 81 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_data_->_source_object_ = source_object;
#line 81 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_data_->_res_ = _res_;
#line 81 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_add_contacts_stress_test_tests_test_add_persona_async_co (_data_);
#line 494 "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 83 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_add_contacts_stress_test_tests_individuals_changed_cb ((AddContactsStressTestTests*) self, changes);
#line 501 "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 99 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_add_contacts_stress_test_tests_notify_pstore_cb ((AddContactsStressTestTests*) self, _sender, pspec);
#line 508 "add-contacts-stress-test.c"
}


static gboolean _add_contacts_stress_test_tests_test_add_persona_async_co (AddContactsStressTestTestsTestAddPersonaAsyncData* _data_) {
#line 78 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	switch (_data_->_state_) {
#line 78 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		case 0:
#line 517 "add-contacts-stress-test.c"
		goto _state_0;
#line 78 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		case 1:
#line 521 "add-contacts-stress-test.c"
		goto _state_1;
#line 78 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		case 2:
#line 525 "add-contacts-stress-test.c"
		goto _state_2;
		default:
#line 78 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		g_assert_not_reached ();
#line 530 "add-contacts-stress-test.c"
	}
	_state_0:
#line 80 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_data_->_tmp0_ = NULL;
#line 80 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_data_->_tmp0_ = folks_backend_store_dup ();
#line 80 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_data_->store = _data_->_tmp0_;
#line 81 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_data_->_state_ = 1;
#line 81 "/opt/gnome3/source/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 81 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	return FALSE;
#line 545 "add-contacts-stress-test.c"
	_state_1:
#line 81 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	folks_backend_store_prepare_finish (_data_->store, _data_->_res_);
#line 82 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_data_->_tmp1_ = NULL;
#line 82 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_data_->_tmp1_ = folks_individual_aggregator_dup ();
#line 82 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_g_object_unref0 (_data_->self->priv->_aggregator);
#line 82 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_data_->self->priv->_aggregator = _data_->_tmp1_;
#line 83 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_data_->_tmp2_ = NULL;
#line 83 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_data_->_tmp2_ = _data_->self->priv->_aggregator;
#line 83 "/opt/gnome3/source/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 563 "add-contacts-stress-test.c"
	{
#line 87 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		_data_->_tmp3_ = NULL;
#line 87 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		_data_->_tmp3_ = _data_->self->priv->_aggregator;
#line 87 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		_data_->_state_ = 2;
#line 87 "/opt/gnome3/source/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 87 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		return FALSE;
#line 575 "add-contacts-stress-test.c"
		_state_2:
#line 87 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		folks_individual_aggregator_prepare_finish (_data_->_tmp3_, _data_->_res_, &_data_->_inner_error_);
#line 87 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 581 "add-contacts-stress-test.c"
			goto __catch0_g_error;
		}
#line 89 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		_g_object_unref0 (_data_->self->priv->_pstore);
#line 89 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		_data_->self->priv->_pstore = NULL;
#line 588 "add-contacts-stress-test.c"
		{
#line 90 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_data_->_tmp4_ = NULL;
#line 90 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_data_->_tmp4_ = folks_backend_store_get_enabled_backends (_data_->store);
#line 90 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_data_->_tmp5_ = NULL;
#line 90 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_data_->_tmp5_ = _data_->_tmp4_;
#line 90 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_data_->_tmp6_ = NULL;
#line 90 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_data_->_tmp6_ = gee_map_get_values (_data_->_tmp5_);
#line 90 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_data_->_tmp7_ = NULL;
#line 90 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_data_->_tmp7_ = _data_->_tmp6_;
#line 90 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_data_->_tmp8_ = NULL;
#line 90 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_data_->_tmp8_ = _data_->_tmp7_;
#line 90 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_data_->_tmp9_ = NULL;
#line 90 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_data_->_tmp9_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp8_);
#line 90 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_data_->_tmp10_ = NULL;
#line 90 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_data_->_tmp10_ = _data_->_tmp9_;
#line 90 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_g_object_unref0 (_data_->_tmp8_);
#line 90 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_data_->_backend_it = _data_->_tmp10_;
#line 90 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			while (TRUE) {
#line 90 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp11_ = NULL;
#line 90 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp11_ = _data_->_backend_it;
#line 90 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp12_ = FALSE;
#line 90 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp12_ = gee_iterator_next (_data_->_tmp11_);
#line 90 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				if (!_data_->_tmp12_) {
#line 90 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					break;
#line 636 "add-contacts-stress-test.c"
				}
#line 90 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp13_ = NULL;
#line 90 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp13_ = _data_->_backend_it;
#line 90 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp14_ = NULL;
#line 90 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp14_ = gee_iterator_get (_data_->_tmp13_);
#line 90 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->backend = (FolksBackend*) _data_->_tmp14_;
#line 92 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp15_ = NULL;
#line 92 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp15_ = _data_->backend;
#line 92 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp16_ = NULL;
#line 92 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp16_ = folks_backend_get_persona_stores (_data_->_tmp15_);
#line 92 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp17_ = NULL;
#line 92 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp17_ = _data_->_tmp16_;
#line 92 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp18_ = NULL;
#line 92 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp18_ = ((EdsTestTestCase*) _data_->self)->eds_backend;
#line 92 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp19_ = NULL;
#line 92 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp19_ = eds_test_backend_get_address_book_uid (_data_->_tmp18_);
#line 92 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp20_ = NULL;
#line 92 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp20_ = _data_->_tmp19_;
#line 92 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp21_ = NULL;
#line 92 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp21_ = gee_map_get (_data_->_tmp17_, _data_->_tmp20_);
#line 92 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_g_object_unref0 (_data_->self->priv->_pstore);
#line 92 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->self->priv->_pstore = G_TYPE_CHECK_INSTANCE_CAST ((FolksPersonaStore*) _data_->_tmp21_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore);
#line 95 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp22_ = NULL;
#line 95 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp22_ = _data_->self->priv->_pstore;
#line 95 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				if (_data_->_tmp22_ != NULL) {
#line 96 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					_g_object_unref0 (_data_->backend);
#line 96 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					break;
#line 690 "add-contacts-stress-test.c"
				}
#line 90 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_g_object_unref0 (_data_->backend);
#line 694 "add-contacts-stress-test.c"
			}
#line 90 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_g_object_unref0 (_data_->_backend_it);
#line 698 "add-contacts-stress-test.c"
		}
#line 98 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		_data_->_tmp23_ = NULL;
#line 98 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		_data_->_tmp23_ = _data_->self->priv->_pstore;
#line 98 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		_vala_assert (_data_->_tmp23_ != NULL, "this._pstore != null");
#line 99 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		_data_->_tmp24_ = NULL;
#line 99 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		_data_->_tmp24_ = _data_->self->priv->_pstore;
#line 99 "/opt/gnome3/source/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 100 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		_add_contacts_stress_test_tests_try_to_add (_data_->self);
#line 714 "add-contacts-stress-test.c"
	}
	goto __finally0;
	__catch0_g_error:
	{
#line 85 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		_data_->e = _data_->_inner_error_;
#line 85 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		_data_->_inner_error_ = NULL;
#line 104 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		_data_->_tmp25_ = NULL;
#line 104 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		_data_->_tmp25_ = _data_->e;
#line 104 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		_data_->_tmp26_ = NULL;
#line 104 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		_data_->_tmp26_ = _data_->_tmp25_->message;
#line 104 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		g_warning ("add-contacts-stress-test.vala:104: Error when calling prepare: %s\n", _data_->_tmp26_);
#line 85 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		_g_error_free0 (_data_->e);
#line 735 "add-contacts-stress-test.c"
	}
	__finally0:
#line 85 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 85 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		_g_object_unref0 (_data_->store);
#line 85 "/opt/gnome3/source/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 85 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		g_clear_error (&_data_->_inner_error_);
#line 85 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		return FALSE;
#line 748 "add-contacts-stress-test.c"
	}
#line 78 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_g_object_unref0 (_data_->store);
#line 78 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	if (_data_->_state_ == 0) {
#line 78 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 756 "add-contacts-stress-test.c"
	} else {
#line 78 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 760 "add-contacts-stress-test.c"
	}
#line 78 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	g_object_unref (_data_->_async_result);
#line 78 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	return FALSE;
#line 766 "add-contacts-stress-test.c"
}


static void _add_contacts_stress_test_tests_add_contacts_data_free (gpointer _data) {
	AddContactsStressTestTestsAddContactsData* _data_;
	_data_ = _data;
#line 24 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_g_object_unref0 (_data_->self);
#line 24 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	g_slice_free (AddContactsStressTestTestsAddContactsData, _data_);
#line 777 "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_ = NULL;
#line 24 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_data_ = g_slice_new0 (AddContactsStressTestTestsAddContactsData);
#line 24 "/opt/gnome3/source/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 "/opt/gnome3/source/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 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 24 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_data_->self = _tmp0_;
#line 24 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_add_contacts_stress_test_tests_add_contacts_co (_data_);
#line 796 "add-contacts-stress-test.c"
}


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


static void _vala_GValue_free (GValue* self) {
#line 113 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	g_value_unset (self);
#line 113 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	g_free (self);
#line 813 "add-contacts-stress-test.c"
}


static void __vala_GValue_free0_ (gpointer var) {
#line 113 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	(var == NULL) ? NULL : (var = (_vala_GValue_free (var), NULL));
#line 820 "add-contacts-stress-test.c"
}


static GValue* _g_value_dup (GValue* self) {
#line 116 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	return g_boxed_copy (G_TYPE_VALUE, self);
#line 827 "add-contacts-stress-test.c"
}


static gpointer __g_value_dup0 (gpointer self) {
#line 116 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	return self ? _g_value_dup (self) : NULL;
#line 834 "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 124 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_data_ = _user_data_;
#line 124 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_data_->_source_object_ = source_object;
#line 124 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_data_->_res_ = _res_;
#line 124 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_add_contacts_stress_test_tests_add_contacts_co (_data_);
#line 848 "add-contacts-stress-test.c"
}


static gboolean _add_contacts_stress_test_tests_add_contacts_co (AddContactsStressTestTestsAddContactsData* _data_) {
#line 108 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	switch (_data_->_state_) {
#line 108 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		case 0:
#line 857 "add-contacts-stress-test.c"
		goto _state_0;
#line 108 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		case 1:
#line 861 "add-contacts-stress-test.c"
		goto _state_1;
		default:
#line 108 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		g_assert_not_reached ();
#line 866 "add-contacts-stress-test.c"
	}
	_state_0:
	{
#line 110 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		_data_->i = 0;
#line 872 "add-contacts-stress-test.c"
		{
#line 110 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_data_->_tmp0_ = TRUE;
#line 110 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			while (TRUE) {
#line 110 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				if (!_data_->_tmp0_) {
#line 110 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->_tmp1_ = 0;
#line 110 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->_tmp1_ = _data_->i;
#line 110 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->i = _data_->_tmp1_ + 1;
#line 886 "add-contacts-stress-test.c"
				}
#line 110 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp0_ = FALSE;
#line 110 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp2_ = 0;
#line 110 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp2_ = _data_->i;
#line 110 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp3_ = 0;
#line 110 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp3_ = _data_->self->priv->_contacts_cnt;
#line 110 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				if (!(_data_->_tmp2_ < _data_->_tmp3_)) {
#line 110 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					break;
#line 902 "add-contacts-stress-test.c"
				}
#line 112 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp4_ = 0;
#line 112 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp4_ = _data_->i;
#line 112 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp5_ = NULL;
#line 112 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp5_ = g_strdup_printf ("full_name -%d", _data_->_tmp4_);
#line 112 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->persona_name = _data_->_tmp5_;
#line 113 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp6_ = NULL;
#line 113 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp6_ = g_str_hash;
#line 113 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp7_ = NULL;
#line 113 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp7_ = g_str_equal;
#line 113 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp8_ = NULL;
#line 113 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp8_ = g_hash_table_new_full (_data_->_tmp6_, _data_->_tmp7_, _g_free0_, __vala_GValue_free0_);
#line 113 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->details = _data_->_tmp8_;
#line 116 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				memset (&_data_->_tmp9_, 0, sizeof (GValue));
#line 116 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				g_value_init (&_data_->_tmp9_, G_TYPE_STRING);
#line 116 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				memset (&_data_->_tmp10_, 0, sizeof (GValue));
#line 116 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp10_ = _data_->_tmp9_;
#line 116 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp11_ = NULL;
#line 116 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp11_ = __g_value_dup0 (&_data_->_tmp10_);
#line 116 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp12_ = NULL;
#line 116 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp12_ = _data_->_tmp11_;
#line 116 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				G_IS_VALUE (&_data_->_tmp10_) ? (g_value_unset (&_data_->_tmp10_), NULL) : NULL;
#line 116 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->v1 = _data_->_tmp12_;
#line 117 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp13_ = NULL;
#line 117 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp13_ = _data_->v1;
#line 117 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp14_ = NULL;
#line 117 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp14_ = _data_->persona_name;
#line 117 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				g_value_set_string (_data_->_tmp13_, _data_->_tmp14_);
#line 118 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp15_ = NULL;
#line 118 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp15_ = _data_->details;
#line 118 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp16_ = NULL;
#line 118 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp16_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_FULL_NAME);
#line 118 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp17_ = NULL;
#line 118 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp17_ = g_strdup (_data_->_tmp16_);
#line 118 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp18_ = NULL;
#line 118 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->_tmp18_ = _data_->v1;
#line 118 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_data_->v1 = NULL;
#line 118 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				g_hash_table_insert (_data_->_tmp15_, _data_->_tmp17_, _data_->_tmp18_);
#line 978 "add-contacts-stress-test.c"
				{
#line 124 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->_tmp19_ = NULL;
#line 124 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->_tmp19_ = _data_->self->priv->_aggregator;
#line 124 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->_tmp20_ = NULL;
#line 124 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->_tmp20_ = _data_->self->priv->_pstore;
#line 124 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->_tmp21_ = NULL;
#line 124 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->_tmp21_ = _data_->details;
#line 124 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->_state_ = 1;
#line 124 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					folks_individual_aggregator_add_persona_from_details (_data_->_tmp19_, NULL, (FolksPersonaStore*) _data_->_tmp20_, _data_->_tmp21_, _add_contacts_stress_test_tests_add_contacts_ready, _data_);
#line 124 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					return FALSE;
#line 998 "add-contacts-stress-test.c"
					_state_1:
#line 124 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->_tmp22_ = NULL;
#line 124 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->_tmp22_ = folks_individual_aggregator_add_persona_from_details_finish (_data_->_tmp19_, _data_->_res_, &_data_->_inner_error_);
#line 124 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->_tmp23_ = NULL;
#line 124 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->_tmp23_ = _data_->_tmp22_;
#line 124 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					_g_object_unref0 (_data_->_tmp23_);
#line 124 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 124 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
						if (_data_->_inner_error_->domain == FOLKS_INDIVIDUAL_AGGREGATOR_ERROR) {
#line 1014 "add-contacts-stress-test.c"
							goto __catch1_folks_individual_aggregator_error;
						}
#line 124 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
						__vala_GValue_free0 (_data_->v1);
#line 124 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
						_g_hash_table_unref0 (_data_->details);
#line 124 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
						_g_free0 (_data_->persona_name);
#line 124 "/opt/gnome3/source/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 124 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
						g_clear_error (&_data_->_inner_error_);
#line 124 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
						return FALSE;
#line 1029 "add-contacts-stress-test.c"
					}
				}
				goto __finally1;
				__catch1_folks_individual_aggregator_error:
				{
#line 122 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->e = _data_->_inner_error_;
#line 122 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->_inner_error_ = NULL;
#line 129 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->_tmp24_ = 0;
#line 129 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->_tmp24_ = _data_->i;
#line 129 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->_tmp25_ = NULL;
#line 129 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->_tmp25_ = _data_->e;
#line 129 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->_tmp26_ = NULL;
#line 129 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					_data_->_tmp26_ = _data_->_tmp25_->message;
#line 129 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					g_warning ("add-contacts-stress-test.vala:129: [AddContactsStressTest]: %d: %s\n", _data_->_tmp24_, _data_->_tmp26_);
#line 122 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					_g_error_free0 (_data_->e);
#line 1055 "add-contacts-stress-test.c"
				}
				__finally1:
#line 122 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 122 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					__vala_GValue_free0 (_data_->v1);
#line 122 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					_g_hash_table_unref0 (_data_->details);
#line 122 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					_g_free0 (_data_->persona_name);
#line 122 "/opt/gnome3/source/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 122 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					g_clear_error (&_data_->_inner_error_);
#line 122 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					return FALSE;
#line 1072 "add-contacts-stress-test.c"
				}
#line 110 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				__vala_GValue_free0 (_data_->v1);
#line 110 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_g_hash_table_unref0 (_data_->details);
#line 110 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_g_free0 (_data_->persona_name);
#line 1080 "add-contacts-stress-test.c"
			}
		}
	}
#line 108 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	if (_data_->_state_ == 0) {
#line 108 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1088 "add-contacts-stress-test.c"
	} else {
#line 108 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 1092 "add-contacts-stress-test.c"
	}
#line 108 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	g_object_unref (_data_->_async_result);
#line 108 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	return FALSE;
#line 1098 "add-contacts-stress-test.c"
}


static void _add_contacts_stress_test_tests_individuals_changed_cb (AddContactsStressTestTests* self, GeeMultiMap* changes) {
	GeeCollection* added = NULL;
	GeeMultiMap* _tmp0_ = NULL;
	GeeCollection* _tmp1_ = NULL;
	GeeSet* removed = NULL;
	GeeMultiMap* _tmp2_ = NULL;
	GeeSet* _tmp3_ = NULL;
	GeeSet* _tmp21_ = NULL;
	gint _tmp22_ = 0;
	gint _tmp23_ = 0;
#line 135 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	g_return_if_fail (self != NULL);
#line 135 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	g_return_if_fail (changes != NULL);
#line 138 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp0_ = changes;
#line 138 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp1_ = gee_multi_map_get_values (_tmp0_);
#line 138 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	added = _tmp1_;
#line 139 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp2_ = changes;
#line 139 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp3_ = gee_multi_map_get_keys (_tmp2_);
#line 139 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	removed = _tmp3_;
#line 1128 "add-contacts-stress-test.c"
	{
		GeeIterator* _i_it = NULL;
		GeeCollection* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
#line 141 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		_tmp4_ = added;
#line 141 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
#line 141 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		_i_it = _tmp5_;
#line 141 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		while (TRUE) {
#line 1141 "add-contacts-stress-test.c"
			GeeIterator* _tmp6_ = NULL;
			gboolean _tmp7_ = FALSE;
			FolksIndividual* i = NULL;
			GeeIterator* _tmp8_ = NULL;
			gpointer _tmp9_ = NULL;
			FolksIndividual* _tmp10_ = NULL;
			GHashTable* _tmp11_ = NULL;
			FolksIndividual* _tmp12_ = NULL;
			const gchar* _tmp13_ = NULL;
			const gchar* _tmp14_ = NULL;
			gconstpointer _tmp15_ = NULL;
			GHashTable* _tmp16_ = NULL;
			FolksIndividual* _tmp17_ = NULL;
			const gchar* _tmp18_ = NULL;
			const gchar* _tmp19_ = NULL;
			gchar* _tmp20_ = NULL;
#line 141 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp6_ = _i_it;
#line 141 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp7_ = gee_iterator_next (_tmp6_);
#line 141 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			if (!_tmp7_) {
#line 141 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				break;
#line 1166 "add-contacts-stress-test.c"
			}
#line 141 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp8_ = _i_it;
#line 141 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp9_ = gee_iterator_get (_tmp8_);
#line 141 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			i = (FolksIndividual*) _tmp9_;
#line 143 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp10_ = i;
#line 143 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_vala_assert (_tmp10_ != NULL, "i != null");
#line 145 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp11_ = self->priv->_contacts_found;
#line 145 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp12_ = i;
#line 145 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp13_ = folks_name_details_get_full_name ((FolksNameDetails*) _tmp12_);
#line 145 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp14_ = _tmp13_;
#line 145 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp15_ = g_hash_table_lookup (_tmp11_, _tmp14_);
#line 145 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_vala_assert (((gboolean) ((gintptr) _tmp15_)) == FALSE, "this._contacts_found.lookup (i.full_name) == false");
#line 146 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp16_ = self->priv->_contacts_found;
#line 146 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp17_ = i;
#line 146 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp18_ = folks_name_details_get_full_name ((FolksNameDetails*) _tmp17_);
#line 146 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp19_ = _tmp18_;
#line 146 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp20_ = g_strdup (_tmp19_);
#line 146 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			g_hash_table_replace (_tmp16_, _tmp20_, (gpointer) ((gintptr) TRUE));
#line 141 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_g_object_unref0 (i);
#line 1204 "add-contacts-stress-test.c"
		}
#line 141 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		_g_object_unref0 (_i_it);
#line 1208 "add-contacts-stress-test.c"
	}
#line 149 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp21_ = removed;
#line 149 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp22_ = gee_collection_get_size ((GeeCollection*) _tmp21_);
#line 149 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp23_ = _tmp22_;
#line 149 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_vala_assert (_tmp23_ == 1, "removed.size == 1");
#line 1218 "add-contacts-stress-test.c"
	{
		GeeIterator* _i_it = NULL;
		GeeSet* _tmp24_ = NULL;
		GeeIterator* _tmp25_ = NULL;
#line 151 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		_tmp24_ = removed;
#line 151 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		_tmp25_ = gee_iterable_iterator ((GeeIterable*) _tmp24_);
#line 151 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		_i_it = _tmp25_;
#line 151 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		while (TRUE) {
#line 1231 "add-contacts-stress-test.c"
			GeeIterator* _tmp26_ = NULL;
			gboolean _tmp27_ = FALSE;
			FolksIndividual* i = NULL;
			GeeIterator* _tmp28_ = NULL;
			gpointer _tmp29_ = NULL;
			FolksIndividual* _tmp30_ = NULL;
#line 151 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp26_ = _i_it;
#line 151 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp27_ = gee_iterator_next (_tmp26_);
#line 151 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			if (!_tmp27_) {
#line 151 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				break;
#line 1246 "add-contacts-stress-test.c"
			}
#line 151 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp28_ = _i_it;
#line 151 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp29_ = gee_iterator_get (_tmp28_);
#line 151 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			i = (FolksIndividual*) _tmp29_;
#line 153 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp30_ = i;
#line 153 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_vala_assert (_tmp30_ == NULL, "i == null");
#line 151 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_g_object_unref0 (i);
#line 1260 "add-contacts-stress-test.c"
		}
#line 151 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		_g_object_unref0 (_i_it);
#line 1264 "add-contacts-stress-test.c"
	}
#line 156 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_add_contacts_stress_test_tests_exit_if_all_contacts_found (self);
#line 135 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_g_object_unref0 (removed);
#line 135 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_g_object_unref0 (added);
#line 1272 "add-contacts-stress-test.c"
}


static void _add_contacts_stress_test_tests_notify_pstore_cb (AddContactsStressTestTests* self, GObject* _pstore, GParamSpec* ps) {
#line 159 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	g_return_if_fail (self != NULL);
#line 159 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	g_return_if_fail (_pstore != NULL);
#line 159 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	g_return_if_fail (ps != NULL);
#line 161 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_add_contacts_stress_test_tests_try_to_add (self);
#line 1285 "add-contacts-stress-test.c"
}


static void _add_contacts_stress_test_tests_try_to_add (AddContactsStressTestTests* self) {
	GError * _inner_error_ = NULL;
#line 164 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	g_return_if_fail (self != NULL);
#line 1293 "add-contacts-stress-test.c"
	{
		gboolean _tmp0_ = FALSE;
#line 166 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		_tmp0_ = self->priv->_added_contacts;
#line 166 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		g_static_rec_mutex_lock (&self->priv->__lock__added_contacts);
#line 1300 "add-contacts-stress-test.c"
		{
			gboolean _tmp1_ = FALSE;
			EdsfPersonaStore* _tmp2_ = NULL;
			gboolean _tmp3_ = FALSE;
			gboolean _tmp4_ = FALSE;
#line 168 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp2_ = self->priv->_pstore;
#line 168 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp3_ = folks_persona_store_get_is_prepared ((FolksPersonaStore*) _tmp2_);
#line 168 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp4_ = _tmp3_;
#line 168 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			if (_tmp4_) {
#line 1314 "add-contacts-stress-test.c"
				gboolean _tmp5_ = FALSE;
#line 169 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_tmp5_ = self->priv->_added_contacts;
#line 169 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_tmp1_ = _tmp5_ == FALSE;
#line 1320 "add-contacts-stress-test.c"
			} else {
#line 168 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_tmp1_ = FALSE;
#line 1324 "add-contacts-stress-test.c"
			}
#line 168 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			if (_tmp1_) {
#line 171 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				self->priv->_added_contacts = TRUE;
#line 172 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_add_contacts_stress_test_tests_add_contacts (self, NULL, NULL);
#line 1332 "add-contacts-stress-test.c"
			}
		}
		__finally2:
		{
			gboolean _tmp6_ = FALSE;
#line 166 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			_tmp6_ = self->priv->_added_contacts;
#line 166 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			g_static_rec_mutex_unlock (&self->priv->__lock__added_contacts);
#line 1342 "add-contacts-stress-test.c"
		}
#line 166 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 166 "/opt/gnome3/source/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 166 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			g_clear_error (&_inner_error_);
#line 166 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			return;
#line 1352 "add-contacts-stress-test.c"
		}
	}
}


static void _add_contacts_stress_test_tests_exit_if_all_contacts_found (AddContactsStressTestTests* self) {
	GHashTable* _tmp0_ = NULL;
	GList* _tmp1_ = NULL;
	GMainLoop* _tmp6_ = NULL;
#line 177 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	g_return_if_fail (self != NULL);
#line 179 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp0_ = self->priv->_contacts_found;
#line 179 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp1_ = g_hash_table_get_keys (_tmp0_);
#line 1368 "add-contacts-stress-test.c"
	{
		GList* k_collection = NULL;
		GList* k_it = NULL;
#line 179 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		k_collection = _tmp1_;
#line 179 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		for (k_it = k_collection; k_it != NULL; k_it = k_it->next) {
#line 1376 "add-contacts-stress-test.c"
			const gchar* k = NULL;
#line 179 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
			k = (const gchar*) k_it->data;
#line 1380 "add-contacts-stress-test.c"
			{
				gboolean v = FALSE;
				GHashTable* _tmp2_ = NULL;
				const gchar* _tmp3_ = NULL;
				gconstpointer _tmp4_ = NULL;
				gboolean _tmp5_ = FALSE;
#line 181 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_tmp2_ = self->priv->_contacts_found;
#line 181 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_tmp3_ = k;
#line 181 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_tmp4_ = g_hash_table_lookup (_tmp2_, _tmp3_);
#line 181 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				v = (gboolean) ((gintptr) _tmp4_);
#line 182 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				_tmp5_ = v;
#line 182 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
				if (_tmp5_ == FALSE) {
#line 183 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					_g_list_free0 (k_collection);
#line 183 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
					return;
#line 1403 "add-contacts-stress-test.c"
				}
			}
		}
#line 179 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
		_g_list_free0 (k_collection);
#line 1409 "add-contacts-stress-test.c"
	}
#line 185 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp6_ = self->priv->_main_loop;
#line 185 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	g_main_loop_quit (_tmp6_);
#line 1415 "add-contacts-stress-test.c"
}


static void add_contacts_stress_test_tests_class_init (AddContactsStressTestTestsClass * klass) {
#line 24 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	add_contacts_stress_test_tests_parent_class = g_type_class_peek_parent (klass);
#line 24 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	g_type_class_add_private (klass, sizeof (AddContactsStressTestTestsPrivate));
#line 24 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	G_OBJECT_CLASS (klass)->finalize = add_contacts_stress_test_tests_finalize;
#line 1426 "add-contacts-stress-test.c"
}


static void add_contacts_stress_test_tests_instance_init (AddContactsStressTestTests * self) {
#line 24 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	self->priv = ADD_CONTACTS_STRESS_TEST_TESTS_GET_PRIVATE (self);
#line 29 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	g_static_rec_mutex_init (&self->priv->__lock__added_contacts);
#line 29 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	self->priv->_added_contacts = FALSE;
#line 31 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	self->priv->_contacts_cnt = 1000;
#line 1439 "add-contacts-stress-test.c"
}


static void add_contacts_stress_test_tests_finalize (GObject* obj) {
	AddContactsStressTestTests * self;
#line 24 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_ADD_CONTACTS_STRESS_TEST_TESTS, AddContactsStressTestTests);
#line 26 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_g_main_loop_unref0 (self->priv->_main_loop);
#line 27 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_g_object_unref0 (self->priv->_aggregator);
#line 28 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_g_object_unref0 (self->priv->_pstore);
#line 29 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	g_static_rec_mutex_free (&self->priv->__lock__added_contacts);
#line 30 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_g_hash_table_unref0 (self->priv->_contacts_found);
#line 32 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_g_date_time_unref0 (self->priv->_start_time);
#line 24 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	G_OBJECT_CLASS (add_contacts_stress_test_tests_parent_class)->finalize (obj);
#line 1461 "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 (EDS_TEST_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;
	AddContactsStressTestTests* tests = NULL;
	AddContactsStressTestTests* _tmp0_ = NULL;
#line 191 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	g_test_init (&args_length1, &args, NULL);
#line 193 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_tmp0_ = add_contacts_stress_test_tests_new ();
#line 193 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	tests = _tmp0_;
#line 194 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	folks_test_case_register ((FolksTestCase*) tests);
#line 195 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	g_test_run ();
#line 196 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	folks_test_case_final_tear_down ((FolksTestCase*) tests);
#line 198 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	result = 0;
#line 198 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	_g_object_unref0 (tests);
#line 198 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	return result;
#line 1499 "add-contacts-stress-test.c"
}


int main (int argc, char ** argv) {
#if !GLIB_CHECK_VERSION (2,35,0)
	g_type_init ();
#endif
#line 189 "/opt/gnome3/source/folks/tests/eds/add-contacts-stress-test.vala"
	return _vala_main (argv, argc);
#line 1509 "add-contacts-stress-test.c"
}



