/* enable-disable-stores.c generated by valac 0.28.0.16-b1323, the Vala compiler
 * generated from enable-disable-stores.vala, do not modify */

/*
 * Copyright (C) 2012 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: Jeremy Whiting <jeremy.whiting@collabora.com>
 *
 */

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


#define TYPE_ENABLE_DISABLE_STORES_TESTS (enable_disable_stores_tests_get_type ())
#define ENABLE_DISABLE_STORES_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ENABLE_DISABLE_STORES_TESTS, EnableDisableStoresTests))
#define ENABLE_DISABLE_STORES_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ENABLE_DISABLE_STORES_TESTS, EnableDisableStoresTestsClass))
#define IS_ENABLE_DISABLE_STORES_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ENABLE_DISABLE_STORES_TESTS))
#define IS_ENABLE_DISABLE_STORES_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ENABLE_DISABLE_STORES_TESTS))
#define ENABLE_DISABLE_STORES_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ENABLE_DISABLE_STORES_TESTS, EnableDisableStoresTestsClass))

typedef struct _EnableDisableStoresTests EnableDisableStoresTests;
typedef struct _EnableDisableStoresTestsClass EnableDisableStoresTestsClass;
typedef struct _EnableDisableStoresTestsPrivate EnableDisableStoresTestsPrivate;
#define _g_main_loop_unref0(var) ((var == NULL) ? NULL : (var = (g_main_loop_unref (var), NULL)))
#define _eds_test_backend_unref0(var) ((var == NULL) ? NULL : (var = (eds_test_backend_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _EnableDisableStoresTestsTestDisablingStoresAsyncData EnableDisableStoresTestsTestDisablingStoresAsyncData;
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _EnableDisableStoresTests {
	EdsTestTestCase parent_instance;
	EnableDisableStoresTestsPrivate * priv;
};

struct _EnableDisableStoresTestsClass {
	EdsTestTestCaseClass parent_class;
};

struct _EnableDisableStoresTestsPrivate {
	GMainLoop* _main_loop;
	EdsTestBackend* _eds_backend_other;
	FolksIndividualAggregator* _aggregator;
	guint _n_stores_removed;
	guint _n_stores_added;
	guint _n_stores_prepared;
	FolksBackendStore* _backend_store;
};

struct _EnableDisableStoresTestsTestDisablingStoresAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EnableDisableStoresTests* self;
	FolksBackendStore* _tmp0_;
	FolksIndividualAggregator* _tmp1_;
	FolksBackendStore* _tmp2_;
	FolksBackend* backend;
	FolksBackendStore* _tmp3_;
	GeeMap* _tmp4_;
	GeeMap* _tmp5_;
	gpointer _tmp6_;
	FolksBackend* _tmp7_;
	FolksBackend* _tmp8_;
	FolksBackend* _tmp9_;
	FolksIndividualAggregator* _tmp10_;
	FolksIndividualAggregator* _tmp11_;
	gboolean _tmp12_;
	gboolean _tmp13_;
	FolksPersonaStore* pstore;
	FolksBackendStore* _tmp14_;
	EdsTestBackend* _tmp15_;
	const gchar* _tmp16_;
	const gchar* _tmp17_;
	FolksPersonaStore* _tmp18_;
	FolksPersonaStore* _tmp19_;
	FolksPersonaStore* pstore2;
	FolksBackendStore* _tmp20_;
	EdsTestBackend* _tmp21_;
	const gchar* _tmp22_;
	const gchar* _tmp23_;
	FolksPersonaStore* _tmp24_;
	FolksPersonaStore* _tmp25_;
	FolksBackend* _tmp26_;
	FolksPersonaStore* _tmp27_;
	FolksBackend* _tmp28_;
	FolksPersonaStore* _tmp29_;
	GError* e;
	GError* _tmp30_;
	const gchar* _tmp31_;
	GError * _inner_error_;
};


static gpointer enable_disable_stores_tests_parent_class = NULL;

