/* store-removed.c generated by valac 0.14.0.3-1a311, the Vala compiler
 * generated from store-removed.vala, do not modify */

/*
 * Copyright (C) 2011 Philip Withnall
 *
 * This library is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 2.1 of the License, or
 * (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Authors: Philip Withnall <philip@tecnocode.co.uk>
 *
 */

#include <glib.h>
#include <glib-object.h>
#include <folks-test.h>
#include <eds-test.h>
#include <folks/folks.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include <folks/folks-eds.h>
#include <gio/gio.h>
#include <libedataserver/e-account.h>
#include <libedataserver/e-source.h>
#include <libebook/e-book-client.h>


#define TYPE_STORE_REMOVED_TESTS (store_removed_tests_get_type ())
#define STORE_REMOVED_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_STORE_REMOVED_TESTS, StoreRemovedTests))
#define STORE_REMOVED_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_STORE_REMOVED_TESTS, StoreRemovedTestsClass))
#define IS_STORE_REMOVED_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_STORE_REMOVED_TESTS))
#define IS_STORE_REMOVED_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_STORE_REMOVED_TESTS))
#define STORE_REMOVED_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_STORE_REMOVED_TESTS, StoreRemovedTestsClass))

typedef struct _StoreRemovedTests StoreRemovedTests;
typedef struct _StoreRemovedTestsClass StoreRemovedTestsClass;
typedef struct _StoreRemovedTestsPrivate StoreRemovedTestsPrivate;
#define _eds_test_backend_unref0(var) ((var == NULL) ? NULL : (var = (eds_test_backend_unref (var), NULL)))
#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 __vala_GValue_free0(var) ((var == NULL) ? NULL : (var = (_vala_GValue_free (var), NULL)))
typedef struct _Block1Data Block1Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _StoreRemovedTestsTestSingleStorePart1AsyncData StoreRemovedTestsTestSingleStorePart1AsyncData;
typedef struct _Block2Data Block2Data;
typedef struct _StoreRemovedTestsTestSingleStorePart2AsyncData StoreRemovedTestsTestSingleStorePart2AsyncData;

struct _StoreRemovedTests {
	FolksTestCase parent_instance;
	StoreRemovedTestsPrivate * priv;
};

struct _StoreRemovedTestsClass {
	FolksTestCaseClass parent_class;
};

struct _StoreRemovedTestsPrivate {
	EdsTestBackend* _eds_backend;
	GMainLoop* _main_loop;
	FolksIndividualAggregator* _aggregator;
};

struct _Block1Data {
	int _ref_count_;
	StoreRemovedTests * self;
	gulong signal_id;
	gpointer _async_data_;
};

struct _StoreRemovedTestsTestSingleStorePart1AsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	StoreRemovedTests* self;
	Block1Data* _data1_;
	EdsTestBackend* _tmp0_;
	FolksBackendStore* _tmp1_;
	FolksBackendStore* store;
	FolksIndividualAggregator* _tmp2_;
	FolksIndividualAggregator* _tmp3_;
	gulong _tmp4_;
	FolksIndividualAggregator* _tmp5_;
	GError* e;
	GError* _tmp6_;
	const gchar* _tmp7_;
	GError * _inner_error_;
};

struct _Block2Data {
	int _ref_count_;
	StoreRemovedTests * self;
	gulong signal_id;
	gpointer _async_data_;
};

struct _StoreRemovedTestsTestSingleStorePart2AsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	StoreRemovedTests* self;
	Block2Data* _data2_;
	FolksIndividualAggregator* _tmp0_;
	gulong _tmp1_;
	ESourceList* source_list;
	ESourceList* _tmp2_;
	ESourceList* _tmp3_;
	EdsTestBackend* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	GError* e1;
	GError* _tmp7_;
	const gchar* _tmp8_;
	GError * _inner_error_;
};


static gpointer store_removed_tests_parent_class = NULL;

