/* persona-store-capabilities.c generated by valac 0.15.1.20-908e, the Vala compiler
 * generated from persona-store-capabilities.vala, do not modify */

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

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


#define TYPE_PERSONA_STORE_CAPABILITIES_TESTS (persona_store_capabilities_tests_get_type ())
#define PERSONA_STORE_CAPABILITIES_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PERSONA_STORE_CAPABILITIES_TESTS, PersonaStoreCapabilitiesTests))
#define PERSONA_STORE_CAPABILITIES_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PERSONA_STORE_CAPABILITIES_TESTS, PersonaStoreCapabilitiesTestsClass))
#define IS_PERSONA_STORE_CAPABILITIES_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PERSONA_STORE_CAPABILITIES_TESTS))
#define IS_PERSONA_STORE_CAPABILITIES_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PERSONA_STORE_CAPABILITIES_TESTS))
#define PERSONA_STORE_CAPABILITIES_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PERSONA_STORE_CAPABILITIES_TESTS, PersonaStoreCapabilitiesTestsClass))

typedef struct _PersonaStoreCapabilitiesTests PersonaStoreCapabilitiesTests;
typedef struct _PersonaStoreCapabilitiesTestsClass PersonaStoreCapabilitiesTestsClass;
typedef struct _PersonaStoreCapabilitiesTestsPrivate PersonaStoreCapabilitiesTestsPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block1Data Block1Data;
#define _g_main_loop_unref0(var) ((var == NULL) ? NULL : (var = (g_main_loop_unref (var), NULL)))
typedef struct _Block2Data Block2Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

struct _PersonaStoreCapabilitiesTests {
	FolksTestCase parent_instance;
	PersonaStoreCapabilitiesTestsPrivate * priv;
};

struct _PersonaStoreCapabilitiesTestsClass {
	FolksTestCaseClass parent_class;
};

struct _PersonaStoreCapabilitiesTestsPrivate {
	TpTestBackend* tp_backend;
	void* _account_handle;
	GeeHashSet* _capabilities_received;
	gint _test_timeout;
};

struct _Block1Data {
	int _ref_count_;
	PersonaStoreCapabilitiesTests * self;
	GMainLoop* main_loop;
};

struct _Block2Data {
	int _ref_count_;
	PersonaStoreCapabilitiesTests * self;
	FolksPersonaStore* store;
};


static gpointer persona_store_capabilities_tests_parent_class = NULL;

GType persona_store_capabilities_tests_get_type (void) G_GNUC_CONST;
#define PERSONA_STORE_CAPABILITIES_TESTS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_PERSONA_STORE_CAPABILITIES_TESTS, PersonaStoreCapabilitiesTestsPrivate))
enum  {
	PERSONA_STORE_CAPABILITIES_TESTS_DUMMY_PROPERTY
};
PersonaStoreCapabilitiesTests* persona_store_capabilities_tests_new (void);
PersonaStoreCapabilitiesTests* persona_store_capabilities_tests_construct (GType object_type);
void persona_store_capabilities_tests_test_persona_store_capabilities (PersonaStoreCapabilitiesTests* self);
static void _persona_store_capabilities_tests_test_persona_store_capabilities_folks_test_case_test_method (gpointer self);
static void persona_store_capabilities_tests_real_set_up (FolksTestCase* base);
static void persona_store_capabilities_tests_real_tear_down (FolksTestCase* base);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (Block1Data* _data1_);
static void __lambda2_ (PersonaStoreCapabilitiesTests* self, FolksBackend* b);
static void ___lambda3_ (PersonaStoreCapabilitiesTests* self, FolksPersonaStore* ps);
static void persona_store_capabilities_tests_set_up_persona_store (PersonaStoreCapabilitiesTests* self, FolksPersonaStore* store);
static void ____lambda3__folks_backend_persona_store_added (FolksBackend* _sender, FolksPersonaStore* store, gpointer self);
static void ___lambda2__folks_backend_store_backend_available (FolksBackendStore* _sender, FolksBackend* backend, gpointer self);
static gboolean __lambda5_ (Block1Data* _data1_);
static gboolean ___lambda5__gsource_func (gpointer self);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (Block2Data* _data2_);
static void __lambda4_ (Block2Data* _data2_, GObject* obj, GAsyncResult* _result_);
static void persona_store_capabilities_tests_can_add_personas_cb (PersonaStoreCapabilitiesTests* self, GObject* s, GParamSpec* p);
static void _persona_store_capabilities_tests_can_add_personas_cb_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void persona_store_capabilities_tests_can_remove_personas_cb (PersonaStoreCapabilitiesTests* self, GObject* s, GParamSpec* p);
static void _persona_store_capabilities_tests_can_remove_personas_cb_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static gboolean _vala_string_array_contains (gchar** stack, int stack_length, gchar* needle);
static void persona_store_capabilities_tests_check_can_alias_personas (PersonaStoreCapabilitiesTests* self, GObject* s, GParamSpec* p);
static void persona_store_capabilities_tests_check_can_group_personas_cb (PersonaStoreCapabilitiesTests* self, GObject* s, GParamSpec* p);
static void ___lambda4__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static void persona_store_capabilities_tests_finalize (GObject* obj);
gint _vala_main (gchar** args, int args_length1);


