/* test-case.c generated by valac 0.26.2.1-1f25, the Vala compiler
 * generated from test-case.vala, do not modify */

/* test-case.vala
 *
 * Copyright © 2013 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, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * Author:
 *      Renato Araujo Oliveira Filho <renato@canonical.com>
 *      Philip Withnall <philip.withnall@collabora.co.uk>
 */

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


#define DUMMY_TEST_TYPE_TEST_CASE (dummy_test_test_case_get_type ())
#define DUMMY_TEST_TEST_CASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DUMMY_TEST_TYPE_TEST_CASE, DummyTestTestCase))
#define DUMMY_TEST_TEST_CASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DUMMY_TEST_TYPE_TEST_CASE, DummyTestTestCaseClass))
#define DUMMY_TEST_IS_TEST_CASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DUMMY_TEST_TYPE_TEST_CASE))
#define DUMMY_TEST_IS_TEST_CASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DUMMY_TEST_TYPE_TEST_CASE))
#define DUMMY_TEST_TEST_CASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DUMMY_TEST_TYPE_TEST_CASE, DummyTestTestCaseClass))

typedef struct _DummyTestTestCase DummyTestTestCase;
typedef struct _DummyTestTestCaseClass DummyTestTestCaseClass;
typedef struct _DummyTestTestCasePrivate DummyTestTestCasePrivate;
#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)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_main_context_unref0(var) ((var == NULL) ? NULL : (var = (g_main_context_unref (var), NULL)))
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _DummyTestTestCase {
	FolksTestCase parent_instance;
	DummyTestTestCasePrivate * priv;
	FolksDummyBackend* dummy_backend;
	FolksDummyPersonaStore* dummy_persona_store;
};

struct _DummyTestTestCaseClass {
	FolksTestCaseClass parent_class;
	void (*configure_primary_store) (DummyTestTestCase* self);
};

struct _DummyTestTestCasePrivate {
	FolksBackendStore* _backend_store;
};

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


static gpointer dummy_test_test_case_parent_class = NULL;

GType dummy_test_test_case_get_type (void) G_GNUC_CONST;
#define DUMMY_TEST_TEST_CASE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), DUMMY_TEST_TYPE_TEST_CASE, DummyTestTestCasePrivate))
enum  {
	DUMMY_TEST_TEST_CASE_DUMMY_PROPERTY
};
DummyTestTestCase* dummy_test_test_case_new (const gchar* name);
DummyTestTestCase* dummy_test_test_case_construct (GType object_type, const gchar* name);
static void dummy_test_test_case_real_set_up (FolksTestCase* base);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static void __lambda4_ (Block1Data* _data1_, GObject* obj, GAsyncResult* res);
static void ___lambda4__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
void dummy_test_test_case_configure_primary_store (DummyTestTestCase* self);
static void dummy_test_test_case_real_configure_primary_store (DummyTestTestCase* self);
static void dummy_test_test_case_real_tear_down (FolksTestCase* base);
static void dummy_test_test_case_finalize (GObject* obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);


/**
   * Create a new dummy test case.
   *
   * @param name test case name
   *
   * @since 0.9.7
   */
DummyTestTestCase* dummy_test_test_case_construct (GType object_type, const gchar* name) {
	DummyTestTestCase * self = NULL;
	const gchar* _tmp0_ = NULL;
#line 58 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	g_return_val_if_fail (name != NULL, NULL);
#line 60 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_tmp0_ = name;
#line 60 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	self = (DummyTestTestCase*) folks_test_case_construct (object_type, _tmp0_);
#line 62 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	g_setenv ("FOLKS_BACKENDS_ALLOWED", "dummy", TRUE);
#line 63 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	g_setenv ("FOLKS_PRIMARY_STORE", "dummy", TRUE);
#line 58 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	return self;
#line 123 "test-case.c"
}


DummyTestTestCase* dummy_test_test_case_new (const gchar* name) {
#line 58 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	return dummy_test_test_case_construct (DUMMY_TEST_TYPE_TEST_CASE, name);
#line 130 "test-case.c"
}


/**
   * {@inheritDoc}
   *
   * @since 0.9.7
   */
static Block1Data* block1_data_ref (Block1Data* _data1_) {
#line 71 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	g_atomic_int_inc (&_data1_->_ref_count_);
#line 71 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	return _data1_;
#line 144 "test-case.c"
}