GType enable_disable_stores_tests_get_type (void) G_GNUC_CONST;
#define ENABLE_DISABLE_STORES_TESTS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_ENABLE_DISABLE_STORES_TESTS, EnableDisableStoresTestsPrivate))
enum  {
	ENABLE_DISABLE_STORES_TESTS_DUMMY_PROPERTY
};
EnableDisableStoresTests* enable_disable_stores_tests_new (void);
EnableDisableStoresTests* enable_disable_stores_tests_construct (GType object_type);
void enable_disable_stores_tests_test_disabling_stores (EnableDisableStoresTests* self);
static void _enable_disable_stores_tests_test_disabling_stores_folks_test_case_test_method (gpointer self);
static void enable_disable_stores_tests_real_set_up (FolksTestCase* base);
static void enable_disable_stores_tests_real_tear_down (FolksTestCase* base);
static void _enable_disable_stores_tests_test_disabling_stores_async (EnableDisableStoresTests* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _enable_disable_stores_tests_test_disabling_stores_finish (EnableDisableStoresTests* self, GAsyncResult* _res_);
static void _enable_disable_stores_tests_test_disabling_stores_async_data_free (gpointer _data);
static gboolean _enable_disable_stores_tests_test_disabling_stores_async_co (EnableDisableStoresTestsTestDisablingStoresAsyncData* _data_);
static void _enable_disable_stores_tests_test_disabling_stores_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _enable_disable_stores_tests_store_removed_cb (EnableDisableStoresTests* self, FolksPersonaStore* store);
static void __enable_disable_stores_tests_store_removed_cb_folks_backend_persona_store_removed (FolksBackend* _sender, FolksPersonaStore* store, gpointer self);
static void _enable_disable_stores_tests_store_added_cb (EnableDisableStoresTests* self, FolksPersonaStore* store);
static void __enable_disable_stores_tests_store_added_cb_folks_backend_persona_store_added (FolksBackend* _sender, FolksPersonaStore* store, gpointer self);
static FolksPersonaStore* _enable_disable_stores_tests_get_store (EnableDisableStoresTests* self, FolksBackendStore* store, const gchar* store_id);
static void _enable_disable_stores_tests_store_prepared_cb (EnableDisableStoresTests* self, GObject* _store, GParamSpec* pspec);
static void __enable_disable_stores_tests_store_prepared_cb_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void enable_disable_stores_tests_finalize (GObject* obj);
gint _vala_main (gchar** args, int args_length1);


static void _enable_disable_stores_tests_test_disabling_stores_folks_test_case_test_method (gpointer self) {
#line 38 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	enable_disable_stores_tests_test_disabling_stores ((EnableDisableStoresTests*) self);
#line 154 "enable-disable-stores.c"
}


EnableDisableStoresTests* enable_disable_stores_tests_construct (GType object_type) {
	EnableDisableStoresTests * self = NULL;
#line 36 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	self = (EnableDisableStoresTests*) eds_test_test_case_construct (object_type, "EnableDisableStoresTests");
#line 38 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	folks_test_case_add_test ((FolksTestCase*) self, "test enabling and disabling of PersonaStores", _enable_disable_stores_tests_test_disabling_stores_folks_test_case_test_method, self);
#line 34 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	return self;
#line 166 "enable-disable-stores.c"
}


EnableDisableStoresTests* enable_disable_stores_tests_new (void) {
#line 34 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	return enable_disable_stores_tests_construct (TYPE_ENABLE_DISABLE_STORES_TESTS);
#line 173 "enable-disable-stores.c"
}


static void enable_disable_stores_tests_real_set_up (FolksTestCase* base) {
	EnableDisableStoresTests * self;
	FolksBackendStore* _tmp0_ = NULL;
	EdsTestBackend* _tmp1_ = NULL;
	EdsTestBackend* _tmp2_ = NULL;
	EdsTestBackend* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	const gchar* _tmp5_ = NULL;
	gchar* _tmp6_ = NULL;
	gchar* _tmp7_ = NULL;
	EdsTestBackend* _tmp8_ = NULL;
	const gchar* _tmp9_ = NULL;
	const gchar* _tmp10_ = NULL;
	gchar* _tmp11_ = NULL;
	gchar* _tmp12_ = NULL;
#line 42 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	self = (EnableDisableStoresTests*) base;
#line 44 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	FOLKS_TEST_CASE_CLASS (enable_disable_stores_tests_parent_class)->set_up ((FolksTestCase*) G_TYPE_CHECK_INSTANCE_CAST (self, EDS_TEST_TYPE_TEST_CASE, EdsTestTestCase));
#line 46 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	self->priv->_n_stores_removed = (guint) 0;
#line 47 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	self->priv->_n_stores_added = (guint) 0;
#line 48 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	self->priv->_n_stores_prepared = (guint) 0;
#line 49 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp0_ = folks_backend_store_dup ();
#line 49 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_g_object_unref0 (self->priv->_backend_store);
#line 49 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	self->priv->_backend_store = _tmp0_;
#line 51 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp1_ = eds_test_backend_new ("other");
#line 51 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_eds_test_backend_unref0 (self->priv->_eds_backend_other);
#line 51 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	self->priv->_eds_backend_other = _tmp1_;
#line 52 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp2_ = self->priv->_eds_backend_other;
#line 52 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	eds_test_backend_set_up (_tmp2_, FALSE);
#line 55 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp3_ = ((EdsTestTestCase*) self)->eds_backend;
#line 55 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp4_ = eds_test_backend_get_address_book_uid (_tmp3_);
#line 55 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp5_ = _tmp4_;
#line 55 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp6_ = g_strconcat (_tmp5_, ":", NULL);
#line 55 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp7_ = _tmp6_;
#line 55 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp8_ = self->priv->_eds_backend_other;
#line 55 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp9_ = eds_test_backend_get_address_book_uid (_tmp8_);
#line 55 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp10_ = _tmp9_;
#line 55 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp11_ = g_strconcat (_tmp7_, _tmp10_, NULL);
#line 55 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp12_ = _tmp11_;
#line 55 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	g_setenv ("FOLKS_BACKEND_EDS_USE_ADDRESS_BOOKS", _tmp12_, TRUE);
#line 55 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_g_free0 (_tmp12_);
#line 55 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_g_free0 (_tmp7_);
#line 244 "enable-disable-stores.c"
}


static void enable_disable_stores_tests_real_tear_down (FolksTestCase* base) {
	EnableDisableStoresTests * self;
	EdsTestBackend* _tmp0_ = NULL;
#line 61 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	self = (EnableDisableStoresTests*) base;
#line 63 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp0_ = self->priv->_eds_backend_other;
#line 63 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	eds_test_backend_tear_down (_tmp0_);
#line 64 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_eds_test_backend_unref0 (self->priv->_eds_backend_other);
#line 64 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	self->priv->_eds_backend_other = NULL;
#line 66 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	FOLKS_TEST_CASE_CLASS (enable_disable_stores_tests_parent_class)->tear_down ((FolksTestCase*) G_TYPE_CHECK_INSTANCE_CAST (self, EDS_TEST_TYPE_TEST_CASE, EdsTestTestCase));
#line 263 "enable-disable-stores.c"
}


void enable_disable_stores_tests_test_disabling_stores (EnableDisableStoresTests* self) {
	GMainLoop* _tmp0_ = NULL;
	GMainLoop* _tmp1_ = NULL;
	guint _tmp2_ = 0U;
	guint _tmp3_ = 0U;
	guint _tmp4_ = 0U;
#line 69 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	g_return_if_fail (self != NULL);
#line 71 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp0_ = g_main_loop_new (NULL, FALSE);
#line 71 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_g_main_loop_unref0 (self->priv->_main_loop);
#line 71 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	self->priv->_main_loop = _tmp0_;
#line 73 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_enable_disable_stores_tests_test_disabling_stores_async (self, NULL, NULL);
#line 75 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp1_ = self->priv->_main_loop;
#line 75 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	folks_test_utils_loop_run_with_timeout (_tmp1_, 5);
#line 77 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp2_ = self->priv->_n_stores_removed;
#line 77 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_vala_assert (_tmp2_ == ((guint) 2), "this._n_stores_removed == 2");
#line 78 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp3_ = self->priv->_n_stores_added;
#line 78 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_vala_assert (_tmp3_ == ((guint) 2), "this._n_stores_added == 2");
#line 79 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp4_ = self->priv->_n_stores_prepared;
#line 79 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_vala_assert (_tmp4_ == ((guint) 2), "this._n_stores_prepared == 2");
#line 81 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_g_object_unref0 (self->priv->_aggregator);
#line 81 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	self->priv->_aggregator = NULL;
#line 82 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_g_main_loop_unref0 (self->priv->_main_loop);
#line 82 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	self->priv->_main_loop = NULL;
#line 307 "enable-disable-stores.c"
}


static void _enable_disable_stores_tests_test_disabling_stores_async_data_free (gpointer _data) {
	EnableDisableStoresTestsTestDisablingStoresAsyncData* _data_;
	_data_ = _data;
#line 24 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_g_object_unref0 (_data_->self);
#line 24 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	g_slice_free (EnableDisableStoresTestsTestDisablingStoresAsyncData, _data_);
#line 318 "enable-disable-stores.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 24 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	return self ? g_object_ref (self) : NULL;
#line 325 "enable-disable-stores.c"
}


static void _enable_disable_stores_tests_test_disabling_stores_async (EnableDisableStoresTests* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EnableDisableStoresTestsTestDisablingStoresAsyncData* _data_;
	EnableDisableStoresTests* _tmp0_ = NULL;
#line 24 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_data_ = g_slice_new0 (EnableDisableStoresTestsTestDisablingStoresAsyncData);
#line 24 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _enable_disable_stores_tests_test_disabling_stores_async);
#line 24 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _enable_disable_stores_tests_test_disabling_stores_async_data_free);
#line 24 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 24 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_data_->self = _tmp0_;
#line 24 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_enable_disable_stores_tests_test_disabling_stores_async_co (_data_);
#line 344 "enable-disable-stores.c"
}


static void _enable_disable_stores_tests_test_disabling_stores_finish (EnableDisableStoresTests* self, GAsyncResult* _res_) {
	EnableDisableStoresTestsTestDisablingStoresAsyncData* _data_;
#line 24 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 352 "enable-disable-stores.c"
}


static void _enable_disable_stores_tests_test_disabling_stores_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EnableDisableStoresTestsTestDisablingStoresAsyncData* _data_;
#line 87 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_data_ = _user_data_;
#line 87 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_data_->_source_object_ = source_object;
#line 87 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_data_->_res_ = _res_;
#line 87 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_enable_disable_stores_tests_test_disabling_stores_async_co (_data_);
#line 366 "enable-disable-stores.c"
}