static void _persona_store_capabilities_tests_test_persona_store_capabilities_folks_test_case_test_method (gpointer self) {
#line 40 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	persona_store_capabilities_tests_test_persona_store_capabilities (self);
#line 121 "persona-store-capabilities.c"
}


PersonaStoreCapabilitiesTests* persona_store_capabilities_tests_construct (GType object_type) {
	PersonaStoreCapabilitiesTests * self = NULL;
	TpTestBackend* _tmp0_;
	const gchar* _tmp1_ = NULL;
#line 36 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	self = (PersonaStoreCapabilitiesTests*) folks_test_case_construct (object_type, "PersonaStoreCapabilities");
#line 38 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp0_ = tp_test_backend_new ();
#line 38 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_g_object_unref0 (self->priv->tp_backend);
#line 38 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	self->priv->tp_backend = _tmp0_;
#line 40 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	folks_test_case_add_test ((FolksTestCase*) self, "persona store capabilities", _persona_store_capabilities_tests_test_persona_store_capabilities_folks_test_case_test_method, self);
#line 43 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp1_ = g_getenv ("FOLKS_TEST_VALGRIND");
#line 43 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	if (_tmp1_ != NULL) {
#line 44 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		self->priv->_test_timeout = 10;
#line 145 "persona-store-capabilities.c"
	}
#line 34 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	return self;
#line 149 "persona-store-capabilities.c"
}


PersonaStoreCapabilitiesTests* persona_store_capabilities_tests_new (void) {
#line 34 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	return persona_store_capabilities_tests_construct (TYPE_PERSONA_STORE_CAPABILITIES_TESTS);
#line 156 "persona-store-capabilities.c"
}


static void persona_store_capabilities_tests_real_set_up (FolksTestCase* base) {
	PersonaStoreCapabilitiesTests * self;
	GeeHashSet* _tmp0_;
	TpTestBackend* _tmp1_;
	TpTestBackend* _tmp2_;
	void* _tmp3_ = NULL;
#line 47 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	self = (PersonaStoreCapabilitiesTests*) base;
#line 49 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp0_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
#line 49 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_g_object_unref0 (self->priv->_capabilities_received);
#line 49 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	self->priv->_capabilities_received = _tmp0_;
#line 51 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp1_ = self->priv->tp_backend;
#line 51 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	tp_test_backend_set_up (_tmp1_);
#line 52 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp2_ = self->priv->tp_backend;
#line 52 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp3_ = tp_test_backend_add_account (_tmp2_, "protocol", "me@example.com", "cm", "account");
#line 52 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	self->priv->_account_handle = _tmp3_;
#line 184 "persona-store-capabilities.c"
}


static void persona_store_capabilities_tests_real_tear_down (FolksTestCase* base) {
	PersonaStoreCapabilitiesTests * self;
	TpTestBackend* _tmp0_;
	void* _tmp1_;
	TpTestBackend* _tmp2_;
#line 56 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	self = (PersonaStoreCapabilitiesTests*) base;
#line 58 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp0_ = self->priv->tp_backend;
#line 58 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp1_ = self->priv->_account_handle;
#line 58 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	tp_test_backend_remove_account (_tmp0_, _tmp1_);
#line 59 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp2_ = self->priv->tp_backend;
#line 59 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	tp_test_backend_tear_down (_tmp2_);
#line 205 "persona-store-capabilities.c"
}


static Block1Data* block1_data_ref (Block1Data* _data1_) {
#line 62 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	g_atomic_int_inc (&_data1_->_ref_count_);
#line 62 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	return _data1_;
#line 214 "persona-store-capabilities.c"
}


static void block1_data_unref (Block1Data* _data1_) {
#line 62 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
#line 221 "persona-store-capabilities.c"
		PersonaStoreCapabilitiesTests * self;
#line 62 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		self = _data1_->self;
#line 62 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_g_main_loop_unref0 (_data1_->main_loop);
#line 62 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_g_object_unref0 (self);
#line 62 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		g_slice_free (Block1Data, _data1_);
#line 231 "persona-store-capabilities.c"
	}
}