GType store_removed_tests_get_type (void) G_GNUC_CONST;
#define STORE_REMOVED_TESTS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_STORE_REMOVED_TESTS, StoreRemovedTestsPrivate))
enum  {
	STORE_REMOVED_TESTS_DUMMY_PROPERTY
};
StoreRemovedTests* store_removed_tests_new (void);
StoreRemovedTests* store_removed_tests_construct (GType object_type);
void store_removed_tests_test_single_store (StoreRemovedTests* self);
static void _store_removed_tests_test_single_store_folks_test_case_test_method (gpointer self);
static void store_removed_tests_real_set_up (FolksTestCase* base);
static void store_removed_tests_real_tear_down (FolksTestCase* base);
static GValue* _g_value_dup (GValue* self);
static void _vala_GValue_free (GValue* self);
static void _store_removed_tests_test_single_store_part1_async (StoreRemovedTests* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _store_removed_tests_test_single_store_part1_finish (StoreRemovedTests* self, GAsyncResult* _res_);
static gboolean __lambda1_ (StoreRemovedTests* self);
static gboolean ___lambda1__gsource_func (gpointer self);
static void _store_removed_tests_test_single_store_part2_async (StoreRemovedTests* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _store_removed_tests_test_single_store_part2_finish (StoreRemovedTests* self, GAsyncResult* _res_);
static gboolean __lambda3_ (StoreRemovedTests* self);
static gboolean ___lambda3__gsource_func (gpointer self);
static void _store_removed_tests_test_single_store_part1_async_data_free (gpointer _data);
static gboolean _store_removed_tests_test_single_store_part1_async_co (StoreRemovedTestsTestSingleStorePart1AsyncData* _data_);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (Block1Data* _data1_);
static void _store_removed_tests_test_single_store_part1_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void __lambda0_ (Block1Data* _data1_, GeeMultiMap* changes);
static void ___lambda0__folks_individual_aggregator_individuals_changed_detailed (FolksIndividualAggregator* _sender, GeeMultiMap* changes, gpointer self);
static void _store_removed_tests_test_single_store_part2_async_data_free (gpointer _data);
static gboolean _store_removed_tests_test_single_store_part2_async_co (StoreRemovedTestsTestSingleStorePart2AsyncData* _data_);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (Block2Data* _data2_);
static void __lambda2_ (Block2Data* _data2_, GeeMultiMap* changes);
static void ___lambda2__folks_individual_aggregator_individuals_changed_detailed (FolksIndividualAggregator* _sender, GeeMultiMap* changes, gpointer self);
static void store_removed_tests_finalize (GObject* obj);
gint _vala_main (gchar** args, int args_length1);


static void _store_removed_tests_test_single_store_folks_test_case_test_method (gpointer self) {
#line 37 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	store_removed_tests_test_single_store (self);
#line 174 "store-removed.c"
}


StoreRemovedTests* store_removed_tests_construct (GType object_type) {
	StoreRemovedTests * self = NULL;
	EdsTestBackend* _tmp0_;
#line 33 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	self = (StoreRemovedTests*) folks_test_case_construct (object_type, "StoreRemoved");
#line 35 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp0_ = eds_test_backend_new ();
#line 35 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_eds_test_backend_unref0 (self->priv->_eds_backend);
#line 35 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	self->priv->_eds_backend = _tmp0_;
#line 37 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	folks_test_case_add_test ((FolksTestCase*) self, "single store", _store_removed_tests_test_single_store_folks_test_case_test_method, self);
#line 31 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	return self;
#line 193 "store-removed.c"
}


StoreRemovedTests* store_removed_tests_new (void) {
#line 31 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	return store_removed_tests_construct (TYPE_STORE_REMOVED_TESTS);
#line 200 "store-removed.c"
}


static void store_removed_tests_real_set_up (FolksTestCase* base) {
	StoreRemovedTests * self;
	EdsTestBackend* _tmp0_;
#line 40 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	self = (StoreRemovedTests*) base;
#line 42 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp0_ = self->priv->_eds_backend;
#line 42 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	eds_test_backend_set_up (_tmp0_, FALSE);
#line 213 "store-removed.c"
}


static void store_removed_tests_real_tear_down (FolksTestCase* base) {
	StoreRemovedTests * self;
	EdsTestBackend* _tmp0_;
#line 45 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	self = (StoreRemovedTests*) base;
#line 47 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp0_ = self->priv->_eds_backend;
#line 47 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	eds_test_backend_tear_down (_tmp0_);
#line 226 "store-removed.c"
}


static GValue* _g_value_dup (GValue* self) {
#line 57 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	return g_boxed_copy (G_TYPE_VALUE, self);
#line 233 "store-removed.c"
}


static void _vala_GValue_free (GValue* self) {
#line 57 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_value_unset (self);
#line 57 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_free (self);
#line 242 "store-removed.c"
}


static gpointer __g_value_dup0 (gpointer self) {
#line 59 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	return self ? _g_value_dup (self) : NULL;
#line 249 "store-removed.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 67 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	return self ? g_object_ref (self) : NULL;
#line 256 "store-removed.c"
}


static gboolean __lambda1_ (StoreRemovedTests* self) {
	gboolean result = FALSE;
#line 74 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_critical ("store-removed.vala:74: Timeout reached.");
#line 75 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	result = FALSE;
#line 75 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	return result;
#line 268 "store-removed.c"
}


static gboolean ___lambda1__gsource_func (gpointer self) {
	gboolean result;
	result = __lambda1_ (self);
#line 72 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	return result;
#line 277 "store-removed.c"
}


static gboolean __lambda3_ (StoreRemovedTests* self) {
	gboolean result = FALSE;
#line 90 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_critical ("store-removed.vala:90: Timeout reached.");
#line 91 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	result = FALSE;
#line 91 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	return result;
#line 289 "store-removed.c"
}


static gboolean ___lambda3__gsource_func (gpointer self) {
	gboolean result;
	result = __lambda3_ (self);
#line 88 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	return result;
#line 298 "store-removed.c"
}


void store_removed_tests_test_single_store (StoreRemovedTests* self) {
	GMainLoop* _tmp0_;
	EdsTestBackend* _tmp1_;
	GeeHashMap* _tmp2_;
	GeeHashMap* c1;
	GValue _tmp3_ = {0};
	GValue _tmp4_;
	GValue* _tmp5_;
	GValue* _tmp6_;
	GValue* v;
	GValue* _tmp7_;
	GValue* _tmp8_;
	GValue* _tmp9_;
	GValue _tmp10_ = {0};
	GValue _tmp11_;
	GValue* _tmp12_;
	GValue* _tmp13_;
	const gchar* _tmp14_;
	GValue* _tmp15_;
	GValue* _tmp16_;
	EdsTestBackend* _tmp17_;
	GeeHashMap* _tmp18_;
	guint _tmp19_ = 0U;
	guint timeout_id;
	GMainLoop* _tmp20_;
	FolksIndividualAggregator* _tmp21_;
	GeeMap* _tmp22_;
	GeeMap* _tmp23_;
	gint _tmp24_;
	gint _tmp25_;
	guint _tmp26_;
	guint _tmp27_ = 0U;
	GMainLoop* _tmp28_;
	FolksIndividualAggregator* _tmp29_;
	GeeMap* _tmp30_;
	GeeMap* _tmp31_;
	gint _tmp32_;
	gint _tmp33_;
	guint _tmp34_;
#line 50 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_return_if_fail (self != NULL);
#line 52 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp0_ = g_main_loop_new (NULL, FALSE);
#line 52 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_g_main_loop_unref0 (self->priv->_main_loop);
#line 52 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	self->priv->_main_loop = _tmp0_;
#line 54 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp1_ = self->priv->_eds_backend;
#line 54 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	eds_test_backend_reset (_tmp1_);
#line 57 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp2_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_VALUE, (GBoxedCopyFunc) _g_value_dup, _vala_GValue_free, NULL, NULL, NULL);
#line 57 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	c1 = _tmp2_;
#line 59 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_value_init (&_tmp3_, G_TYPE_STRING);
#line 59 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp4_ = _tmp3_;
#line 59 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp5_ = __g_value_dup0 (&_tmp4_);
#line 59 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp6_ = _tmp5_;
#line 59 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	G_IS_VALUE (&_tmp4_) ? (g_value_unset (&_tmp4_), NULL) : NULL;
#line 59 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	v = _tmp6_;
#line 60 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp7_ = v;
#line 60 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_value_set_string (_tmp7_, "Chancellor Brian Blessed");
#line 61 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp8_ = v;
#line 61 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	v = NULL;
#line 61 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp9_ = _tmp8_;
#line 61 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	gee_abstract_map_set ((GeeAbstractMap*) c1, "full_name", _tmp9_);
#line 61 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	__vala_GValue_free0 (_tmp9_);
#line 63 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_value_init (&_tmp10_, G_TYPE_STRING);
#line 63 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp11_ = _tmp10_;
#line 63 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp12_ = __g_value_dup0 (&_tmp11_);
#line 63 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	__vala_GValue_free0 (v);
#line 63 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	v = _tmp12_;
#line 63 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	G_IS_VALUE (&_tmp11_) ? (g_value_unset (&_tmp11_), NULL) : NULL;
#line 64 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp13_ = v;
#line 64 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_value_set_string (_tmp13_, "brian@example.com");
#line 65 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp14_ = EDSF_PERSONA_email_fields[0];
#line 65 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp15_ = v;
#line 65 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	v = NULL;
#line 65 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp16_ = _tmp15_;
#line 65 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	gee_abstract_map_set ((GeeAbstractMap*) c1, _tmp14_, _tmp16_);
#line 65 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	__vala_GValue_free0 (_tmp16_);
#line 67 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp17_ = self->priv->_eds_backend;
#line 67 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp18_ = _g_object_ref0 (c1);
#line 67 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	eds_test_backend_add_contact (_tmp17_, _tmp18_);
#line 70 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_store_removed_tests_test_single_store_part1_async (self, NULL, NULL);
#line 72 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp19_ = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 5, ___lambda1__gsource_func, g_object_ref (self), g_object_unref);
#line 72 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	timeout_id = _tmp19_;
#line 78 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp20_ = self->priv->_main_loop;
#line 78 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_main_loop_run (_tmp20_);
#line 81 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp21_ = self->priv->_aggregator;
#line 81 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp22_ = folks_individual_aggregator_get_individuals (_tmp21_);
#line 81 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp23_ = _tmp22_;
#line 81 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp24_ = gee_map_get_size (_tmp23_);
#line 81 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp25_ = _tmp24_;
#line 81 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_assert (_tmp25_ == 1);
#line 83 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp26_ = timeout_id;
#line 83 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_source_remove (_tmp26_);
#line 86 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_store_removed_tests_test_single_store_part2_async (self, NULL, NULL);
#line 88 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp27_ = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 5, ___lambda3__gsource_func, g_object_ref (self), g_object_unref);
#line 88 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	timeout_id = _tmp27_;
#line 94 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp28_ = self->priv->_main_loop;
#line 94 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_main_loop_run (_tmp28_);
#line 97 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp29_ = self->priv->_aggregator;
#line 97 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp30_ = folks_individual_aggregator_get_individuals (_tmp29_);
#line 97 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp31_ = _tmp30_;
#line 97 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp32_ = gee_map_get_size (_tmp31_);
#line 97 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp33_ = _tmp32_;
#line 97 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_assert (_tmp33_ == 0);
#line 99 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp34_ = timeout_id;
#line 99 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_source_remove (_tmp34_);
#line 50 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	__vala_GValue_free0 (v);
#line 50 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_g_object_unref0 (c1);
#line 473 "store-removed.c"
}


static void _store_removed_tests_test_single_store_part1_async_data_free (gpointer _data) {
	StoreRemovedTestsTestSingleStorePart1AsyncData* _data_;
	_data_ = _data;
#line 25 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_g_object_unref0 (_data_->self);
#line 25 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_slice_free (StoreRemovedTestsTestSingleStorePart1AsyncData, _data_);
#line 484 "store-removed.c"
}


static void _store_removed_tests_test_single_store_part1_async (StoreRemovedTests* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	StoreRemovedTestsTestSingleStorePart1AsyncData* _data_;
	StoreRemovedTests* _tmp0_;
#line 25 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_ = g_slice_new0 (StoreRemovedTestsTestSingleStorePart1AsyncData);
#line 25 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _store_removed_tests_test_single_store_part1_async);
#line 25 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _store_removed_tests_test_single_store_part1_async_data_free);
#line 25 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 25 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->self = _tmp0_;
#line 25 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_store_removed_tests_test_single_store_part1_async_co (_data_);
#line 503 "store-removed.c"
}


static void _store_removed_tests_test_single_store_part1_finish (StoreRemovedTests* self, GAsyncResult* _res_) {
	StoreRemovedTestsTestSingleStorePart1AsyncData* _data_;
#line 25 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 511 "store-removed.c"
}


static Block1Data* block1_data_ref (Block1Data* _data1_) {
#line 102 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_atomic_int_inc (&_data1_->_ref_count_);
#line 102 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	return _data1_;
#line 520 "store-removed.c"
}


static void block1_data_unref (Block1Data* _data1_) {
#line 102 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
#line 102 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_g_object_unref0 (_data1_->self);
#line 102 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		g_slice_free (Block1Data, _data1_);
#line 531 "store-removed.c"
	}
}


static void _store_removed_tests_test_single_store_part1_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	StoreRemovedTestsTestSingleStorePart1AsyncData* _data_;
#line 104 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_ = _user_data_;
#line 104 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->_source_object_ = source_object;
#line 104 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->_res_ = _res_;
#line 104 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_store_removed_tests_test_single_store_part1_async_co (_data_);
#line 546 "store-removed.c"
}