static void __enable_disable_stores_tests_store_removed_cb_folks_backend_persona_store_removed (FolksBackend* _sender, FolksPersonaStore* store, gpointer self) {
#line 96 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_enable_disable_stores_tests_store_removed_cb ((EnableDisableStoresTests*) self, store);
#line 373 "enable-disable-stores.c"
}


static void __enable_disable_stores_tests_store_added_cb_folks_backend_persona_store_added (FolksBackend* _sender, FolksPersonaStore* store, gpointer self) {
#line 97 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_enable_disable_stores_tests_store_added_cb ((EnableDisableStoresTests*) self, store);
#line 380 "enable-disable-stores.c"
}


static gboolean _enable_disable_stores_tests_test_disabling_stores_async_co (EnableDisableStoresTestsTestDisablingStoresAsyncData* _data_) {
#line 85 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	switch (_data_->_state_) {
#line 85 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		case 0:
#line 389 "enable-disable-stores.c"
		goto _state_0;
#line 85 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		case 1:
#line 393 "enable-disable-stores.c"
		goto _state_1;
#line 85 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		case 2:
#line 397 "enable-disable-stores.c"
		goto _state_2;
#line 85 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		case 3:
#line 401 "enable-disable-stores.c"
		goto _state_3;
		default:
#line 85 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		g_assert_not_reached ();
#line 406 "enable-disable-stores.c"
	}
	_state_0:
#line 87 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_data_->_tmp0_ = NULL;
#line 87 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_data_->_tmp0_ = _data_->self->priv->_backend_store;
#line 87 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_data_->_state_ = 1;
#line 87 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	folks_backend_store_prepare (_data_->_tmp0_, _enable_disable_stores_tests_test_disabling_stores_async_ready, _data_);
#line 87 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	return FALSE;
#line 419 "enable-disable-stores.c"
	_state_1:
#line 87 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	folks_backend_store_prepare_finish (_data_->_tmp0_, _data_->_res_);
#line 88 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_data_->_tmp1_ = NULL;
#line 88 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_data_->_tmp1_ = folks_individual_aggregator_dup ();
#line 88 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_g_object_unref0 (_data_->self->priv->_aggregator);
#line 88 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_data_->self->priv->_aggregator = _data_->_tmp1_;
#line 431 "enable-disable-stores.c"
	{
#line 91 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp2_ = NULL;
#line 91 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp2_ = _data_->self->priv->_backend_store;
#line 91 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_state_ = 2;
#line 91 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		folks_backend_store_load_backends (_data_->_tmp2_, _enable_disable_stores_tests_test_disabling_stores_async_ready, _data_);
#line 91 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		return FALSE;
#line 443 "enable-disable-stores.c"
		_state_2:
#line 91 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		folks_backend_store_load_backends_finish (_data_->_tmp2_, _data_->_res_, &_data_->_inner_error_);
#line 91 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 449 "enable-disable-stores.c"
			goto __catch0_g_error;
		}
#line 93 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp3_ = NULL;
#line 93 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp3_ = _data_->self->priv->_backend_store;
#line 93 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp4_ = NULL;
#line 93 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp4_ = folks_backend_store_get_enabled_backends (_data_->_tmp3_);
#line 93 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp5_ = NULL;
#line 93 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp5_ = _data_->_tmp4_;
#line 93 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp6_ = NULL;
#line 93 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp6_ = gee_map_get (_data_->_tmp5_, "eds");
#line 93 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->backend = (FolksBackend*) _data_->_tmp6_;
#line 94 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp7_ = NULL;
#line 94 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp7_ = _data_->backend;
#line 94 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_vala_assert (_data_->_tmp7_ != NULL, "backend != null");
#line 96 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp8_ = NULL;
#line 96 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp8_ = _data_->backend;
#line 96 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		g_signal_connect_object (_data_->_tmp8_, "persona-store-removed", (GCallback) __enable_disable_stores_tests_store_removed_cb_folks_backend_persona_store_removed, _data_->self, 0);
#line 97 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp9_ = NULL;
#line 97 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp9_ = _data_->backend;
#line 97 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		g_signal_connect_object (_data_->_tmp9_, "persona-store-added", (GCallback) __enable_disable_stores_tests_store_added_cb_folks_backend_persona_store_added, _data_->self, 0);
#line 99 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp10_ = NULL;
#line 99 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp10_ = _data_->self->priv->_aggregator;
#line 99 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_state_ = 3;
#line 99 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		folks_individual_aggregator_prepare (_data_->_tmp10_, _enable_disable_stores_tests_test_disabling_stores_async_ready, _data_);
#line 99 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		return FALSE;
#line 498 "enable-disable-stores.c"
		_state_3:
#line 99 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		folks_individual_aggregator_prepare_finish (_data_->_tmp10_, _data_->_res_, &_data_->_inner_error_);
#line 99 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 99 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
			_g_object_unref0 (_data_->backend);
#line 506 "enable-disable-stores.c"
			goto __catch0_g_error;
		}
#line 100 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp11_ = NULL;
#line 100 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp11_ = _data_->self->priv->_aggregator;
#line 100 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp12_ = FALSE;
#line 100 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp12_ = folks_individual_aggregator_get_is_prepared (_data_->_tmp11_);
#line 100 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp13_ = FALSE;
#line 100 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp13_ = _data_->_tmp12_;
#line 100 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_vala_assert (_data_->_tmp13_, "this._aggregator.is_prepared");
#line 102 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp14_ = NULL;
#line 102 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp14_ = _data_->self->priv->_backend_store;
#line 102 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp15_ = NULL;
#line 102 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp15_ = ((EdsTestTestCase*) _data_->self)->eds_backend;
#line 102 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp16_ = NULL;
#line 102 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp16_ = eds_test_backend_get_address_book_uid (_data_->_tmp15_);
#line 102 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp17_ = NULL;
#line 102 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp17_ = _data_->_tmp16_;
#line 102 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp18_ = NULL;
#line 102 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp18_ = _enable_disable_stores_tests_get_store (_data_->self, _data_->_tmp14_, _data_->_tmp17_);
#line 102 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->pstore = _data_->_tmp18_;
#line 104 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp19_ = NULL;
#line 104 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp19_ = _data_->pstore;
#line 104 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_vala_assert (_data_->_tmp19_ != NULL, "pstore != null");
#line 106 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp20_ = NULL;
#line 106 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp20_ = _data_->self->priv->_backend_store;
#line 106 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp21_ = NULL;
#line 106 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp21_ = _data_->self->priv->_eds_backend_other;
#line 106 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp22_ = NULL;
#line 106 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp22_ = eds_test_backend_get_address_book_uid (_data_->_tmp21_);
#line 106 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp23_ = NULL;
#line 106 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp23_ = _data_->_tmp22_;
#line 106 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp24_ = NULL;
#line 106 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp24_ = _enable_disable_stores_tests_get_store (_data_->self, _data_->_tmp20_, _data_->_tmp23_);
#line 106 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->pstore2 = _data_->_tmp24_;
#line 108 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp25_ = NULL;
#line 108 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp25_ = _data_->pstore2;
#line 108 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_vala_assert (_data_->_tmp25_ != NULL, "pstore2 != null");
#line 110 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp26_ = NULL;
#line 110 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp26_ = _data_->backend;
#line 110 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp27_ = NULL;
#line 110 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp27_ = _data_->pstore;
#line 110 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		folks_backend_disable_persona_store (_data_->_tmp26_, _data_->_tmp27_);
#line 111 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp28_ = NULL;
#line 111 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp28_ = _data_->backend;
#line 111 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp29_ = NULL;
#line 111 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp29_ = _data_->pstore2;
#line 111 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		folks_backend_disable_persona_store (_data_->_tmp28_, _data_->_tmp29_);
#line 89 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_g_object_unref0 (_data_->pstore2);
#line 89 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_g_object_unref0 (_data_->pstore);
#line 89 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_g_object_unref0 (_data_->backend);
#line 605 "enable-disable-stores.c"
	}
	goto __finally0;
	__catch0_g_error:
	{
#line 89 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->e = _data_->_inner_error_;
#line 89 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_inner_error_ = NULL;
#line 115 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp30_ = NULL;
#line 115 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp30_ = _data_->e;
#line 115 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp31_ = NULL;
#line 115 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_data_->_tmp31_ = _data_->_tmp30_->message;
#line 115 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		g_warning ("enable-disable-stores.vala:115: Error when calling prepare: %s\n", _data_->_tmp31_);
#line 89 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_g_error_free0 (_data_->e);
#line 626 "enable-disable-stores.c"
	}
	__finally0:
#line 89 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 89 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.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 89 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		g_clear_error (&_data_->_inner_error_);
#line 89 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		return FALSE;
#line 637 "enable-disable-stores.c"
	}