static void ___lambda3_ (PersonaStoreCapabilitiesTests* self, FolksPersonaStore* ps) {
	FolksPersonaStore* _tmp0_;
#line 71 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	g_return_if_fail (ps != NULL);
#line 73 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp0_ = ps;
#line 73 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	persona_store_capabilities_tests_set_up_persona_store (self, _tmp0_);
#line 244 "persona-store-capabilities.c"
}


static void ____lambda3__folks_backend_persona_store_added (FolksBackend* _sender, FolksPersonaStore* store, gpointer self) {
#line 71 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	___lambda3_ (self, store);
#line 251 "persona-store-capabilities.c"
}


static void __lambda2_ (PersonaStoreCapabilitiesTests* self, FolksBackend* b) {
	FolksBackend* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
#line 67 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	g_return_if_fail (b != NULL);
#line 69 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp0_ = b;
#line 69 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp1_ = folks_backend_get_name (_tmp0_);
#line 69 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp2_ = _tmp1_;
#line 69 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	if (g_strcmp0 (_tmp2_, "telepathy") == 0) {
#line 269 "persona-store-capabilities.c"
		FolksBackend* _tmp3_;
#line 71 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp3_ = b;
#line 71 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		g_signal_connect_object (_tmp3_, "persona-store-added", (GCallback) ____lambda3__folks_backend_persona_store_added, self, 0);
#line 275 "persona-store-capabilities.c"
		{
			FolksBackend* _tmp4_;
			GeeMap* _tmp5_;
			GeeMap* _tmp6_;
			GeeCollection* _tmp7_;
			GeeCollection* _tmp8_;
			GeeCollection* _tmp9_;
			GeeIterator* _tmp10_ = NULL;
			GeeIterator* _tmp11_;
			GeeIterator* _store_it;
#line 76 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
			_tmp4_ = b;
#line 76 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
			_tmp5_ = folks_backend_get_persona_stores (_tmp4_);
#line 76 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
			_tmp6_ = _tmp5_;
#line 76 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
			_tmp7_ = gee_map_get_values (_tmp6_);
#line 76 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
			_tmp8_ = _tmp7_;
#line 76 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
			_tmp9_ = _tmp8_;
#line 76 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
			_tmp10_ = gee_iterable_iterator ((GeeIterable*) _tmp9_);
#line 76 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
			_tmp11_ = _tmp10_;
#line 76 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
			_g_object_unref0 (_tmp9_);
#line 76 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
			_store_it = _tmp11_;
#line 76 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
			while (TRUE) {
#line 308 "persona-store-capabilities.c"
				GeeIterator* _tmp12_;
				gboolean _tmp13_ = FALSE;
				GeeIterator* _tmp14_;
				gpointer _tmp15_ = NULL;
				FolksPersonaStore* store;
				FolksPersonaStore* _tmp16_;
#line 76 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
				_tmp12_ = _store_it;
#line 76 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
				_tmp13_ = gee_iterator_next (_tmp12_);
#line 76 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
				if (!_tmp13_) {
#line 76 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
					break;
#line 323 "persona-store-capabilities.c"
				}
#line 76 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
				_tmp14_ = _store_it;
#line 76 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
				_tmp15_ = gee_iterator_get (_tmp14_);
#line 76 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
				store = (FolksPersonaStore*) _tmp15_;
#line 78 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
				_tmp16_ = store;
#line 78 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
				persona_store_capabilities_tests_set_up_persona_store (self, _tmp16_);
#line 76 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
				_g_object_unref0 (store);
#line 337 "persona-store-capabilities.c"
			}
#line 76 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
			_g_object_unref0 (_store_it);
#line 341 "persona-store-capabilities.c"
		}
	}
}


static void ___lambda2__folks_backend_store_backend_available (FolksBackendStore* _sender, FolksBackend* backend, gpointer self) {
#line 67 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	__lambda2_ (self, backend);
#line 350 "persona-store-capabilities.c"
}


static gboolean __lambda5_ (Block1Data* _data1_) {
	PersonaStoreCapabilitiesTests * self;
	gboolean result = FALSE;
#line 87 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	self = _data1_->self;
#line 89 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	g_main_loop_quit (_data1_->main_loop);
#line 90 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	result = FALSE;
#line 90 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	return result;
#line 365 "persona-store-capabilities.c"
}


static gboolean ___lambda5__gsource_func (gpointer self) {
	gboolean result;
	result = __lambda5_ (self);
#line 87 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	return result;
#line 374 "persona-store-capabilities.c"
}