static void __lambda0_ (Block1Data* _data1_, GeeMultiMap* changes) {
	StoreRemovedTests * self;
	GeeMultiMap* _tmp0_;
	GeeCollection* _tmp1_ = NULL;
	GeeCollection* added;
	GeeMultiMap* _tmp2_;
	GeeSet* _tmp3_ = NULL;
	GeeSet* removed;
	GeeCollection* _tmp4_;
	gint _tmp5_;
	gint _tmp6_;
	GeeSet* _tmp14_;
	gint _tmp15_;
	gint _tmp16_;
	GMainLoop* _tmp24_;
	FolksIndividualAggregator* _tmp25_;
	gulong _tmp26_;
#line 113 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	self = _data1_->self;
#line 113 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_return_if_fail (changes != NULL);
#line 115 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp0_ = changes;
#line 115 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp1_ = gee_multi_map_get_values (_tmp0_);
#line 115 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	added = _tmp1_;
#line 116 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp2_ = changes;
#line 116 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp3_ = gee_multi_map_get_keys (_tmp2_);
#line 116 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	removed = _tmp3_;
#line 118 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp4_ = added;
#line 118 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp5_ = gee_collection_get_size (_tmp4_);
#line 118 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp6_ = _tmp5_;
#line 118 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_assert (_tmp6_ == 1);
#line 591 "store-removed.c"
	{
		GeeCollection* _tmp7_;
		GeeIterator* _tmp8_ = NULL;
		GeeIterator* _i_it;
#line 122 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_tmp7_ = added;
#line 122 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_tmp8_ = gee_iterable_iterator ((GeeIterable*) _tmp7_);
#line 122 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_i_it = _tmp8_;
#line 122 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		while (TRUE) {
#line 604 "store-removed.c"
			GeeIterator* _tmp9_;
			gboolean _tmp10_ = FALSE;
			GeeIterator* _tmp11_;
			gpointer _tmp12_ = NULL;
			FolksIndividual* i;
			FolksIndividual* _tmp13_;
#line 122 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			_tmp9_ = _i_it;
#line 122 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			_tmp10_ = gee_iterator_next (_tmp9_);
#line 122 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			if (!_tmp10_) {
#line 122 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
				break;
#line 619 "store-removed.c"
			}
#line 122 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			_tmp11_ = _i_it;
#line 122 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			_tmp12_ = gee_iterator_get (_tmp11_);
#line 122 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			i = (FolksIndividual*) _tmp12_;
#line 124 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			_tmp13_ = i;
#line 124 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			g_assert (_tmp13_ != NULL);
#line 122 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			_g_object_unref0 (i);
#line 633 "store-removed.c"
		}