static void block1_data_unref (void * _userdata_) {
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
#line 71 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
#line 153 "test-case.c"
		DummyTestTestCase* self;
#line 71 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
		self = _data1_->self;
#line 71 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
		_g_main_loop_unref0 (_data1_->main_loop);
#line 71 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
		_g_object_unref0 (self);
#line 71 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
		g_slice_free (Block1Data, _data1_);
#line 163 "test-case.c"
	}
}


static void __lambda4_ (Block1Data* _data1_, GObject* obj, GAsyncResult* res) {
	DummyTestTestCase* self;
	GError * _inner_error_ = NULL;
#line 78 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	self = _data1_->self;
#line 78 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	g_return_if_fail (res != NULL);
#line 175 "test-case.c"
	{
		FolksBackendStore* _tmp0_ = NULL;
		GAsyncResult* _tmp1_ = NULL;
#line 82 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
		_tmp0_ = self->priv->_backend_store;
#line 82 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
		_tmp1_ = res;
#line 82 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
		folks_backend_store_load_backends_finish (_tmp0_, _tmp1_, &_inner_error_);
#line 82 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 187 "test-case.c"
			goto __catch0_g_error;
		}
#line 83 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
		g_main_loop_quit (_data1_->main_loop);
#line 192 "test-case.c"
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e1 = NULL;
		const gchar* _tmp2_ = NULL;
#line 80 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
		e1 = _inner_error_;
#line 80 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
		_inner_error_ = NULL;
#line 87 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
		_tmp2_ = e1->message;
#line 87 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
		g_error ("test-case.vala:87: Failed to initialise backend store: %s", _tmp2_);
#line 80 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
		_g_error_free0 (e1);
#line 209 "test-case.c"
	}
	__finally0:
#line 80 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 80 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.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 80 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
		g_clear_error (&_inner_error_);
#line 80 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
		return;
#line 220 "test-case.c"
	}
}


static void ___lambda4__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
#line 78 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	__lambda4_ (self, source_object, res);
#line 78 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	block1_data_unref (self);
#line 230 "test-case.c"
}


static void dummy_test_test_case_real_set_up (FolksTestCase* base) {
	DummyTestTestCase * self;
	Block1Data* _data1_;
	GMainLoop* _tmp0_ = NULL;
	FolksBackendStore* _tmp1_ = NULL;
	FolksBackendStore* _tmp2_ = NULL;
	FolksBackendStore* _tmp3_ = NULL;
	FolksBackend* _tmp4_ = NULL;
	FolksDummyBackend* _tmp5_ = NULL;
#line 71 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	self = (DummyTestTestCase*) base;
#line 71 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_data1_ = g_slice_new0 (Block1Data);
#line 71 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_data1_->_ref_count_ = 1;
#line 71 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_data1_->self = g_object_ref (self);
#line 73 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	FOLKS_TEST_CASE_CLASS (dummy_test_test_case_parent_class)->set_up (G_TYPE_CHECK_INSTANCE_CAST (self, FOLKS_TYPE_TEST_CASE, FolksTestCase));
#line 75 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_tmp0_ = g_main_loop_new (NULL, FALSE);
#line 75 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_data1_->main_loop = _tmp0_;
#line 77 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_tmp1_ = folks_backend_store_dup ();
#line 77 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_g_object_unref0 (self->priv->_backend_store);
#line 77 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	self->priv->_backend_store = _tmp1_;
#line 78 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_tmp2_ = self->priv->_backend_store;
#line 78 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	folks_backend_store_load_backends (_tmp2_, ___lambda4__gasync_ready_callback, block1_data_ref (_data1_));
#line 91 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	folks_test_utils_loop_run_with_timeout (_data1_->main_loop, 5);
#line 94 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_tmp3_ = self->priv->_backend_store;
#line 94 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_tmp4_ = folks_backend_store_dup_backend_by_name (_tmp3_, "dummy");
#line 94 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_g_object_unref0 (self->dummy_backend);
#line 94 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	self->dummy_backend = G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, FOLKS_DUMMY_TYPE_BACKEND, FolksDummyBackend);
#line 97 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_tmp5_ = self->dummy_backend;
#line 97 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_vala_assert (_tmp5_ != NULL, "this.dummy_backend != null");
#line 99 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	dummy_test_test_case_configure_primary_store (self);
#line 71 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	block1_data_unref (_data1_);
#line 71 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_data1_ = NULL;
#line 287 "test-case.c"
}