void persona_store_capabilities_tests_test_persona_store_capabilities (PersonaStoreCapabilitiesTests* self) {
	Block1Data* _data1_;
	GMainLoop* _tmp0_;
	FolksBackendStore* _tmp1_ = NULL;
	FolksBackendStore* backend_store;
	gint _tmp2_;
	GeeHashSet* _tmp3_;
	gboolean _tmp4_ = FALSE;
	GeeHashSet* _tmp5_;
	gboolean _tmp6_ = FALSE;
	GeeHashSet* _tmp7_;
	gboolean _tmp8_ = FALSE;
	GeeHashSet* _tmp9_;
	gboolean _tmp10_ = FALSE;
#line 62 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	g_return_if_fail (self != NULL);
#line 62 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_data1_ = g_slice_new0 (Block1Data);
#line 62 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_data1_->_ref_count_ = 1;
#line 62 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_data1_->self = g_object_ref (self);
#line 64 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp0_ = g_main_loop_new (NULL, FALSE);
#line 64 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_data1_->main_loop = _tmp0_;
#line 66 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp1_ = folks_backend_store_dup ();
#line 66 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	backend_store = _tmp1_;
#line 67 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	g_signal_connect_object (backend_store, "backend-available", (GCallback) ___lambda2__folks_backend_store_backend_available, self, 0);
#line 85 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	folks_backend_store_load_backends (backend_store, NULL, NULL);
#line 87 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp2_ = self->priv->_test_timeout;
#line 87 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) _tmp2_, ___lambda5__gsource_func, block1_data_ref (_data1_), block1_data_unref);
#line 93 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	g_main_loop_run (_data1_->main_loop);
#line 95 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp3_ = self->priv->_capabilities_received;
#line 95 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp4_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp3_, "can-add-personas");
#line 95 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	g_assert (_tmp4_);
#line 96 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp5_ = self->priv->_capabilities_received;
#line 96 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp6_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp5_, "can-remove-personas");
#line 96 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	g_assert (_tmp6_);
#line 97 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp7_ = self->priv->_capabilities_received;
#line 97 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp8_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp7_, "can-alias-personas");
#line 97 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	g_assert (!_tmp8_);
#line 98 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp9_ = self->priv->_capabilities_received;
#line 98 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp10_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp9_, "can-group-personas");
#line 98 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	g_assert (!_tmp10_);
#line 62 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_g_object_unref0 (backend_store);
#line 62 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	block1_data_unref (_data1_);
#line 62 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_data1_ = NULL;
#line 448 "persona-store-capabilities.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 101 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	return self ? g_object_ref (self) : NULL;
#line 455 "persona-store-capabilities.c"
}


static Block2Data* block2_data_ref (Block2Data* _data2_) {
#line 101 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	g_atomic_int_inc (&_data2_->_ref_count_);
#line 101 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	return _data2_;
#line 464 "persona-store-capabilities.c"
}


static void block2_data_unref (Block2Data* _data2_) {
#line 101 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
#line 471 "persona-store-capabilities.c"
		PersonaStoreCapabilitiesTests * self;
#line 101 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		self = _data2_->self;
#line 101 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_g_object_unref0 (_data2_->store);
#line 101 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_g_object_unref0 (self);
#line 101 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		g_slice_free (Block2Data, _data2_);
#line 481 "persona-store-capabilities.c"
	}
}


static void _persona_store_capabilities_tests_can_add_personas_cb_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
#line 112 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	persona_store_capabilities_tests_can_add_personas_cb (self, _sender, pspec);
#line 489 "persona-store-capabilities.c"
}


static void _persona_store_capabilities_tests_can_remove_personas_cb_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
#line 118 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	persona_store_capabilities_tests_can_remove_personas_cb (self, _sender, pspec);
#line 496 "persona-store-capabilities.c"
}


static gboolean _vala_string_array_contains (gchar** stack, int stack_length, gchar* needle) {
	int i;
#line 121 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	for (i = 0; i < stack_length; i++) {
#line 121 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		if (g_strcmp0 (stack[i], needle) == 0) {
#line 121 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
			return TRUE;
#line 508 "persona-store-capabilities.c"
		}
	}
#line 121 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	return FALSE;
#line 513 "persona-store-capabilities.c"
}