#line 122 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_g_object_unref0 (_i_it);
#line 637 "store-removed.c"
	}
#line 127 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp14_ = removed;
#line 127 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp15_ = gee_collection_get_size ((GeeCollection*) _tmp14_);
#line 127 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp16_ = _tmp15_;
#line 127 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_assert (_tmp16_ == 1);
#line 647 "store-removed.c"
	{
		GeeSet* _tmp17_;
		GeeIterator* _tmp18_ = NULL;
		GeeIterator* _i_it;
#line 129 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_tmp17_ = removed;
#line 129 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_tmp18_ = gee_iterable_iterator ((GeeIterable*) _tmp17_);
#line 129 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_i_it = _tmp18_;
#line 129 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		while (TRUE) {
#line 660 "store-removed.c"
			GeeIterator* _tmp19_;
			gboolean _tmp20_ = FALSE;
			GeeIterator* _tmp21_;
			gpointer _tmp22_ = NULL;
			FolksIndividual* i;
			FolksIndividual* _tmp23_;
#line 129 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			_tmp19_ = _i_it;
#line 129 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			_tmp20_ = gee_iterator_next (_tmp19_);
#line 129 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			if (!_tmp20_) {
#line 129 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
				break;
#line 675 "store-removed.c"
			}
#line 129 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			_tmp21_ = _i_it;
#line 129 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			_tmp22_ = gee_iterator_get (_tmp21_);
#line 129 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			i = (FolksIndividual*) _tmp22_;
#line 131 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			_tmp23_ = i;
#line 131 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			g_assert (_tmp23_ == NULL);
#line 129 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			_g_object_unref0 (i);
#line 689 "store-removed.c"
		}