#line 85 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	if (_data_->_state_ == 0) {
#line 85 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 643 "enable-disable-stores.c"
	} else {
#line 85 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 647 "enable-disable-stores.c"
	}
#line 85 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	g_object_unref (_data_->_async_result);
#line 85 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	return FALSE;
#line 653 "enable-disable-stores.c"
}


static FolksPersonaStore* _enable_disable_stores_tests_get_store (EnableDisableStoresTests* self, FolksBackendStore* store, const gchar* store_id) {
	FolksPersonaStore* result = NULL;
	FolksPersonaStore* pstore = NULL;
#line 119 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 119 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	g_return_val_if_fail (store != NULL, NULL);
#line 119 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	g_return_val_if_fail (store_id != NULL, NULL);
#line 121 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	pstore = NULL;
#line 668 "enable-disable-stores.c"
	{
		GeeIterator* _backend_it = NULL;
		FolksBackendStore* _tmp0_ = NULL;
		GeeMap* _tmp1_ = NULL;
		GeeMap* _tmp2_ = NULL;
		GeeCollection* _tmp3_ = NULL;
		GeeCollection* _tmp4_ = NULL;
		GeeCollection* _tmp5_ = NULL;
		GeeIterator* _tmp6_ = NULL;
		GeeIterator* _tmp7_ = NULL;
#line 122 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_tmp0_ = store;
#line 122 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_tmp1_ = folks_backend_store_get_enabled_backends (_tmp0_);
#line 122 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_tmp2_ = _tmp1_;
#line 122 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_tmp3_ = gee_map_get_values (_tmp2_);
#line 122 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_tmp4_ = _tmp3_;
#line 122 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_tmp5_ = _tmp4_;
#line 122 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_tmp6_ = gee_iterable_iterator ((GeeIterable*) _tmp5_);
#line 122 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_tmp7_ = _tmp6_;
#line 122 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_g_object_unref0 (_tmp5_);
#line 122 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_backend_it = _tmp7_;
#line 122 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		while (TRUE) {
#line 701 "enable-disable-stores.c"
			GeeIterator* _tmp8_ = NULL;
			gboolean _tmp9_ = FALSE;
			FolksBackend* backend = NULL;
			GeeIterator* _tmp10_ = NULL;
			gpointer _tmp11_ = NULL;
			FolksBackend* _tmp12_ = NULL;
			GeeMap* _tmp13_ = NULL;
			GeeMap* _tmp14_ = NULL;
			const gchar* _tmp15_ = NULL;
			gpointer _tmp16_ = NULL;
			FolksPersonaStore* _tmp17_ = NULL;
#line 122 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
			_tmp8_ = _backend_it;
#line 122 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
			_tmp9_ = gee_iterator_next (_tmp8_);
#line 122 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
			if (!_tmp9_) {
#line 122 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
				break;
#line 721 "enable-disable-stores.c"
			}
#line 122 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
			_tmp10_ = _backend_it;
#line 122 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
			_tmp11_ = gee_iterator_get (_tmp10_);
#line 122 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
			backend = (FolksBackend*) _tmp11_;
#line 124 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
			_tmp12_ = backend;
#line 124 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
			_tmp13_ = folks_backend_get_persona_stores (_tmp12_);
#line 124 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
			_tmp14_ = _tmp13_;
#line 124 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
			_tmp15_ = store_id;
#line 124 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
			_tmp16_ = gee_map_get (_tmp14_, _tmp15_);
#line 124 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
			_g_object_unref0 (pstore);
#line 124 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
			pstore = (FolksPersonaStore*) _tmp16_;
#line 125 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
			_tmp17_ = pstore;
#line 125 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
			if (_tmp17_ != NULL) {
#line 126 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
				_g_object_unref0 (backend);
#line 126 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
				break;
#line 751 "enable-disable-stores.c"
			}
#line 122 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
			_g_object_unref0 (backend);
#line 755 "enable-disable-stores.c"
		}
#line 122 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_g_object_unref0 (_backend_it);
#line 759 "enable-disable-stores.c"
	}
#line 128 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	result = pstore;
#line 128 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	return result;
#line 765 "enable-disable-stores.c"
}