static void __lambda4_ (Block2Data* _data2_, GObject* obj, GAsyncResult* _result_) {
	PersonaStoreCapabilitiesTests * self;
	GError * _inner_error_ = NULL;
#line 103 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	self = _data2_->self;
#line 103 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	g_return_if_fail (_result_ != NULL);
#line 524 "persona-store-capabilities.c"
	{
		FolksPersonaStore* _tmp0_;
		GAsyncResult* _tmp1_;
		FolksPersonaStore* _tmp2_;
		FolksMaybeBool _tmp3_;
		FolksMaybeBool _tmp4_;
		FolksPersonaStore* _tmp7_;
		FolksMaybeBool _tmp8_;
		FolksMaybeBool _tmp9_;
		FolksPersonaStore* _tmp12_;
		gchar** _tmp13_;
		gint _tmp13__length1;
		gchar** _tmp14_;
		gint _tmp14__length1;
		FolksPersonaStore* _tmp16_;
		gchar** _tmp17_;
		gint _tmp17__length1;
		gchar** _tmp18_;
		gint _tmp18__length1;
#line 107 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp0_ = _data2_->store;
#line 107 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp1_ = _result_;
#line 107 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		folks_persona_store_prepare_finish (_tmp0_, _tmp1_, &_inner_error_);
#line 107 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		if (_inner_error_ != NULL) {
#line 552 "persona-store-capabilities.c"
			goto __catch0_g_error;
		}
#line 109 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp2_ = _data2_->store;
#line 109 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp3_ = folks_persona_store_get_can_add_personas (_tmp2_);
#line 109 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp4_ = _tmp3_;
#line 109 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		if (_tmp4_ != FOLKS_MAYBE_BOOL_UNSET) {
#line 563 "persona-store-capabilities.c"
			FolksPersonaStore* _tmp5_;
#line 110 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
			_tmp5_ = _data2_->store;
#line 110 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
			persona_store_capabilities_tests_can_add_personas_cb (self, (GObject*) _tmp5_, NULL);
#line 569 "persona-store-capabilities.c"
		} else {
			FolksPersonaStore* _tmp6_;
#line 112 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
			_tmp6_ = _data2_->store;
#line 112 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
			g_signal_connect_object ((GObject*) _tmp6_, "notify::can-add-personas", (GCallback) _persona_store_capabilities_tests_can_add_personas_cb_g_object_notify, self, 0);
#line 576 "persona-store-capabilities.c"
		}
#line 115 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp7_ = _data2_->store;
#line 115 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp8_ = folks_persona_store_get_can_remove_personas (_tmp7_);
#line 115 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp9_ = _tmp8_;
#line 115 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		if (_tmp9_ != FOLKS_MAYBE_BOOL_UNSET) {
#line 586 "persona-store-capabilities.c"
			FolksPersonaStore* _tmp10_;
#line 116 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
			_tmp10_ = _data2_->store;
#line 116 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
			persona_store_capabilities_tests_can_remove_personas_cb (self, (GObject*) _tmp10_, NULL);
#line 592 "persona-store-capabilities.c"
		} else {
			FolksPersonaStore* _tmp11_;
#line 118 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
			_tmp11_ = _data2_->store;
#line 118 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
			g_signal_connect_object ((GObject*) _tmp11_, "notify::can-remove-personas", (GCallback) _persona_store_capabilities_tests_can_remove_personas_cb_g_object_notify, self, 0);
#line 599 "persona-store-capabilities.c"
		}
#line 121 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp12_ = _data2_->store;
#line 121 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp13_ = folks_persona_store_get_always_writeable_properties (_tmp12_, &_tmp13__length1);
#line 121 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp14_ = _tmp13_;
#line 121 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp14__length1 = _tmp13__length1;
#line 121 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		if (_vala_string_array_contains (_tmp14_, _tmp14__length1, "alias")) {
#line 611 "persona-store-capabilities.c"
			FolksPersonaStore* _tmp15_;
#line 122 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
			_tmp15_ = _data2_->store;
#line 122 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
			persona_store_capabilities_tests_check_can_alias_personas (self, (GObject*) _tmp15_, NULL);
#line 617 "persona-store-capabilities.c"
		}
#line 124 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp16_ = _data2_->store;
#line 124 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp17_ = folks_persona_store_get_always_writeable_properties (_tmp16_, &_tmp17__length1);
#line 124 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp18_ = _tmp17_;
#line 124 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp18__length1 = _tmp17__length1;
#line 124 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		if (_vala_string_array_contains (_tmp18_, _tmp18__length1, "groups")) {
#line 629 "persona-store-capabilities.c"
			FolksPersonaStore* _tmp19_;
#line 125 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
			_tmp19_ = _data2_->store;
#line 125 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
			persona_store_capabilities_tests_check_can_group_personas_cb (self, (GObject*) _tmp19_, NULL);
#line 635 "persona-store-capabilities.c"
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		FolksPersonaStore* _tmp20_;
		const gchar* _tmp21_;
		const gchar* _tmp22_;
		FolksPersonaStore* _tmp23_;
		const gchar* _tmp24_;
		const gchar* _tmp25_;
		GError* _tmp26_;
		const gchar* _tmp27_;