#line 129 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_g_object_unref0 (_i_it);
#line 693 "store-removed.c"
	}
#line 135 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp24_ = self->priv->_main_loop;
#line 135 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_main_loop_quit (_tmp24_);
#line 136 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp25_ = self->priv->_aggregator;
#line 136 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp26_ = _data1_->signal_id;
#line 136 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_signal_handler_disconnect ((GObject*) _tmp25_, _tmp26_);
#line 113 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_g_object_unref0 (removed);
#line 113 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_g_object_unref0 (added);
#line 709 "store-removed.c"
}


static void ___lambda0__folks_individual_aggregator_individuals_changed_detailed (FolksIndividualAggregator* _sender, GeeMultiMap* changes, gpointer self) {
#line 112 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	__lambda0_ (self, changes);
#line 716 "store-removed.c"
}


static gboolean _store_removed_tests_test_single_store_part1_async_co (StoreRemovedTestsTestSingleStorePart1AsyncData* _data_) {
#line 102 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	switch (_data_->_state_) {
#line 102 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		case 0:
#line 725 "store-removed.c"
		goto _state_0;
#line 102 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		case 1:
#line 729 "store-removed.c"
		goto _state_1;
#line 102 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		case 2:
#line 733 "store-removed.c"
		goto _state_2;
#line 102 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		case 3:
#line 737 "store-removed.c"
		goto _state_3;
		default:
#line 102 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		g_assert_not_reached ();
#line 742 "store-removed.c"
	}
	_state_0:
#line 102 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->_data1_ = g_slice_new0 (Block1Data);
#line 102 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->_data1_->_ref_count_ = 1;
#line 102 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->_data1_->self = g_object_ref (_data_->self);
#line 102 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->_data1_->_async_data_ = _data_;
#line 104 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->_tmp0_ = _data_->self->priv->_eds_backend;
#line 104 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->_state_ = 1;
#line 104 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	eds_test_backend_commit_contacts_to_addressbook (_data_->_tmp0_, _store_removed_tests_test_single_store_part1_async_ready, _data_);
#line 104 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	return FALSE;
#line 761 "store-removed.c"
	_state_1:
#line 104 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	eds_test_backend_commit_contacts_to_addressbook_finish (_data_->_tmp0_, _data_->_res_);
#line 106 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->_tmp1_ = NULL;
#line 106 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->_tmp1_ = folks_backend_store_dup ();
#line 106 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->store = _data_->_tmp1_;
#line 107 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->_state_ = 2;
#line 107 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	folks_backend_store_prepare (_data_->store, _store_removed_tests_test_single_store_part1_async_ready, _data_);
#line 107 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	return FALSE;
#line 777 "store-removed.c"
	_state_2:
#line 107 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	folks_backend_store_prepare_finish (_data_->store, _data_->_res_);
#line 109 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->_tmp2_ = folks_individual_aggregator_new ();
#line 109 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_g_object_unref0 (_data_->self->priv->_aggregator);
#line 109 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->self->priv->_aggregator = _data_->_tmp2_;
#line 111 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->_data1_->signal_id = (gulong) 0;
#line 112 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->_tmp3_ = _data_->self->priv->_aggregator;
#line 112 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->_tmp4_ = 0UL;
#line 112 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->_tmp4_ = g_signal_connect_data (_data_->_tmp3_, "individuals-changed-detailed", (GCallback) ___lambda0__folks_individual_aggregator_individuals_changed_detailed, block1_data_ref (_data_->_data1_), (GClosureNotify) block1_data_unref, 0);
#line 112 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->_data1_->signal_id = _data_->_tmp4_;
#line 797 "store-removed.c"
	{
#line 141 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_data_->_tmp5_ = _data_->self->priv->_aggregator;
#line 141 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_data_->_state_ = 3;
#line 141 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		folks_individual_aggregator_prepare (_data_->_tmp5_, _store_removed_tests_test_single_store_part1_async_ready, _data_);
#line 141 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		return FALSE;
#line 807 "store-removed.c"
		_state_3:
#line 141 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		folks_individual_aggregator_prepare_finish (_data_->_tmp5_, _data_->_res_, &_data_->_inner_error_);
#line 141 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		if (_data_->_inner_error_ != NULL) {
#line 813 "store-removed.c"
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
#line 139 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_data_->e = _data_->_inner_error_;
#line 139 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_data_->_inner_error_ = NULL;
#line 145 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_data_->_tmp6_ = _data_->e;
#line 145 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_data_->_tmp7_ = _data_->_tmp6_->message;
#line 145 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		g_critical ("store-removed.vala:145: Error when calling prepare: %s", _data_->_tmp7_);
#line 139 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_g_error_free0 (_data_->e);
#line 832 "store-removed.c"
	}
	__finally0:
#line 139 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	if (_data_->_inner_error_ != NULL) {
#line 139 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_g_object_unref0 (_data_->store);
#line 139 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		block1_data_unref (_data_->_data1_);
#line 139 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_data_->_data1_ = NULL;
#line 139 "/home/treitter/collabora/folks/tests/eds/store-removed.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 139 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		g_clear_error (&_data_->_inner_error_);
#line 139 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		return FALSE;
#line 849 "store-removed.c"
	}
#line 102 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_g_object_unref0 (_data_->store);
#line 102 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	block1_data_unref (_data_->_data1_);
#line 102 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->_data1_ = NULL;
#line 102 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	if (_data_->_state_ == 0) {
#line 102 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 861 "store-removed.c"
	} else {
#line 102 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 865 "store-removed.c"
	}
#line 102 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_object_unref (_data_->_async_result);
#line 102 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	return FALSE;
#line 871 "store-removed.c"
}


static void _store_removed_tests_test_single_store_part2_async_data_free (gpointer _data) {
	StoreRemovedTestsTestSingleStorePart2AsyncData* _data_;
	_data_ = _data;
#line 25 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_g_object_unref0 (_data_->self);
#line 25 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_slice_free (StoreRemovedTestsTestSingleStorePart2AsyncData, _data_);
#line 882 "store-removed.c"
}


static void _store_removed_tests_test_single_store_part2_async (StoreRemovedTests* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	StoreRemovedTestsTestSingleStorePart2AsyncData* _data_;
	StoreRemovedTests* _tmp0_;
#line 25 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_ = g_slice_new0 (StoreRemovedTestsTestSingleStorePart2AsyncData);
#line 25 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _store_removed_tests_test_single_store_part2_async);
#line 25 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _store_removed_tests_test_single_store_part2_async_data_free);
#line 25 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 25 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->self = _tmp0_;
#line 25 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_store_removed_tests_test_single_store_part2_async_co (_data_);
#line 901 "store-removed.c"
}


static void _store_removed_tests_test_single_store_part2_finish (StoreRemovedTests* self, GAsyncResult* _res_) {
	StoreRemovedTestsTestSingleStorePart2AsyncData* _data_;
#line 25 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 909 "store-removed.c"
}


static Block2Data* block2_data_ref (Block2Data* _data2_) {
#line 149 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_atomic_int_inc (&_data2_->_ref_count_);
#line 149 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	return _data2_;
#line 918 "store-removed.c"
}


static void block2_data_unref (Block2Data* _data2_) {
#line 149 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
#line 149 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_g_object_unref0 (_data2_->self);
#line 149 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		g_slice_free (Block2Data, _data2_);
#line 929 "store-removed.c"
	}
}


static void __lambda2_ (Block2Data* _data2_, GeeMultiMap* changes) {
	StoreRemovedTests * self;
	GeeMultiMap* _tmp0_;
	GeeCollection* _tmp1_ = NULL;
	GeeCollection* added;
	GeeMultiMap* _tmp2_;
	GeeSet* _tmp3_ = NULL;
	GeeSet* removed;
	GeeCollection* _tmp4_;
	gint _tmp5_;
	gint _tmp6_;
	GeeSet* _tmp14_;
	gint _tmp15_;
	gint _tmp16_;
	GMainLoop* _tmp24_;
	FolksIndividualAggregator* _tmp25_;
	gulong _tmp26_;
#line 153 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	self = _data2_->self;
#line 153 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_return_if_fail (changes != NULL);
#line 155 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp0_ = changes;
#line 155 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp1_ = gee_multi_map_get_values (_tmp0_);
#line 155 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	added = _tmp1_;
#line 156 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp2_ = changes;
#line 156 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp3_ = gee_multi_map_get_keys (_tmp2_);
#line 156 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	removed = _tmp3_;
#line 158 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp4_ = added;
#line 158 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp5_ = gee_collection_get_size (_tmp4_);
#line 158 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp6_ = _tmp5_;
#line 158 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_assert (_tmp6_ == 1);
#line 975 "store-removed.c"
	{
		GeeCollection* _tmp7_;
		GeeIterator* _tmp8_ = NULL;
		GeeIterator* _i_it;
#line 160 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_tmp7_ = added;
#line 160 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_tmp8_ = gee_iterable_iterator ((GeeIterable*) _tmp7_);
#line 160 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_i_it = _tmp8_;
#line 160 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		while (TRUE) {
#line 988 "store-removed.c"
			GeeIterator* _tmp9_;
			gboolean _tmp10_ = FALSE;
			GeeIterator* _tmp11_;
			gpointer _tmp12_ = NULL;
			FolksIndividual* i;
			FolksIndividual* _tmp13_;
#line 160 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			_tmp9_ = _i_it;
#line 160 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			_tmp10_ = gee_iterator_next (_tmp9_);
#line 160 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			if (!_tmp10_) {
#line 160 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
				break;
#line 1003 "store-removed.c"
			}
#line 160 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			_tmp11_ = _i_it;
#line 160 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			_tmp12_ = gee_iterator_get (_tmp11_);
#line 160 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			i = (FolksIndividual*) _tmp12_;
#line 162 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			_tmp13_ = i;
#line 162 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			g_assert (_tmp13_ == NULL);
#line 160 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			_g_object_unref0 (i);
#line 1017 "store-removed.c"
		}