static void _enable_disable_stores_tests_store_removed_cb (EnableDisableStoresTests* self, FolksPersonaStore* store) {
	FolksPersonaStore* _tmp0_ = NULL;
	FolksPersonaStore* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	guint _tmp4_ = 0U;
	FolksBackend* backend = NULL;
	FolksBackendStore* _tmp5_ = NULL;
	GeeMap* _tmp6_ = NULL;
	GeeMap* _tmp7_ = NULL;
	gpointer _tmp8_ = NULL;
	FolksPersonaStore* _tmp9_ = NULL;
	const gchar* _tmp10_ = NULL;
	const gchar* _tmp11_ = NULL;
	FolksPersonaStore* _tmp12_ = NULL;
#line 131 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	g_return_if_fail (self != NULL);
#line 131 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	g_return_if_fail (store != NULL);
#line 134 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp0_ = store;
#line 134 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_vala_assert (_tmp0_ != NULL, "store != null");
#line 135 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp1_ = store;
#line 135 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp2_ = folks_persona_store_get_id (_tmp1_);
#line 135 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp3_ = _tmp2_;
#line 135 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	g_debug ("enable-disable-stores.vala:135: store removed %s", _tmp3_);
#line 136 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp4_ = self->priv->_n_stores_removed;
#line 136 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	self->priv->_n_stores_removed = _tmp4_ + 1;
#line 138 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp5_ = self->priv->_backend_store;
#line 138 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp6_ = folks_backend_store_get_enabled_backends (_tmp5_);
#line 138 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp7_ = _tmp6_;
#line 138 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp8_ = gee_map_get (_tmp7_, "eds");
#line 138 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	backend = (FolksBackend*) _tmp8_;
#line 139 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_vala_assert (backend != NULL, "backend != null");
#line 141 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp9_ = store;
#line 141 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp10_ = folks_persona_store_get_id (_tmp9_);
#line 141 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp11_ = _tmp10_;
#line 141 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	g_debug ("enable-disable-stores.vala:141: enabling store %s", _tmp11_);
#line 142 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp12_ = store;
#line 142 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	folks_backend_enable_persona_store (backend, _tmp12_);
#line 131 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_g_object_unref0 (backend);
#line 830 "enable-disable-stores.c"
}


static void __enable_disable_stores_tests_store_prepared_cb_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
#line 150 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_enable_disable_stores_tests_store_prepared_cb ((EnableDisableStoresTests*) self, _sender, pspec);
#line 837 "enable-disable-stores.c"
}


static void _enable_disable_stores_tests_store_added_cb (EnableDisableStoresTests* self, FolksPersonaStore* store) {
	FolksPersonaStore* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	guint _tmp3_ = 0U;
	FolksPersonaStore* _tmp4_ = NULL;
	gboolean _tmp5_ = FALSE;
	guint _tmp6_ = 0U;
#line 145 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	g_return_if_fail (self != NULL);
#line 145 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	g_return_if_fail (store != NULL);
#line 147 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp0_ = store;
#line 147 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp1_ = folks_persona_store_get_id (_tmp0_);
#line 147 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp2_ = _tmp1_;
#line 147 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	g_debug ("enable-disable-stores.vala:147: store added %s", _tmp2_);
#line 148 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp3_ = self->priv->_n_stores_added;
#line 148 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	self->priv->_n_stores_added = _tmp3_ + 1;
#line 150 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp4_ = store;
#line 150 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	g_signal_connect_object ((GObject*) _tmp4_, "notify::is-prepared", (GCallback) __enable_disable_stores_tests_store_prepared_cb_g_object_notify, self, 0);
#line 152 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp6_ = self->priv->_n_stores_added;
#line 152 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	if (_tmp6_ == ((guint) 2)) {
#line 873 "enable-disable-stores.c"
		guint _tmp7_ = 0U;
#line 152 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_tmp7_ = self->priv->_n_stores_prepared;
#line 152 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_tmp5_ = _tmp7_ == ((guint) 2);
#line 879 "enable-disable-stores.c"
	} else {
#line 152 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_tmp5_ = FALSE;
#line 883 "enable-disable-stores.c"
	}
#line 152 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	if (_tmp5_) {
#line 887 "enable-disable-stores.c"
		GMainLoop* _tmp8_ = NULL;
#line 154 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_tmp8_ = self->priv->_main_loop;
#line 154 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		g_main_loop_quit (_tmp8_);
#line 893 "enable-disable-stores.c"
	}
}


static void _enable_disable_stores_tests_store_prepared_cb (EnableDisableStoresTests* self, GObject* _store, GParamSpec* pspec) {
	FolksPersonaStore* store = NULL;
	GObject* _tmp0_ = NULL;
	FolksPersonaStore* _tmp1_ = NULL;
	FolksPersonaStore* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	guint _tmp5_ = 0U;
	gboolean _tmp6_ = FALSE;
	guint _tmp7_ = 0U;
#line 158 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	g_return_if_fail (self != NULL);
#line 158 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	g_return_if_fail (_store != NULL);
#line 158 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	g_return_if_fail (pspec != NULL);
#line 160 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp0_ = _store;
#line 160 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, FOLKS_TYPE_PERSONA_STORE, FolksPersonaStore));
#line 160 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	store = _tmp1_;
#line 162 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp2_ = store;
#line 162 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp3_ = folks_persona_store_get_id (_tmp2_);
#line 162 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp4_ = _tmp3_;
#line 162 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	g_debug ("enable-disable-stores.vala:162: store prepared %s", _tmp4_);
#line 163 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp5_ = self->priv->_n_stores_prepared;
#line 163 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	self->priv->_n_stores_prepared = _tmp5_ + 1;
#line 165 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp7_ = self->priv->_n_stores_added;
#line 165 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	if (_tmp7_ == ((guint) 2)) {
#line 936 "enable-disable-stores.c"
		guint _tmp8_ = 0U;
#line 165 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_tmp8_ = self->priv->_n_stores_prepared;
#line 165 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_tmp6_ = _tmp8_ == ((guint) 2);
#line 942 "enable-disable-stores.c"
	} else {
#line 165 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_tmp6_ = FALSE;
#line 946 "enable-disable-stores.c"
	}