#line 105 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		e = _inner_error_;
#line 105 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_inner_error_ = NULL;
#line 129 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp20_ = _data2_->store;
#line 129 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp21_ = folks_persona_store_get_type_id (_tmp20_);
#line 129 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp22_ = _tmp21_;
#line 129 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp23_ = _data2_->store;
#line 129 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp24_ = folks_persona_store_get_id (_tmp23_);
#line 129 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp25_ = _tmp24_;
#line 129 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp26_ = e;
#line 129 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp27_ = _tmp26_->message;
#line 129 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		g_warning ("Error preparing PersonaStore type: %s, id: %s: " "'%s'", _tmp22_, _tmp25_, _tmp27_);
#line 105 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_g_error_free0 (e);
#line 674 "persona-store-capabilities.c"
	}
	__finally0:
#line 105 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	if (_inner_error_ != NULL) {
#line 105 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 105 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		g_clear_error (&_inner_error_);
#line 105 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		return;
#line 685 "persona-store-capabilities.c"
	}
}


static void ___lambda4__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
#line 103 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	__lambda4_ (self, source_object, res);
#line 103 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	block2_data_unref (self);
#line 695 "persona-store-capabilities.c"
}


static void persona_store_capabilities_tests_set_up_persona_store (PersonaStoreCapabilitiesTests* self, FolksPersonaStore* store) {
	Block2Data* _data2_;
	FolksPersonaStore* _tmp0_;
	FolksPersonaStore* _tmp1_;
	FolksPersonaStore* _tmp2_;
#line 101 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	g_return_if_fail (self != NULL);
#line 101 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	g_return_if_fail (store != NULL);
#line 101 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_data2_ = g_slice_new0 (Block2Data);
#line 101 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_data2_->_ref_count_ = 1;
#line 101 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_data2_->self = g_object_ref (self);
#line 101 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp0_ = store;
#line 101 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp1_ = _g_object_ref0 (_tmp0_);
#line 101 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_data2_->store = _tmp1_;
#line 103 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp2_ = _data2_->store;
#line 103 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	folks_persona_store_prepare (_tmp2_, ___lambda4__gasync_ready_callback, block2_data_ref (_data2_));
#line 101 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	block2_data_unref (_data2_);
#line 101 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_data2_ = NULL;
#line 728 "persona-store-capabilities.c"
}


static void persona_store_capabilities_tests_can_add_personas_cb (PersonaStoreCapabilitiesTests* self, GObject* s, GParamSpec* p) {
	GObject* _tmp0_;
	GObject* _tmp1_;
	TpfPersonaStore* _tmp2_;
	TpfPersonaStore* store;
	TpfPersonaStore* _tmp3_;
	FolksMaybeBool _tmp4_;
	FolksMaybeBool _tmp5_;
#line 135 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	g_return_if_fail (self != NULL);
#line 135 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	g_return_if_fail (s != NULL);
#line 137 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp0_ = s;
#line 137 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	g_assert (TPF_IS_PERSONA_STORE (_tmp0_));
#line 138 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp1_ = s;
#line 138 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp2_ = _g_object_ref0 (TPF_PERSONA_STORE (_tmp1_));
#line 138 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	store = _tmp2_;
#line 140 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp3_ = store;
#line 140 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp4_ = folks_persona_store_get_can_add_personas ((FolksPersonaStore*) _tmp3_);
#line 140 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp5_ = _tmp4_;
#line 140 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	if (_tmp5_ != FOLKS_MAYBE_BOOL_UNSET) {
#line 762 "persona-store-capabilities.c"
		TpfPersonaStore* _tmp6_;
		FolksMaybeBool _tmp7_;
		FolksMaybeBool _tmp8_;
		GeeHashSet* _tmp9_;
		TpfPersonaStore* _tmp10_;
		guint _tmp11_ = 0U;
		GQuark _tmp12_ = 0U;
#line 142 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp6_ = store;
#line 142 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp7_ = folks_persona_store_get_can_add_personas ((FolksPersonaStore*) _tmp6_);
#line 142 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp8_ = _tmp7_;
#line 142 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		g_assert (_tmp8_ == FOLKS_MAYBE_BOOL_TRUE);
#line 144 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp9_ = self->priv->_capabilities_received;
#line 144 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp9_, "can-add-personas");
#line 146 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp10_ = store;
#line 146 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		g_signal_parse_name ("notify::can-add-personas", G_TYPE_OBJECT, &_tmp11_, &_tmp12_, TRUE);
#line 146 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		g_signal_handlers_disconnect_matched ((GObject*) _tmp10_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp11_, _tmp12_, NULL, (GCallback) _persona_store_capabilities_tests_can_add_personas_cb_g_object_notify, self);
#line 788 "persona-store-capabilities.c"
	}
#line 135 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_g_object_unref0 (store);
#line 792 "persona-store-capabilities.c"
}