/**
   * {@inheritDoc}
   *
   * @since 0.9.7
   */
static void dummy_test_test_case_real_configure_primary_store (DummyTestTestCase* self) {
	gchar** writable_properties = NULL;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	gchar** _tmp6_ = NULL;
	gint writable_properties_length1 = 0;
	gint _writable_properties_size_ = 0;
	FolksDummyPersonaStore* _tmp7_ = NULL;
	FolksDummyPersonaStore* _tmp8_ = NULL;
	GeeHashSet* persona_stores = NULL;
	GeeHashSet* _tmp9_ = NULL;
	FolksDummyPersonaStore* _tmp10_ = NULL;
	FolksDummyBackend* _tmp11_ = NULL;
#line 109 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_tmp0_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_BIRTHDAY);
#line 109 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_tmp1_ = g_strdup (_tmp0_);
#line 109 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_tmp2_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_EMAIL_ADDRESSES);
#line 109 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_tmp3_ = g_strdup (_tmp2_);
#line 109 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_tmp4_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_PHONE_NUMBERS);
#line 109 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_tmp5_ = g_strdup (_tmp4_);
#line 109 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_tmp6_ = g_new0 (gchar*, 4 + 1);
#line 109 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_tmp6_[0] = _tmp1_;
#line 109 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_tmp6_[1] = _tmp3_;
#line 109 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_tmp6_[2] = _tmp5_;
#line 109 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_tmp6_[3] = NULL;
#line 109 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	writable_properties = _tmp6_;
#line 109 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	writable_properties_length1 = 4;
#line 109 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_writable_properties_size_ = writable_properties_length1;
#line 118 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_tmp7_ = folks_dummy_persona_store_new ("dummy-store", "Dummy personas", writable_properties, writable_properties_length1);
#line 118 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_g_object_unref0 (self->dummy_persona_store);
#line 118 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	self->dummy_persona_store = _tmp7_;
#line 121 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_tmp8_ = self->dummy_persona_store;
#line 121 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	folks_dummy_persona_store_set_persona_type (_tmp8_, FOLKS_DUMMY_TYPE_FULL_PERSONA);
#line 124 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_tmp9_ = gee_hash_set_new (FOLKS_TYPE_PERSONA_STORE, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
#line 124 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	persona_stores = _tmp9_;
#line 125 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_tmp10_ = self->dummy_persona_store;
#line 125 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	gee_abstract_collection_add ((GeeAbstractCollection*) persona_stores, (FolksPersonaStore*) _tmp10_);
#line 126 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_tmp11_ = self->dummy_backend;
#line 126 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	folks_dummy_backend_register_persona_stores (_tmp11_, (GeeSet*) persona_stores, TRUE);
#line 107 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_g_object_unref0 (persona_stores);
#line 107 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	writable_properties = (_vala_array_free (writable_properties, writable_properties_length1, (GDestroyNotify) g_free), NULL);
#line 367 "test-case.c"
}


void dummy_test_test_case_configure_primary_store (DummyTestTestCase* self) {
#line 107 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	g_return_if_fail (self != NULL);
#line 107 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	DUMMY_TEST_TEST_CASE_GET_CLASS (self)->configure_primary_store (self);
#line 376 "test-case.c"
}


/**
   * {@inheritDoc}
   *
   * @since 0.9.7
   */
static gpointer _g_main_context_ref0 (gpointer self) {
#line 150 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	return self ? g_main_context_ref (self) : NULL;
#line 388 "test-case.c"
}