#line 165 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	if (_tmp6_) {
#line 950 "enable-disable-stores.c"
		GMainLoop* _tmp9_ = NULL;
#line 167 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		_tmp9_ = self->priv->_main_loop;
#line 167 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
		g_main_loop_quit (_tmp9_);
#line 956 "enable-disable-stores.c"
	}
#line 158 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_g_object_unref0 (store);
#line 960 "enable-disable-stores.c"
}


static void enable_disable_stores_tests_class_init (EnableDisableStoresTestsClass * klass) {
#line 24 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	enable_disable_stores_tests_parent_class = g_type_class_peek_parent (klass);
#line 24 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	g_type_class_add_private (klass, sizeof (EnableDisableStoresTestsPrivate));
#line 24 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	((FolksTestCaseClass *) klass)->set_up = enable_disable_stores_tests_real_set_up;
#line 24 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	((FolksTestCaseClass *) klass)->tear_down = enable_disable_stores_tests_real_tear_down;
#line 24 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	G_OBJECT_CLASS (klass)->finalize = enable_disable_stores_tests_finalize;
#line 975 "enable-disable-stores.c"
}


static void enable_disable_stores_tests_instance_init (EnableDisableStoresTests * self) {
#line 24 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	self->priv = ENABLE_DISABLE_STORES_TESTS_GET_PRIVATE (self);
#line 982 "enable-disable-stores.c"
}


static void enable_disable_stores_tests_finalize (GObject* obj) {
	EnableDisableStoresTests * self;
#line 24 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_ENABLE_DISABLE_STORES_TESTS, EnableDisableStoresTests);
#line 26 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_g_main_loop_unref0 (self->priv->_main_loop);
#line 27 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_eds_test_backend_unref0 (self->priv->_eds_backend_other);
#line 28 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_g_object_unref0 (self->priv->_aggregator);
#line 32 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_g_object_unref0 (self->priv->_backend_store);
#line 24 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	G_OBJECT_CLASS (enable_disable_stores_tests_parent_class)->finalize (obj);
#line 1000 "enable-disable-stores.c"
}


GType enable_disable_stores_tests_get_type (void) {
	static volatile gsize enable_disable_stores_tests_type_id__volatile = 0;
	if (g_once_init_enter (&enable_disable_stores_tests_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (EnableDisableStoresTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) enable_disable_stores_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (EnableDisableStoresTests), 0, (GInstanceInitFunc) enable_disable_stores_tests_instance_init, NULL };
		GType enable_disable_stores_tests_type_id;
		enable_disable_stores_tests_type_id = g_type_register_static (EDS_TEST_TYPE_TEST_CASE, "EnableDisableStoresTests", &g_define_type_info, 0);
		g_once_init_leave (&enable_disable_stores_tests_type_id__volatile, enable_disable_stores_tests_type_id);
	}
	return enable_disable_stores_tests_type_id__volatile;
}


gint _vala_main (gchar** args, int args_length1) {
	gint result = 0;
	EnableDisableStoresTests* tests = NULL;
	EnableDisableStoresTests* _tmp0_ = NULL;
#line 174 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	g_test_init (&args_length1, &args, NULL);
#line 176 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_tmp0_ = enable_disable_stores_tests_new ();
#line 176 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	tests = _tmp0_;
#line 177 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	folks_test_case_register ((FolksTestCase*) tests);
#line 178 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	g_test_run ();
#line 179 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	folks_test_case_final_tear_down ((FolksTestCase*) tests);
#line 181 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	result = 0;
#line 181 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	_g_object_unref0 (tests);
#line 181 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	return result;
#line 1038 "enable-disable-stores.c"
}


int main (int argc, char ** argv) {
#if !GLIB_CHECK_VERSION (2,35,0)
	g_type_init ();
#endif
#line 172 "/opt/gnome3/source/folks/tests/eds/enable-disable-stores.vala"
	return _vala_main (argv, argc);
#line 1048 "enable-disable-stores.c"
}