static void persona_store_capabilities_tests_can_remove_personas_cb (PersonaStoreCapabilitiesTests* self, GObject* s, GParamSpec* p) {
	GObject* _tmp0_;
	GObject* _tmp1_;
	TpfPersonaStore* _tmp2_;
	TpfPersonaStore* store;
	TpfPersonaStore* _tmp3_;
	FolksMaybeBool _tmp4_;
	FolksMaybeBool _tmp5_;
#line 151 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	g_return_if_fail (self != NULL);
#line 151 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	g_return_if_fail (s != NULL);
#line 153 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp0_ = s;
#line 153 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	g_assert (TPF_IS_PERSONA_STORE (_tmp0_));
#line 154 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp1_ = s;
#line 154 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp2_ = _g_object_ref0 (TPF_PERSONA_STORE (_tmp1_));
#line 154 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	store = _tmp2_;
#line 156 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp3_ = store;
#line 156 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp4_ = folks_persona_store_get_can_remove_personas ((FolksPersonaStore*) _tmp3_);
#line 156 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp5_ = _tmp4_;
#line 156 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	if (_tmp5_ != FOLKS_MAYBE_BOOL_UNSET) {
#line 826 "persona-store-capabilities.c"
		TpfPersonaStore* _tmp6_;
		FolksMaybeBool _tmp7_;
		FolksMaybeBool _tmp8_;
		GeeHashSet* _tmp9_;
		TpfPersonaStore* _tmp10_;
		guint _tmp11_ = 0U;
		GQuark _tmp12_ = 0U;
#line 158 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp6_ = store;
#line 158 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp7_ = folks_persona_store_get_can_remove_personas ((FolksPersonaStore*) _tmp6_);
#line 158 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp8_ = _tmp7_;
#line 158 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		g_assert (_tmp8_ == FOLKS_MAYBE_BOOL_TRUE);
#line 160 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp9_ = self->priv->_capabilities_received;
#line 160 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp9_, "can-remove-personas");
#line 162 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp10_ = store;
#line 162 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		g_signal_parse_name ("notify::can-remove-personas", G_TYPE_OBJECT, &_tmp11_, &_tmp12_, TRUE);
#line 162 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		g_signal_handlers_disconnect_matched ((GObject*) _tmp10_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp11_, _tmp12_, NULL, (GCallback) _persona_store_capabilities_tests_can_remove_personas_cb_g_object_notify, self);
#line 852 "persona-store-capabilities.c"
	}
#line 151 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_g_object_unref0 (store);
#line 856 "persona-store-capabilities.c"
}


static void persona_store_capabilities_tests_check_can_alias_personas (PersonaStoreCapabilitiesTests* self, GObject* s, GParamSpec* p) {
	GObject* _tmp0_;
	GObject* _tmp1_;
	TpfPersonaStore* _tmp2_;
	TpfPersonaStore* store;
	TpfPersonaStore* _tmp3_;
	gchar** _tmp4_;
	gint _tmp4__length1;
	gchar** _tmp5_;
	gint _tmp5__length1;
#line 167 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	g_return_if_fail (self != NULL);
#line 167 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	g_return_if_fail (s != NULL);
#line 169 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp0_ = s;
#line 169 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	g_assert (TPF_IS_PERSONA_STORE (_tmp0_));
#line 170 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp1_ = s;
#line 170 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp2_ = _g_object_ref0 (TPF_PERSONA_STORE (_tmp1_));
#line 170 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	store = _tmp2_;
#line 172 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp3_ = store;
#line 172 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp4_ = folks_persona_store_get_always_writeable_properties ((FolksPersonaStore*) _tmp3_, &_tmp4__length1);
#line 172 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp5_ = _tmp4_;
#line 172 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp5__length1 = _tmp4__length1;
#line 172 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	if (_vala_string_array_contains (_tmp5_, _tmp5__length1, "alias")) {
#line 894 "persona-store-capabilities.c"
		GeeHashSet* _tmp6_;
#line 173 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp6_ = self->priv->_capabilities_received;
#line 173 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp6_, "can-alias-personas");
#line 900 "persona-store-capabilities.c"
	}
#line 167 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_g_object_unref0 (store);
#line 904 "persona-store-capabilities.c"
}