static void dummy_test_test_case_real_tear_down (FolksTestCase* base) {
	DummyTestTestCase * self;
	GeeHashSet* persona_stores = NULL;
	GeeHashSet* _tmp0_ = NULL;
	GeeHashSet* _tmp1_ = NULL;
	FolksDummyPersonaStore* _tmp2_ = NULL;
	FolksDummyBackend* _tmp3_ = NULL;
	GeeHashSet* _tmp4_ = NULL;
	GMainContext* context = NULL;
	GMainContext* _tmp5_ = NULL;
	GMainContext* _tmp6_ = NULL;
#line 134 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	self = (DummyTestTestCase*) base;
#line 136 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_tmp0_ = gee_hash_set_new (FOLKS_TYPE_PERSONA_STORE, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
#line 136 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	persona_stores = _tmp0_;
#line 137 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_tmp1_ = persona_stores;
#line 137 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_tmp2_ = self->dummy_persona_store;
#line 137 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp1_, (FolksPersonaStore*) _tmp2_);
#line 138 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_tmp3_ = self->dummy_backend;
#line 138 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_tmp4_ = persona_stores;
#line 138 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	folks_dummy_backend_unregister_persona_stores (_tmp3_, (GeeSet*) _tmp4_);
#line 140 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_g_object_unref0 (self->dummy_persona_store);
#line 140 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	self->dummy_persona_store = NULL;
#line 141 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_g_object_unref0 (self->dummy_backend);
#line 141 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	self->dummy_backend = NULL;
#line 142 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_g_object_unref0 (self->priv->_backend_store);
#line 142 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	self->priv->_backend_store = NULL;
#line 150 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_tmp5_ = g_main_context_default ();
#line 150 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_tmp6_ = _g_main_context_ref0 (_tmp5_);
#line 150 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	context = _tmp6_;
#line 151 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	while (TRUE) {
#line 441 "test-case.c"
		GMainContext* _tmp7_ = NULL;
		gboolean _tmp8_ = FALSE;
#line 151 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
		_tmp7_ = context;
#line 151 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
		_tmp8_ = g_main_context_iteration (_tmp7_, FALSE);
#line 151 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
		if (!_tmp8_) {
#line 151 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
			break;
#line 452 "test-case.c"
		}
	}
#line 153 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	FOLKS_TEST_CASE_CLASS (dummy_test_test_case_parent_class)->tear_down (G_TYPE_CHECK_INSTANCE_CAST (self, FOLKS_TYPE_TEST_CASE, FolksTestCase));
#line 134 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_g_main_context_unref0 (context);
#line 134 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_g_object_unref0 (persona_stores);
#line 461 "test-case.c"
}


static void dummy_test_test_case_class_init (DummyTestTestCaseClass * klass) {
#line 33 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	dummy_test_test_case_parent_class = g_type_class_peek_parent (klass);
#line 33 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	g_type_class_add_private (klass, sizeof (DummyTestTestCasePrivate));
#line 33 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	((FolksTestCaseClass *) klass)->set_up = dummy_test_test_case_real_set_up;
#line 33 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	((DummyTestTestCaseClass *) klass)->configure_primary_store = dummy_test_test_case_real_configure_primary_store;
#line 33 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	((FolksTestCaseClass *) klass)->tear_down = dummy_test_test_case_real_tear_down;
#line 33 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	G_OBJECT_CLASS (klass)->finalize = dummy_test_test_case_finalize;
#line 478 "test-case.c"
}


static void dummy_test_test_case_instance_init (DummyTestTestCase * self) {
#line 33 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	self->priv = DUMMY_TEST_TEST_CASE_GET_PRIVATE (self);
#line 485 "test-case.c"
}


static void dummy_test_test_case_finalize (GObject* obj) {
	DummyTestTestCase * self;
#line 33 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DUMMY_TEST_TYPE_TEST_CASE, DummyTestTestCase);
#line 35 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_g_object_unref0 (self->priv->_backend_store);
#line 42 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_g_object_unref0 (self->dummy_backend);
#line 49 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	_g_object_unref0 (self->dummy_persona_store);
#line 33 "/opt/gnome3/source/folks/tests/lib/dummy/test-case.vala"
	G_OBJECT_CLASS (dummy_test_test_case_parent_class)->finalize (obj);
#line 501 "test-case.c"
}


/**
 * A test case for the dummy backend, which is configured as the
 * primary store and as the only backend allowed.
 *
 * @since 0.9.7
 */
GType dummy_test_test_case_get_type (void) {
	static volatile gsize dummy_test_test_case_type_id__volatile = 0;
	if (g_once_init_enter (&dummy_test_test_case_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (DummyTestTestCaseClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dummy_test_test_case_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DummyTestTestCase), 0, (GInstanceInitFunc) dummy_test_test_case_instance_init, NULL };
		GType dummy_test_test_case_type_id;
		dummy_test_test_case_type_id = g_type_register_static (FOLKS_TYPE_TEST_CASE, "DummyTestTestCase", &g_define_type_info, 0);
		g_once_init_leave (&dummy_test_test_case_type_id__volatile, dummy_test_test_case_type_id);
	}
	return dummy_test_test_case_type_id__volatile;
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}