#line 160 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_g_object_unref0 (_i_it);
#line 1021 "store-removed.c"
	}
#line 165 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp14_ = removed;
#line 165 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp15_ = gee_collection_get_size ((GeeCollection*) _tmp14_);
#line 165 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp16_ = _tmp15_;
#line 165 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_assert (_tmp16_ == 1);
#line 1031 "store-removed.c"
	{
		GeeSet* _tmp17_;
		GeeIterator* _tmp18_ = NULL;
		GeeIterator* _i_it;
#line 169 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_tmp17_ = removed;
#line 169 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_tmp18_ = gee_iterable_iterator ((GeeIterable*) _tmp17_);
#line 169 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_i_it = _tmp18_;
#line 169 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		while (TRUE) {
#line 1044 "store-removed.c"
			GeeIterator* _tmp19_;
			gboolean _tmp20_ = FALSE;
			GeeIterator* _tmp21_;
			gpointer _tmp22_ = NULL;
			FolksIndividual* i;
			FolksIndividual* _tmp23_;
#line 169 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			_tmp19_ = _i_it;
#line 169 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			_tmp20_ = gee_iterator_next (_tmp19_);
#line 169 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			if (!_tmp20_) {
#line 169 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
				break;
#line 1059 "store-removed.c"
			}
#line 169 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			_tmp21_ = _i_it;
#line 169 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			_tmp22_ = gee_iterator_get (_tmp21_);
#line 169 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			i = (FolksIndividual*) _tmp22_;
#line 171 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			_tmp23_ = i;
#line 171 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			g_assert (_tmp23_ != NULL);
#line 169 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
			_g_object_unref0 (i);
#line 1073 "store-removed.c"
		}
#line 169 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_g_object_unref0 (_i_it);
#line 1077 "store-removed.c"
	}
#line 175 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp24_ = self->priv->_main_loop;
#line 175 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_main_loop_quit (_tmp24_);
#line 176 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp25_ = self->priv->_aggregator;
#line 176 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp26_ = _data2_->signal_id;
#line 176 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_signal_handler_disconnect ((GObject*) _tmp25_, _tmp26_);
#line 153 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_g_object_unref0 (removed);
#line 153 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_g_object_unref0 (added);
#line 1093 "store-removed.c"
}


static void ___lambda2__folks_individual_aggregator_individuals_changed_detailed (FolksIndividualAggregator* _sender, GeeMultiMap* changes, gpointer self) {
#line 152 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	__lambda2_ (self, changes);
#line 1100 "store-removed.c"
}


static gboolean _store_removed_tests_test_single_store_part2_async_co (StoreRemovedTestsTestSingleStorePart2AsyncData* _data_) {
#line 149 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	switch (_data_->_state_) {
#line 149 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		case 0:
#line 1109 "store-removed.c"
		goto _state_0;
		default:
#line 149 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		g_assert_not_reached ();
#line 1114 "store-removed.c"
	}
	_state_0:
#line 149 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->_data2_ = g_slice_new0 (Block2Data);
#line 149 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->_data2_->_ref_count_ = 1;
#line 149 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->_data2_->self = g_object_ref (_data_->self);
#line 149 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->_data2_->_async_data_ = _data_;
#line 151 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->_data2_->signal_id = (gulong) 0;
#line 152 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->_tmp0_ = _data_->self->priv->_aggregator;
#line 152 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->_tmp1_ = 0UL;
#line 152 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->_tmp1_ = g_signal_connect_data (_data_->_tmp0_, "individuals-changed-detailed", (GCallback) ___lambda2__folks_individual_aggregator_individuals_changed_detailed, block2_data_ref (_data_->_data2_), (GClosureNotify) block2_data_unref, 0);
#line 152 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->_data2_->signal_id = _data_->_tmp1_;
#line 181 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->source_list = NULL;
#line 1137 "store-removed.c"
	{
#line 184 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_data_->_tmp2_ = NULL;
#line 184 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		e_book_client_get_sources (&_data_->_tmp2_, &_data_->_inner_error_);
#line 184 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_g_object_unref0 (_data_->source_list);
#line 184 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_data_->source_list = _data_->_tmp2_;
#line 184 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		if (_data_->_inner_error_ != NULL) {
#line 1149 "store-removed.c"
			goto __catch1_g_error;
		}