static void persona_store_capabilities_tests_check_can_group_personas_cb (PersonaStoreCapabilitiesTests* self, GObject* s, GParamSpec* p) {
	GObject* _tmp0_;
	GObject* _tmp1_;
	TpfPersonaStore* _tmp2_;
	TpfPersonaStore* store;
	TpfPersonaStore* _tmp3_;
	gchar** _tmp4_;
	gint _tmp4__length1;
	gchar** _tmp5_;
	gint _tmp5__length1;
#line 176 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	g_return_if_fail (self != NULL);
#line 176 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	g_return_if_fail (s != NULL);
#line 178 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp0_ = s;
#line 178 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	g_assert (TPF_IS_PERSONA_STORE (_tmp0_));
#line 179 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp1_ = s;
#line 179 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp2_ = _g_object_ref0 (TPF_PERSONA_STORE (_tmp1_));
#line 179 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	store = _tmp2_;
#line 181 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp3_ = store;
#line 181 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp4_ = folks_persona_store_get_always_writeable_properties ((FolksPersonaStore*) _tmp3_, &_tmp4__length1);
#line 181 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp5_ = _tmp4_;
#line 181 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp5__length1 = _tmp4__length1;
#line 181 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	if (_vala_string_array_contains (_tmp5_, _tmp5__length1, "groups")) {
#line 942 "persona-store-capabilities.c"
		GeeHashSet* _tmp6_;
#line 182 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		_tmp6_ = self->priv->_capabilities_received;
#line 182 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp6_, "can-group-personas");
#line 948 "persona-store-capabilities.c"
	}
#line 176 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_g_object_unref0 (store);
#line 952 "persona-store-capabilities.c"
}


static void persona_store_capabilities_tests_class_init (PersonaStoreCapabilitiesTestsClass * klass) {
#line 27 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	persona_store_capabilities_tests_parent_class = g_type_class_peek_parent (klass);
#line 27 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	g_type_class_add_private (klass, sizeof (PersonaStoreCapabilitiesTestsPrivate));
#line 27 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	FOLKS_TEST_CASE_CLASS (klass)->set_up = persona_store_capabilities_tests_real_set_up;
#line 27 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	FOLKS_TEST_CASE_CLASS (klass)->tear_down = persona_store_capabilities_tests_real_tear_down;
#line 27 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	G_OBJECT_CLASS (klass)->finalize = persona_store_capabilities_tests_finalize;
#line 967 "persona-store-capabilities.c"
}


static void persona_store_capabilities_tests_instance_init (PersonaStoreCapabilitiesTests * self) {
#line 27 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	self->priv = PERSONA_STORE_CAPABILITIES_TESTS_GET_PRIVATE (self);
#line 32 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	self->priv->_test_timeout = 3;
#line 976 "persona-store-capabilities.c"
}


static void persona_store_capabilities_tests_finalize (GObject* obj) {
	PersonaStoreCapabilitiesTests * self;
#line 27 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	self = PERSONA_STORE_CAPABILITIES_TESTS (obj);
#line 29 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_g_object_unref0 (self->priv->tp_backend);
#line 31 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_g_object_unref0 (self->priv->_capabilities_received);
#line 27 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	G_OBJECT_CLASS (persona_store_capabilities_tests_parent_class)->finalize (obj);
#line 990 "persona-store-capabilities.c"
}


GType persona_store_capabilities_tests_get_type (void) {
	static volatile gsize persona_store_capabilities_tests_type_id__volatile = 0;
	if (g_once_init_enter (&persona_store_capabilities_tests_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (PersonaStoreCapabilitiesTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) persona_store_capabilities_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PersonaStoreCapabilitiesTests), 0, (GInstanceInitFunc) persona_store_capabilities_tests_instance_init, NULL };
		GType persona_store_capabilities_tests_type_id;
		persona_store_capabilities_tests_type_id = g_type_register_static (FOLKS_TYPE_TEST_CASE, "PersonaStoreCapabilitiesTests", &g_define_type_info, 0);
		g_once_init_leave (&persona_store_capabilities_tests_type_id__volatile, persona_store_capabilities_tests_type_id);
	}
	return persona_store_capabilities_tests_type_id__volatile;
}


gint _vala_main (gchar** args, int args_length1) {
	gint result = 0;
	GTestSuite* _tmp0_ = NULL;
	GTestSuite* root;
	PersonaStoreCapabilitiesTests* _tmp1_;
	PersonaStoreCapabilitiesTests* _tmp2_;
	GTestSuite* _tmp3_ = NULL;
#line 188 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	g_test_init (&args_length1, &args, NULL);
#line 190 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp0_ = g_test_get_root ();
#line 190 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	root = _tmp0_;
#line 191 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp1_ = persona_store_capabilities_tests_new ();
#line 191 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp2_ = _tmp1_;
#line 191 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_tmp3_ = folks_test_case_get_suite ((FolksTestCase*) _tmp2_);
#line 191 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	g_test_suite_add_suite (root, _tmp3_);
#line 191 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	_g_object_unref0 (_tmp2_);
#line 193 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	g_test_run ();
#line 195 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	result = 0;
#line 195 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	return result;
#line 1035 "persona-store-capabilities.c"
}


int main (int argc, char ** argv) {
#line 186 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	g_type_init ();
#line 186 "/opt/gnome2/source/folks/tests/telepathy/persona-store-capabilities.vala"
	return _vala_main (argv, argc);
#line 1044 "persona-store-capabilities.c"
}