#line 185 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_data_->_tmp3_ = _data_->source_list;
#line 185 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_data_->_tmp4_ = _data_->self->priv->_eds_backend;
#line 185 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_data_->_tmp5_ = eds_test_backend_get_address_book_uid (_data_->_tmp4_);
#line 185 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_data_->_tmp6_ = _data_->_tmp5_;
#line 185 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		e_source_list_remove_source_by_uid (_data_->_tmp3_, _data_->_tmp6_);
#line 1162 "store-removed.c"
	}
	goto __finally1;
	__catch1_g_error:
	{
#line 182 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_data_->e1 = _data_->_inner_error_;
#line 182 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_data_->_inner_error_ = NULL;
#line 189 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_data_->_tmp7_ = _data_->e1;
#line 189 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_data_->_tmp8_ = _data_->_tmp7_->message;
#line 189 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		g_critical ("store-removed.vala:189: Error getting source list: %s", _data_->_tmp8_);
#line 182 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_g_error_free0 (_data_->e1);
#line 1179 "store-removed.c"
	}
	__finally1:
#line 182 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	if (_data_->_inner_error_ != NULL) {
#line 182 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_g_object_unref0 (_data_->source_list);
#line 182 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		block2_data_unref (_data_->_data2_);
#line 182 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		_data_->_data2_ = NULL;
#line 182 "/home/treitter/collabora/folks/tests/eds/store-removed.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 182 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		g_clear_error (&_data_->_inner_error_);
#line 182 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		return FALSE;
#line 1196 "store-removed.c"
	}
#line 149 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_g_object_unref0 (_data_->source_list);
#line 149 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	block2_data_unref (_data_->_data2_);
#line 149 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_data_->_data2_ = NULL;
#line 149 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	if (_data_->_state_ == 0) {
#line 149 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1208 "store-removed.c"
	} else {
#line 149 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 1212 "store-removed.c"
	}
#line 149 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_object_unref (_data_->_async_result);
#line 149 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	return FALSE;
#line 1218 "store-removed.c"
}


static void store_removed_tests_class_init (StoreRemovedTestsClass * klass) {
#line 25 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	store_removed_tests_parent_class = g_type_class_peek_parent (klass);
#line 25 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_type_class_add_private (klass, sizeof (StoreRemovedTestsPrivate));
#line 25 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	FOLKS_TEST_CASE_CLASS (klass)->set_up = store_removed_tests_real_set_up;
#line 25 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	FOLKS_TEST_CASE_CLASS (klass)->tear_down = store_removed_tests_real_tear_down;
#line 25 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	G_OBJECT_CLASS (klass)->finalize = store_removed_tests_finalize;
#line 1233 "store-removed.c"
}


static void store_removed_tests_instance_init (StoreRemovedTests * self) {
#line 25 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	self->priv = STORE_REMOVED_TESTS_GET_PRIVATE (self);
#line 1240 "store-removed.c"
}


static void store_removed_tests_finalize (GObject* obj) {
	StoreRemovedTests * self;
#line 25 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	self = STORE_REMOVED_TESTS (obj);
#line 27 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_eds_test_backend_unref0 (self->priv->_eds_backend);
#line 28 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_g_main_loop_unref0 (self->priv->_main_loop);
#line 29 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_g_object_unref0 (self->priv->_aggregator);
#line 25 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	G_OBJECT_CLASS (store_removed_tests_parent_class)->finalize (obj);
#line 1256 "store-removed.c"
}


GType store_removed_tests_get_type (void) {
	static volatile gsize store_removed_tests_type_id__volatile = 0;
	if (g_once_init_enter (&store_removed_tests_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (StoreRemovedTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) store_removed_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (StoreRemovedTests), 0, (GInstanceInitFunc) store_removed_tests_instance_init, NULL };
		GType store_removed_tests_type_id;
		store_removed_tests_type_id = g_type_register_static (FOLKS_TYPE_TEST_CASE, "StoreRemovedTests", &g_define_type_info, 0);
		g_once_init_leave (&store_removed_tests_type_id__volatile, store_removed_tests_type_id);
	}
	return store_removed_tests_type_id__volatile;
}


gint _vala_main (gchar** args, int args_length1) {
	gint result = 0;
	GTestSuite* _tmp0_ = NULL;
	GTestSuite* root;
	StoreRemovedTests* _tmp1_;
	StoreRemovedTests* _tmp2_;
	GTestSuite* _tmp3_ = NULL;
#line 196 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_test_init (&args_length1, &args, NULL);
#line 198 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp0_ = g_test_get_root ();
#line 198 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	root = _tmp0_;
#line 199 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp1_ = store_removed_tests_new ();
#line 199 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp2_ = _tmp1_;
#line 199 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_tmp3_ = folks_test_case_get_suite ((FolksTestCase*) _tmp2_);
#line 199 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_test_suite_add_suite (root, _tmp3_);
#line 199 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	_g_object_unref0 (_tmp2_);
#line 201 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_test_run ();
#line 203 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	result = 0;
#line 203 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	return result;
#line 1301 "store-removed.c"
}


int main (int argc, char ** argv) {
#line 194 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	g_type_init ();
#line 194 "/home/treitter/collabora/folks/tests/eds/store-removed.vala"
	return _vala_main (argv, argc);
#line 1310 "store-removed.c"
}



