/* object-cache.c generated by valac 0.13.1.106-1068, the Vala compiler
 * generated from object-cache.vala, do not modify */


#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <folks/folks.h>
#include <folks-test.h>
#include <gio/gio.h>
#include <gee.h>
#include <float.h>
#include <math.h>
#include <gobject/gvaluecollector.h>


#define TYPE_TEST_OBJECT (test_object_get_type ())
#define TEST_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TEST_OBJECT, TestObject))
#define TEST_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TEST_OBJECT, TestObjectClass))
#define IS_TEST_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TEST_OBJECT))
#define IS_TEST_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TEST_OBJECT))
#define TEST_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TEST_OBJECT, TestObjectClass))

typedef struct _TestObject TestObject;
typedef struct _TestObjectClass TestObjectClass;
typedef struct _TestObjectPrivate TestObjectPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _ParamSpecTestObject ParamSpecTestObject;

#define TYPE_TEST_CACHE (test_cache_get_type ())
#define TEST_CACHE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TEST_CACHE, TestCache))
#define TEST_CACHE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TEST_CACHE, TestCacheClass))
#define IS_TEST_CACHE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TEST_CACHE))
#define IS_TEST_CACHE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TEST_CACHE))
#define TEST_CACHE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TEST_CACHE, TestCacheClass))

typedef struct _TestCache TestCache;
typedef struct _TestCacheClass TestCacheClass;
typedef struct _TestCachePrivate TestCachePrivate;
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))

#define TYPE_OBJECT_CACHE_TESTS (object_cache_tests_get_type ())
#define OBJECT_CACHE_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_OBJECT_CACHE_TESTS, ObjectCacheTests))
#define OBJECT_CACHE_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_OBJECT_CACHE_TESTS, ObjectCacheTestsClass))
#define IS_OBJECT_CACHE_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_OBJECT_CACHE_TESTS))
#define IS_OBJECT_CACHE_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_OBJECT_CACHE_TESTS))
#define OBJECT_CACHE_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_OBJECT_CACHE_TESTS, ObjectCacheTestsClass))

typedef struct _ObjectCacheTests ObjectCacheTests;
typedef struct _ObjectCacheTestsClass ObjectCacheTestsClass;
typedef struct _ObjectCacheTestsPrivate ObjectCacheTestsPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _Block1Data Block1Data;
#define _g_main_loop_unref0(var) ((var == NULL) ? NULL : (var = (g_main_loop_unref (var), NULL)))
#define _test_object_unref0(var) ((var == NULL) ? NULL : (var = (test_object_unref (var), NULL)))
typedef struct _Block2Data Block2Data;
typedef struct _Block3Data Block3Data;
typedef struct _Block4Data Block4Data;
typedef struct _Block5Data Block5Data;
typedef struct _Block6Data Block6Data;
typedef struct _Block7Data Block7Data;
typedef struct _Block8Data Block8Data;
typedef struct _Block9Data Block9Data;
typedef struct _Block10Data Block10Data;
typedef struct _Block11Data Block11Data;

struct _TestObject {
	GTypeInstance parent_instance;
	volatile int ref_count;
	TestObjectPrivate * priv;
};

struct _TestObjectClass {
	GTypeClass parent_class;
	void (*finalize) (TestObject *self);
};

struct _TestObjectPrivate {
	gchar* _my_string;
	guint _my_int;
};

struct _ParamSpecTestObject {
	GParamSpec parent_instance;
};

struct _TestCache {
	FolksObjectCache parent_instance;
	TestCachePrivate * priv;
};

struct _TestCacheClass {
	FolksObjectCacheClass parent_class;
};

struct _ObjectCacheTests {
	FolksTestCase parent_instance;
	ObjectCacheTestsPrivate * priv;
};

struct _ObjectCacheTestsClass {
	FolksTestCaseClass parent_class;
};

struct _ObjectCacheTestsPrivate {
	GFile* _cache_dir;
};

struct _Block1Data {
	int _ref_count_;
	ObjectCacheTests * self;
	GMainLoop* main_loop;
	TestCache* cache;
};

struct _Block2Data {
	int _ref_count_;
	ObjectCacheTests * self;
	GMainLoop* main_loop;
	TestCache* cache;
};

struct _Block3Data {
	int _ref_count_;
	ObjectCacheTests * self;
	GMainLoop* main_loop;
	TestCache* cache;
	GeeSet* new_obj_set;
};

struct _Block4Data {
	int _ref_count_;
	ObjectCacheTests * self;
	GMainLoop* main_loop;
	TestCache* cache;
	GeeSet* new_obj_set;
};

struct _Block5Data {
	int _ref_count_;
	ObjectCacheTests * self;
	GMainLoop* main_loop;
	TestCache* cache;
	GeeSet* new_obj_set;
};

struct _Block6Data {
	int _ref_count_;
	ObjectCacheTests * self;
	GMainLoop* main_loop;
	TestCache* cache;
	GeeSet* new_obj_set;
};

struct _Block7Data {
	int _ref_count_;
	ObjectCacheTests * self;
	GMainLoop* main_loop;
	TestCache* cache;
	GeeSet* new_obj_set;
};

struct _Block8Data {
	int _ref_count_;
	ObjectCacheTests * self;
	GMainLoop* main_loop;
	TestCache* cache;
	GeeSet* new_obj_set;
};

struct _Block9Data {
	int _ref_count_;
	ObjectCacheTests * self;
	GMainLoop* main_loop;
	TestCache* cache;
	GeeSet* new_obj_set;
};

struct _Block10Data {
	int _ref_count_;
	ObjectCacheTests * self;
	GMainLoop* main_loop;
	TestCache* cache;
	GeeSet* new_obj_set;
};

struct _Block11Data {
	int _ref_count_;
	ObjectCacheTests * self;
	GMainLoop* main_loop;
	TestCache* cache;
	gint obj_count;
	GeeSet* new_obj_set;
};


static gpointer test_object_parent_class = NULL;
static gpointer test_cache_parent_class = NULL;
static gpointer object_cache_tests_parent_class = NULL;

gpointer test_object_ref (gpointer instance);
void test_object_unref (gpointer instance);
GParamSpec* param_spec_test_object (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_test_object (GValue* value, gpointer v_object);
void value_take_test_object (GValue* value, gpointer v_object);
gpointer value_get_test_object (const GValue* value);
GType test_object_get_type (void) G_GNUC_CONST;
#define TEST_OBJECT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_TEST_OBJECT, TestObjectPrivate))
enum  {
	TEST_OBJECT_DUMMY_PROPERTY
};
TestObject* test_object_new (const gchar* my_string, guint my_int);
TestObject* test_object_construct (GType object_type, const gchar* my_string, guint my_int);
void test_object_set_my_string (TestObject* self, const gchar* value);
void test_object_set_my_int (TestObject* self, guint value);
const gchar* test_object_get_my_string (TestObject* self);
guint test_object_get_my_int (TestObject* self);
static void test_object_finalize (TestObject* obj);
GType test_cache_get_type (void) G_GNUC_CONST;
enum  {
	TEST_CACHE_DUMMY_PROPERTY
};
TestCache* test_cache_new (const gchar* id);
TestCache* test_cache_construct (GType object_type, const gchar* id);
static GVariantType* test_cache_real_get_serialised_object_type (FolksObjectCache* base);
static guint8 test_cache_real_get_serialised_object_version (FolksObjectCache* base);
static GVariant* test_cache_real_serialise_object (FolksObjectCache* base, TestObject* obj);
static TestObject* test_cache_real_deserialise_object (FolksObjectCache* base, GVariant* variant);
GType object_cache_tests_get_type (void) G_GNUC_CONST;
#define OBJECT_CACHE_TESTS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_OBJECT_CACHE_TESTS, ObjectCacheTestsPrivate))
enum  {
	OBJECT_CACHE_TESTS_DUMMY_PROPERTY
};
ObjectCacheTests* object_cache_tests_new (void);
ObjectCacheTests* object_cache_tests_construct (GType object_type);
void object_cache_tests_test_create (ObjectCacheTests* self);
static void _object_cache_tests_test_create_folks_test_case_test_method (gpointer self);
void object_cache_tests_test_store_objects (ObjectCacheTests* self);
static void _object_cache_tests_test_store_objects_folks_test_case_test_method (gpointer self);
void object_cache_tests_test_store_objects_empty (ObjectCacheTests* self);
static void _object_cache_tests_test_store_objects_empty_folks_test_case_test_method (gpointer self);
void object_cache_tests_test_load_objects (ObjectCacheTests* self);
static void _object_cache_tests_test_load_objects_folks_test_case_test_method (gpointer self);
void object_cache_tests_test_load_objects_empty (ObjectCacheTests* self);
static void _object_cache_tests_test_load_objects_empty_folks_test_case_test_method (gpointer self);
void object_cache_tests_test_load_objects_nonexistent (ObjectCacheTests* self);
static void _object_cache_tests_test_load_objects_nonexistent_folks_test_case_test_method (gpointer self);
void object_cache_tests_test_clear (ObjectCacheTests* self);
static void _object_cache_tests_test_clear_folks_test_case_test_method (gpointer self);
void object_cache_tests_test_clear_empty (ObjectCacheTests* self);
static void _object_cache_tests_test_clear_empty_folks_test_case_test_method (gpointer self);
void object_cache_tests_test_clear_nonexistent (ObjectCacheTests* self);
static void _object_cache_tests_test_clear_nonexistent_folks_test_case_test_method (gpointer self);
void object_cache_tests_test_store_objects_cancellation (ObjectCacheTests* self);
static void _object_cache_tests_test_store_objects_cancellation_folks_test_case_test_method (gpointer self);
void object_cache_tests_test_load_objects_cancellation (ObjectCacheTests* self);
static void _object_cache_tests_test_load_objects_cancellation_folks_test_case_test_method (gpointer self);
void object_cache_tests_test_stress (ObjectCacheTests* self);
static void _object_cache_tests_test_stress_folks_test_case_test_method (gpointer self);
static void object_cache_tests_real_set_up (FolksTestCase* base);
void _object_cache_tests_delete_cache_directory (ObjectCacheTests* self);
static void object_cache_tests_real_tear_down (FolksTestCase* base);
void _object_cache_tests_delete_directory (ObjectCacheTests* self, GFile* dir, GError** error);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (Block1Data* _data1_);
static void _lambda0_ (GObject* o, GAsyncResult* r, Block1Data* _data1_);
static void __lambda0__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (Block2Data* _data2_);
static void _lambda1_ (GObject* o, GAsyncResult* r, Block2Data* _data2_);
static void __lambda1__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (Block3Data* _data3_);
static void _lambda2_ (GObject* o, GAsyncResult* r, Block3Data* _data3_);
static void __lambda2__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static void _lambda3_ (GObject* o, GAsyncResult* r, Block3Data* _data3_);
static void __lambda3__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static Block4Data* block4_data_ref (Block4Data* _data4_);
static void block4_data_unref (Block4Data* _data4_);
static void _lambda4_ (GObject* o, GAsyncResult* r, Block4Data* _data4_);
static void __lambda4__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static void _lambda5_ (GObject* o, GAsyncResult* r, Block4Data* _data4_);
static void __lambda5__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static Block5Data* block5_data_ref (Block5Data* _data5_);
static void block5_data_unref (Block5Data* _data5_);
static void _lambda6_ (GObject* o, GAsyncResult* r, Block5Data* _data5_);
static void __lambda6__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static Block6Data* block6_data_ref (Block6Data* _data6_);
static void block6_data_unref (Block6Data* _data6_);
static void _lambda7_ (GObject* o, GAsyncResult* r, Block6Data* _data6_);
static void __lambda7__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static void _lambda8_ (GObject* o, GAsyncResult* r, Block6Data* _data6_);
static void __lambda8__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static void _lambda9_ (GObject* o, GAsyncResult* r, Block6Data* _data6_);
static void __lambda9__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static Block7Data* block7_data_ref (Block7Data* _data7_);
static void block7_data_unref (Block7Data* _data7_);
static void _lambda10_ (GObject* o, GAsyncResult* r, Block7Data* _data7_);
static void __lambda10__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static void _lambda11_ (GObject* o, GAsyncResult* r, Block7Data* _data7_);
static void __lambda11__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static void _lambda12_ (GObject* o, GAsyncResult* r, Block7Data* _data7_);
static void __lambda12__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static Block8Data* block8_data_ref (Block8Data* _data8_);
static void block8_data_unref (Block8Data* _data8_);
static void _lambda13_ (GObject* o, GAsyncResult* r, Block8Data* _data8_);
static void __lambda13__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static void _lambda14_ (GObject* o, GAsyncResult* r, Block8Data* _data8_);
static void __lambda14__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static Block9Data* block9_data_ref (Block9Data* _data9_);
static void block9_data_unref (Block9Data* _data9_);
static void _lambda15_ (GObject* o, GAsyncResult* r, Block9Data* _data9_);
static void __lambda15__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static void _lambda16_ (GObject* o, GAsyncResult* r, Block9Data* _data9_);
static void __lambda16__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static Block10Data* block10_data_ref (Block10Data* _data10_);
static void block10_data_unref (Block10Data* _data10_);
static void _lambda17_ (GObject* o, GAsyncResult* r, Block10Data* _data10_);
static void __lambda17__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static void _lambda18_ (GObject* o, GAsyncResult* r, Block10Data* _data10_);
static void __lambda18__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static Block11Data* block11_data_ref (Block11Data* _data11_);
static void block11_data_unref (Block11Data* _data11_);
static void _lambda19_ (GObject* o, GAsyncResult* r, Block11Data* _data11_);
static void __lambda19__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static void _lambda20_ (GObject* o, GAsyncResult* r, Block11Data* _data11_);
static void __lambda20__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static void object_cache_tests_finalize (GObject* obj);
gint _vala_main (gchar** args, int args_length1);
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);


TestObject* test_object_construct (GType object_type, const gchar* my_string, guint my_int) {
	TestObject* self = NULL;
	const gchar* _tmp0_;
	guint _tmp1_;
	g_return_val_if_fail (my_string != NULL, NULL);
	self = (TestObject*) g_type_create_instance (object_type);
	_tmp0_ = my_string;
	test_object_set_my_string (self, _tmp0_);
	_tmp1_ = my_int;
	test_object_set_my_int (self, _tmp1_);
	return self;
}


TestObject* test_object_new (const gchar* my_string, guint my_int) {
	return test_object_construct (TYPE_TEST_OBJECT, my_string, my_int);
}


const gchar* test_object_get_my_string (TestObject* self) {
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_my_string;
	result = _tmp0_;
	return result;
}


void test_object_set_my_string (TestObject* self, const gchar* value) {
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (self->priv->_my_string);
	self->priv->_my_string = _tmp1_;
}


guint test_object_get_my_int (TestObject* self) {
	guint result;
	guint _tmp0_;
	g_return_val_if_fail (self != NULL, 0U);
	_tmp0_ = self->priv->_my_int;
	result = _tmp0_;
	return result;
}


void test_object_set_my_int (TestObject* self, guint value) {
	guint _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_my_int = _tmp0_;
}


static void value_test_object_init (GValue* value) {
	value->data[0].v_pointer = NULL;
}


static void value_test_object_free_value (GValue* value) {
	if (value->data[0].v_pointer) {
		test_object_unref (value->data[0].v_pointer);
	}
}


static void value_test_object_copy_value (const GValue* src_value, GValue* dest_value) {
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = test_object_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}


static gpointer value_test_object_peek_pointer (const GValue* value) {
	return value->data[0].v_pointer;
}


static gchar* value_test_object_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	if (collect_values[0].v_pointer) {
		TestObject* object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = test_object_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}


static gchar* value_test_object_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	TestObject** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = test_object_ref (value->data[0].v_pointer);
	}
	return NULL;
}


GParamSpec* param_spec_test_object (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	ParamSpecTestObject* spec;
	g_return_val_if_fail (g_type_is_a (object_type, TYPE_TEST_OBJECT), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}


gpointer value_get_test_object (const GValue* value) {
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_TEST_OBJECT), NULL);
	return value->data[0].v_pointer;
}


void value_set_test_object (GValue* value, gpointer v_object) {
	TestObject* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_TEST_OBJECT));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_TEST_OBJECT));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		test_object_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		test_object_unref (old);
	}
}


void value_take_test_object (GValue* value, gpointer v_object) {
	TestObject* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_TEST_OBJECT));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_TEST_OBJECT));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		test_object_unref (old);
	}
}


static void test_object_class_init (TestObjectClass * klass) {
	test_object_parent_class = g_type_class_peek_parent (klass);
	TEST_OBJECT_CLASS (klass)->finalize = test_object_finalize;
	g_type_class_add_private (klass, sizeof (TestObjectPrivate));
}


static void test_object_instance_init (TestObject * self) {
	self->priv = TEST_OBJECT_GET_PRIVATE (self);
	self->ref_count = 1;
}


static void test_object_finalize (TestObject* obj) {
	TestObject * self;
	self = TEST_OBJECT (obj);
	_g_free0 (self->priv->_my_string);
}


GType test_object_get_type (void) {
	static volatile gsize test_object_type_id__volatile = 0;
	if (g_once_init_enter (&test_object_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { value_test_object_init, value_test_object_free_value, value_test_object_copy_value, value_test_object_peek_pointer, "p", value_test_object_collect_value, "p", value_test_object_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (TestObjectClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) test_object_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TestObject), 0, (GInstanceInitFunc) test_object_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType test_object_type_id;
		test_object_type_id = g_type_register_fundamental (g_type_fundamental_next (), "TestObject", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&test_object_type_id__volatile, test_object_type_id);
	}
	return test_object_type_id__volatile;
}


gpointer test_object_ref (gpointer instance) {
	TestObject* self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}


void test_object_unref (gpointer instance) {
	TestObject* self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		TEST_OBJECT_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}


TestCache* test_cache_construct (GType object_type, const gchar* id) {
	TestCache * self = NULL;
	const gchar* _tmp0_;
	g_return_val_if_fail (id != NULL, NULL);
	_tmp0_ = id;
	self = (TestCache*) folks_object_cache_construct (object_type, TYPE_TEST_OBJECT, (GBoxedCopyFunc) test_object_ref, test_object_unref, "test", _tmp0_);
	return self;
}


TestCache* test_cache_new (const gchar* id) {
	return test_cache_construct (TYPE_TEST_CACHE, id);
}


static gpointer _g_variant_type_copy0 (gpointer self) {
	return self ? g_variant_type_copy (self) : NULL;
}


static GVariantType* test_cache_real_get_serialised_object_type (FolksObjectCache* base) {
	TestCache * self;
	GVariantType* result = NULL;
	const GVariantType* _tmp0_;
	GVariantType* _tmp1_;
	const GVariantType* _tmp2_;
	GVariantType* _tmp3_;
	GVariantType** _tmp4_ = NULL;
	GVariantType** _tmp5_;
	gint _tmp5__length1;
	GVariantType* _tmp6_;
	GVariantType* _tmp7_;
	self = (TestCache*) base;
	_tmp0_ = G_VARIANT_TYPE_STRING;
	_tmp1_ = _g_variant_type_copy0 (_tmp0_);
	_tmp2_ = G_VARIANT_TYPE_UINT32;
	_tmp3_ = _g_variant_type_copy0 (_tmp2_);
	_tmp4_ = g_new0 (GVariantType*, 2 + 1);
	_tmp4_[0] = _tmp1_;
	_tmp4_[1] = _tmp3_;
	_tmp5_ = _tmp4_;
	_tmp5__length1 = 2;
	_tmp6_ = g_variant_type_new_tuple (_tmp5_, 2);
	_tmp7_ = _tmp6_;
	_tmp5_ = (_vala_array_free (_tmp5_, _tmp5__length1, (GDestroyNotify) g_variant_type_free), NULL);
	result = _tmp7_;
	return result;
}


static guint8 test_cache_real_get_serialised_object_version (FolksObjectCache* base) {
	TestCache * self;
	guint8 result = 0U;
	self = (TestCache*) base;
	result = (guint8) 1;
	return result;
}


static GVariant* test_cache_real_serialise_object (FolksObjectCache* base, TestObject* obj) {
	TestCache * self;
	GVariant* result = NULL;
	TestObject* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	GVariant* _tmp3_;
	GVariant* _tmp4_;
	TestObject* _tmp5_;
	guint _tmp6_;
	guint _tmp7_;
	GVariant* _tmp8_;
	GVariant* _tmp9_;
	GVariant** _tmp10_ = NULL;
	GVariant** _tmp11_;
	gint _tmp11__length1;
	GVariant* _tmp12_;
	GVariant* _tmp13_;
	GVariant* _tmp14_;
	self = (TestCache*) base;
	g_return_val_if_fail (obj != NULL, NULL);
	_tmp0_ = obj;
	_tmp1_ = test_object_get_my_string (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_variant_new_string (_tmp2_);
	_tmp4_ = g_variant_ref_sink (_tmp3_);
	_tmp5_ = obj;
	_tmp6_ = test_object_get_my_int (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = g_variant_new_uint32 ((guint32) _tmp7_);
	_tmp9_ = g_variant_ref_sink (_tmp8_);
	_tmp10_ = g_new0 (GVariant*, 2 + 1);
	_tmp10_[0] = _tmp4_;
	_tmp10_[1] = _tmp9_;
	_tmp11_ = _tmp10_;
	_tmp11__length1 = 2;
	_tmp12_ = g_variant_new_tuple (_tmp11_, 2);
	_tmp13_ = g_variant_ref_sink (_tmp12_);
	_tmp14_ = _tmp13_;
	_tmp11_ = (_vala_array_free (_tmp11_, _tmp11__length1, (GDestroyNotify) g_variant_unref), NULL);
	result = _tmp14_;
	return result;
}


static TestObject* test_cache_real_deserialise_object (FolksObjectCache* base, GVariant* variant) {
	TestCache * self;
	TestObject* result = NULL;
	GVariant* _tmp0_;
	GVariant* _tmp1_ = NULL;
	GVariant* _tmp2_;
	const gchar* _tmp3_ = NULL;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* my_string;
	GVariant* _tmp6_;
	GVariant* _tmp7_ = NULL;
	GVariant* _tmp8_;
	guint32 _tmp9_ = 0U;
	guint32 _tmp10_;
	guint32 my_int;
	const gchar* _tmp11_;
	guint32 _tmp12_;
	TestObject* _tmp13_;
	self = (TestCache*) base;
	g_return_val_if_fail (variant != NULL, NULL);
	_tmp0_ = variant;
	_tmp1_ = g_variant_get_child_value (_tmp0_, (gsize) 0);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_variant_get_string (_tmp2_, NULL);
	_tmp4_ = g_strdup (_tmp3_);
	_tmp5_ = _tmp4_;
	_g_variant_unref0 (_tmp2_);
	my_string = _tmp5_;
	_tmp6_ = variant;
	_tmp7_ = g_variant_get_child_value (_tmp6_, (gsize) 1);
	_tmp8_ = _tmp7_;
	_tmp9_ = g_variant_get_uint32 (_tmp8_);
	_tmp10_ = _tmp9_;
	_g_variant_unref0 (_tmp8_);
	my_int = _tmp10_;
	_tmp11_ = my_string;
	_tmp12_ = my_int;
	_tmp13_ = test_object_new (_tmp11_, (guint) _tmp12_);
	result = _tmp13_;
	_g_free0 (my_string);
	return result;
}


static void test_cache_class_init (TestCacheClass * klass) {
	test_cache_parent_class = g_type_class_peek_parent (klass);
	FOLKS_OBJECT_CACHE_CLASS (klass)->get_serialised_object_type = test_cache_real_get_serialised_object_type;
	FOLKS_OBJECT_CACHE_CLASS (klass)->get_serialised_object_version = test_cache_real_get_serialised_object_version;
	FOLKS_OBJECT_CACHE_CLASS (klass)->serialise_object = test_cache_real_serialise_object;
	FOLKS_OBJECT_CACHE_CLASS (klass)->deserialise_object = test_cache_real_deserialise_object;
}


static void test_cache_instance_init (TestCache * self) {
}


GType test_cache_get_type (void) {
	static volatile gsize test_cache_type_id__volatile = 0;
	if (g_once_init_enter (&test_cache_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (TestCacheClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) test_cache_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TestCache), 0, (GInstanceInitFunc) test_cache_instance_init, NULL };
		GType test_cache_type_id;
		test_cache_type_id = g_type_register_static (FOLKS_TYPE_OBJECT_CACHE, "TestCache", &g_define_type_info, 0);
		g_once_init_leave (&test_cache_type_id__volatile, test_cache_type_id);
	}
	return test_cache_type_id__volatile;
}


static void _object_cache_tests_test_create_folks_test_case_test_method (gpointer self) {
	object_cache_tests_test_create (self);
}


static void _object_cache_tests_test_store_objects_folks_test_case_test_method (gpointer self) {
	object_cache_tests_test_store_objects (self);
}


static void _object_cache_tests_test_store_objects_empty_folks_test_case_test_method (gpointer self) {
	object_cache_tests_test_store_objects_empty (self);
}


static void _object_cache_tests_test_load_objects_folks_test_case_test_method (gpointer self) {
	object_cache_tests_test_load_objects (self);
}


static void _object_cache_tests_test_load_objects_empty_folks_test_case_test_method (gpointer self) {
	object_cache_tests_test_load_objects_empty (self);
}


static void _object_cache_tests_test_load_objects_nonexistent_folks_test_case_test_method (gpointer self) {
	object_cache_tests_test_load_objects_nonexistent (self);
}


static void _object_cache_tests_test_clear_folks_test_case_test_method (gpointer self) {
	object_cache_tests_test_clear (self);
}


static void _object_cache_tests_test_clear_empty_folks_test_case_test_method (gpointer self) {
	object_cache_tests_test_clear_empty (self);
}


static void _object_cache_tests_test_clear_nonexistent_folks_test_case_test_method (gpointer self) {
	object_cache_tests_test_clear_nonexistent (self);
}


static void _object_cache_tests_test_store_objects_cancellation_folks_test_case_test_method (gpointer self) {
	object_cache_tests_test_store_objects_cancellation (self);
}


static void _object_cache_tests_test_load_objects_cancellation_folks_test_case_test_method (gpointer self) {
	object_cache_tests_test_load_objects_cancellation (self);
}


static void _object_cache_tests_test_stress_folks_test_case_test_method (gpointer self) {
	object_cache_tests_test_stress (self);
}


ObjectCacheTests* object_cache_tests_construct (GType object_type) {
	ObjectCacheTests * self = NULL;
	const gchar* _tmp0_ = NULL;
	GFile* _tmp1_ = NULL;
	GFile* _tmp2_;
	GFile* _tmp3_ = NULL;
	self = (ObjectCacheTests*) folks_test_case_construct (object_type, "ObjectCache");
	_tmp0_ = g_get_tmp_dir ();
	_tmp1_ = g_file_new_for_path (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_file_get_child (_tmp2_, "folks-object-cache-tests");
	_g_object_unref0 (self->priv->_cache_dir);
	self->priv->_cache_dir = _tmp3_;
	_g_object_unref0 (_tmp2_);
	folks_test_case_add_test ((FolksTestCase*) self, "create", _object_cache_tests_test_create_folks_test_case_test_method, self);
	folks_test_case_add_test ((FolksTestCase*) self, "store-objects", _object_cache_tests_test_store_objects_folks_test_case_test_method, self);
	folks_test_case_add_test ((FolksTestCase*) self, "store-objects-empty", _object_cache_tests_test_store_objects_empty_folks_test_case_test_method, self);
	folks_test_case_add_test ((FolksTestCase*) self, "load-objects", _object_cache_tests_test_load_objects_folks_test_case_test_method, self);
	folks_test_case_add_test ((FolksTestCase*) self, "load-objects-empty", _object_cache_tests_test_load_objects_empty_folks_test_case_test_method, self);
	folks_test_case_add_test ((FolksTestCase*) self, "load-objects-nonexistent", _object_cache_tests_test_load_objects_nonexistent_folks_test_case_test_method, self);
	folks_test_case_add_test ((FolksTestCase*) self, "clear", _object_cache_tests_test_clear_folks_test_case_test_method, self);
	folks_test_case_add_test ((FolksTestCase*) self, "clear-empty", _object_cache_tests_test_clear_empty_folks_test_case_test_method, self);
	folks_test_case_add_test ((FolksTestCase*) self, "clear-nonexistent", _object_cache_tests_test_clear_nonexistent_folks_test_case_test_method, self);
	folks_test_case_add_test ((FolksTestCase*) self, "store-objects-cancellation", _object_cache_tests_test_store_objects_cancellation_folks_test_case_test_method, self);
	folks_test_case_add_test ((FolksTestCase*) self, "load-objects-cancellation", _object_cache_tests_test_load_objects_cancellation_folks_test_case_test_method, self);
	folks_test_case_add_test ((FolksTestCase*) self, "stress", _object_cache_tests_test_stress_folks_test_case_test_method, self);
	return self;
}


ObjectCacheTests* object_cache_tests_new (void) {
	return object_cache_tests_construct (TYPE_OBJECT_CACHE_TESTS);
}


static void object_cache_tests_real_set_up (FolksTestCase* base) {
	ObjectCacheTests * self;
	GFile* _tmp0_;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_;
	self = (ObjectCacheTests*) base;
	_object_cache_tests_delete_cache_directory (self);
	_tmp0_ = self->priv->_cache_dir;
	_tmp1_ = g_file_get_path (_tmp0_);
	_tmp2_ = _tmp1_;
	g_setenv ("XDG_CACHE_HOME", _tmp2_, TRUE);
	_g_free0 (_tmp2_);
}


static void object_cache_tests_real_tear_down (FolksTestCase* base) {
	ObjectCacheTests * self;
	self = (ObjectCacheTests*) base;
	_object_cache_tests_delete_cache_directory (self);
}


void _object_cache_tests_delete_directory (ObjectCacheTests* self, GFile* dir, GError** error) {
	GFile* _tmp0_;
	GFileEnumerator* _tmp1_ = NULL;
	GFileEnumerator* enumerator;
	GFileEnumerator* _tmp2_;
	GFileInfo* _tmp3_ = NULL;
	GFileInfo* file_info;
	GFileEnumerator* _tmp17_;
	GFile* _tmp18_;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (dir != NULL);
	_tmp0_ = dir;
	_tmp1_ = g_file_enumerate_children (_tmp0_, G_FILE_ATTRIBUTE_STANDARD_NAME, G_FILE_QUERY_INFO_NONE, NULL, &_inner_error_);
	enumerator = _tmp1_;
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return;
	}
	_tmp2_ = enumerator;
	_tmp3_ = g_file_enumerator_next_file (_tmp2_, NULL, &_inner_error_);
	file_info = _tmp3_;
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		_g_object_unref0 (enumerator);
		return;
	}
	while (TRUE) {
		GFileInfo* _tmp4_;
		GFile* _tmp5_;
		GFileInfo* _tmp6_;
		const gchar* _tmp7_ = NULL;
		GFile* _tmp8_ = NULL;
		GFile* child_file;
		GFile* _tmp9_;
		GFileType _tmp10_ = 0;
		GFileEnumerator* _tmp13_;
		GFileInfo* _tmp14_ = NULL;
		GFileInfo* _tmp15_;
		GFileInfo* _tmp16_;
		_tmp4_ = file_info;
		if (!(_tmp4_ != NULL)) {
			break;
		}
		_tmp5_ = dir;
		_tmp6_ = file_info;
		_tmp7_ = g_file_info_get_name (_tmp6_);
		_tmp8_ = g_file_get_child (_tmp5_, _tmp7_);
		child_file = _tmp8_;
		_tmp9_ = child_file;
		_tmp10_ = g_file_query_file_type (_tmp9_, G_FILE_QUERY_INFO_NONE, NULL);
		if (_tmp10_ == G_FILE_TYPE_DIRECTORY) {
			GFile* _tmp11_;
			_tmp11_ = child_file;
			_object_cache_tests_delete_directory (self, _tmp11_, &_inner_error_);
			if (_inner_error_ != NULL) {
				g_propagate_error (error, _inner_error_);
				_g_object_unref0 (child_file);
				_g_object_unref0 (file_info);
				_g_object_unref0 (enumerator);
				return;
			}
		} else {
			GFile* _tmp12_;
			_tmp12_ = child_file;
			g_file_delete (_tmp12_, NULL, &_inner_error_);
			if (_inner_error_ != NULL) {
				g_propagate_error (error, _inner_error_);
				_g_object_unref0 (child_file);
				_g_object_unref0 (file_info);
				_g_object_unref0 (enumerator);
				return;
			}
		}
		_tmp13_ = enumerator;
		_tmp14_ = g_file_enumerator_next_file (_tmp13_, NULL, &_inner_error_);
		_tmp15_ = _tmp14_;
		if (_inner_error_ != NULL) {
			g_propagate_error (error, _inner_error_);
			_g_object_unref0 (child_file);
			_g_object_unref0 (file_info);
			_g_object_unref0 (enumerator);
			return;
		}
		_tmp16_ = _tmp15_;
		_g_object_unref0 (file_info);
		file_info = _tmp16_;
		_g_object_unref0 (child_file);
	}
	_tmp17_ = enumerator;
	g_file_enumerator_close (_tmp17_, NULL, &_inner_error_);
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		_g_object_unref0 (file_info);
		_g_object_unref0 (enumerator);
		return;
	}
	_tmp18_ = dir;
	g_file_delete (_tmp18_, NULL, &_inner_error_);
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		_g_object_unref0 (file_info);
		_g_object_unref0 (enumerator);
		return;
	}
	_g_object_unref0 (file_info);
	_g_object_unref0 (enumerator);
}


void _object_cache_tests_delete_cache_directory (ObjectCacheTests* self) {
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	{
		GFile* _tmp0_;
		_tmp0_ = self->priv->_cache_dir;
		_object_cache_tests_delete_directory (self, _tmp0_, &_inner_error_);
		if (_inner_error_ != NULL) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		_g_error_free0 (e);
	}
	__finally0:
	if (_inner_error_ != NULL) {
		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);
		g_clear_error (&_inner_error_);
		return;
	}
}


void object_cache_tests_test_create (ObjectCacheTests* self) {
	TestCache* _tmp0_;
	TestCache* cache;
	TestCache* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = test_cache_new ("test-create");
	cache = _tmp0_;
	_tmp1_ = cache;
	g_assert (_tmp1_ != NULL);
	_g_object_unref0 (cache);
}


static Block1Data* block1_data_ref (Block1Data* _data1_) {
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}


static void block1_data_unref (Block1Data* _data1_) {
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		_g_object_unref0 (_data1_->self);
		_g_object_unref0 (_data1_->cache);
		_g_main_loop_unref0 (_data1_->main_loop);
		g_slice_free (Block1Data, _data1_);
	}
}


static void _lambda0_ (GObject* o, GAsyncResult* r, Block1Data* _data1_) {
	ObjectCacheTests * self;
	TestCache* _tmp0_;
	GAsyncResult* _tmp1_;
	GMainLoop* _tmp2_;
	self = _data1_->self;
	g_return_if_fail (r != NULL);
	_tmp0_ = _data1_->cache;
	_tmp1_ = r;
	folks_object_cache_store_objects_finish ((FolksObjectCache*) _tmp0_, _tmp1_);
	_tmp2_ = _data1_->main_loop;
	g_main_loop_quit (_tmp2_);
}


static void __lambda0__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	_lambda0_ (source_object, res, self);
	block1_data_unref (self);
}


void object_cache_tests_test_store_objects (ObjectCacheTests* self) {
	Block1Data* _data1_;
	GMainLoop* _tmp0_;
	TestCache* _tmp1_;
	GeeHashSet* _tmp2_;
	GeeHashSet* obj_set;
	GeeHashSet* _tmp3_;
	TestObject* _tmp4_;
	TestObject* _tmp5_;
	GeeHashSet* _tmp6_;
	TestObject* _tmp7_;
	TestObject* _tmp8_;
	GeeHashSet* _tmp9_;
	TestObject* _tmp10_;
	TestObject* _tmp11_;
	GeeHashSet* _tmp12_;
	TestObject* _tmp13_;
	TestObject* _tmp14_;
	TestCache* _tmp15_;
	GeeHashSet* _tmp16_;
	GMainLoop* _tmp17_;
	g_return_if_fail (self != NULL);
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	_data1_->self = g_object_ref (self);
	_tmp0_ = g_main_loop_new (NULL, FALSE);
	_data1_->main_loop = _tmp0_;
	_tmp1_ = test_cache_new ("test-store-objects");
	_data1_->cache = _tmp1_;
	_tmp2_ = gee_hash_set_new (TYPE_TEST_OBJECT, (GBoxedCopyFunc) test_object_ref, test_object_unref, NULL, NULL);
	obj_set = _tmp2_;
	_tmp3_ = obj_set;
	_tmp4_ = test_object_new ("Foo", (guint) 1);
	_tmp5_ = _tmp4_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp3_, _tmp5_);
	_test_object_unref0 (_tmp5_);
	_tmp6_ = obj_set;
	_tmp7_ = test_object_new ("Bar", (guint) 2);
	_tmp8_ = _tmp7_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp6_, _tmp8_);
	_test_object_unref0 (_tmp8_);
	_tmp9_ = obj_set;
	_tmp10_ = test_object_new ("De", (guint) 3);
	_tmp11_ = _tmp10_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp9_, _tmp11_);
	_test_object_unref0 (_tmp11_);
	_tmp12_ = obj_set;
	_tmp13_ = test_object_new ("Baz", (guint) 4);
	_tmp14_ = _tmp13_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp12_, _tmp14_);
	_test_object_unref0 (_tmp14_);
	_tmp15_ = _data1_->cache;
	_tmp16_ = obj_set;
	folks_object_cache_store_objects ((FolksObjectCache*) _tmp15_, (GeeSet*) _tmp16_, NULL, __lambda0__gasync_ready_callback, block1_data_ref (_data1_));
	_tmp17_ = _data1_->main_loop;
	g_main_loop_run (_tmp17_);
	_g_object_unref0 (obj_set);
	block1_data_unref (_data1_);
	_data1_ = NULL;
}


static Block2Data* block2_data_ref (Block2Data* _data2_) {
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}


static void block2_data_unref (Block2Data* _data2_) {
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		_g_object_unref0 (_data2_->self);
		_g_object_unref0 (_data2_->cache);
		_g_main_loop_unref0 (_data2_->main_loop);
		g_slice_free (Block2Data, _data2_);
	}
}


static void _lambda1_ (GObject* o, GAsyncResult* r, Block2Data* _data2_) {
	ObjectCacheTests * self;
	TestCache* _tmp0_;
	GAsyncResult* _tmp1_;
	GMainLoop* _tmp2_;
	self = _data2_->self;
	g_return_if_fail (r != NULL);
	_tmp0_ = _data2_->cache;
	_tmp1_ = r;
	folks_object_cache_store_objects_finish ((FolksObjectCache*) _tmp0_, _tmp1_);
	_tmp2_ = _data2_->main_loop;
	g_main_loop_quit (_tmp2_);
}


static void __lambda1__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	_lambda1_ (source_object, res, self);
	block2_data_unref (self);
}


void object_cache_tests_test_store_objects_empty (ObjectCacheTests* self) {
	Block2Data* _data2_;
	GMainLoop* _tmp0_;
	TestCache* _tmp1_;
	TestCache* _tmp2_;
	GeeHashSet* _tmp3_;
	GeeHashSet* _tmp4_;
	GMainLoop* _tmp5_;
	g_return_if_fail (self != NULL);
	_data2_ = g_slice_new0 (Block2Data);
	_data2_->_ref_count_ = 1;
	_data2_->self = g_object_ref (self);
	_tmp0_ = g_main_loop_new (NULL, FALSE);
	_data2_->main_loop = _tmp0_;
	_tmp1_ = test_cache_new ("test-store-objects-empty");
	_data2_->cache = _tmp1_;
	_tmp2_ = _data2_->cache;
	_tmp3_ = gee_hash_set_new (TYPE_TEST_OBJECT, (GBoxedCopyFunc) test_object_ref, test_object_unref, NULL, NULL);
	_tmp4_ = _tmp3_;
	folks_object_cache_store_objects ((FolksObjectCache*) _tmp2_, (GeeSet*) _tmp4_, NULL, __lambda1__gasync_ready_callback, block2_data_ref (_data2_));
	_g_object_unref0 (_tmp4_);
	_tmp5_ = _data2_->main_loop;
	g_main_loop_run (_tmp5_);
	block2_data_unref (_data2_);
	_data2_ = NULL;
}


static Block3Data* block3_data_ref (Block3Data* _data3_) {
	g_atomic_int_inc (&_data3_->_ref_count_);
	return _data3_;
}


static void block3_data_unref (Block3Data* _data3_) {
	if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
		_g_object_unref0 (_data3_->self);
		_g_object_unref0 (_data3_->new_obj_set);
		_g_object_unref0 (_data3_->cache);
		_g_main_loop_unref0 (_data3_->main_loop);
		g_slice_free (Block3Data, _data3_);
	}
}


static void _lambda2_ (GObject* o, GAsyncResult* r, Block3Data* _data3_) {
	ObjectCacheTests * self;
	TestCache* _tmp0_;
	GAsyncResult* _tmp1_;
	GMainLoop* _tmp2_;
	self = _data3_->self;
	g_return_if_fail (r != NULL);
	_tmp0_ = _data3_->cache;
	_tmp1_ = r;
	folks_object_cache_store_objects_finish ((FolksObjectCache*) _tmp0_, _tmp1_);
	_tmp2_ = _data3_->main_loop;
	g_main_loop_quit (_tmp2_);
}


static void __lambda2__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	_lambda2_ (source_object, res, self);
	block3_data_unref (self);
}


static void _lambda3_ (GObject* o, GAsyncResult* r, Block3Data* _data3_) {
	ObjectCacheTests * self;
	TestCache* _tmp0_;
	GAsyncResult* _tmp1_;
	GeeSet* _tmp2_ = NULL;
	GMainLoop* _tmp3_;
	self = _data3_->self;
	g_return_if_fail (r != NULL);
	_tmp0_ = _data3_->cache;
	_tmp1_ = r;
	_tmp2_ = folks_object_cache_load_objects_finish ((FolksObjectCache*) _tmp0_, _tmp1_);
	_g_object_unref0 (_data3_->new_obj_set);
	_data3_->new_obj_set = _tmp2_;
	_tmp3_ = _data3_->main_loop;
	g_main_loop_quit (_tmp3_);
}


static void __lambda3__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	_lambda3_ (source_object, res, self);
	block3_data_unref (self);
}


void object_cache_tests_test_load_objects (ObjectCacheTests* self) {
	Block3Data* _data3_;
	GMainLoop* _tmp0_;
	TestCache* _tmp1_;
	TestObject* _tmp2_;
	TestObject* obj1;
	TestObject* _tmp3_;
	TestObject* obj2;
	GeeHashSet* _tmp4_;
	GeeHashSet* obj_set;
	GeeHashSet* _tmp5_;
	TestObject* _tmp6_;
	GeeHashSet* _tmp7_;
	TestObject* _tmp8_;
	TestCache* _tmp9_;
	GeeHashSet* _tmp10_;
	GMainLoop* _tmp11_;
	TestCache* _tmp12_;
	GMainLoop* _tmp13_;
	GeeSet* _tmp14_;
	GeeSet* _tmp15_;
	gint _tmp16_;
	gint _tmp17_;
	GeeHashSet* _tmp18_;
	gint _tmp19_;
	gint _tmp20_;
	GeeHashSet* _tmp50_;
	gint _tmp51_;
	gint _tmp52_;
	g_return_if_fail (self != NULL);
	_data3_ = g_slice_new0 (Block3Data);
	_data3_->_ref_count_ = 1;
	_data3_->self = g_object_ref (self);
	_tmp0_ = g_main_loop_new (NULL, FALSE);
	_data3_->main_loop = _tmp0_;
	_tmp1_ = test_cache_new ("test-load-objects");
	_data3_->cache = _tmp1_;
	_tmp2_ = test_object_new ("Foo", (guint) 1);
	obj1 = _tmp2_;
	_tmp3_ = test_object_new ("Bar", (guint) 2);
	obj2 = _tmp3_;
	_tmp4_ = gee_hash_set_new (TYPE_TEST_OBJECT, (GBoxedCopyFunc) test_object_ref, test_object_unref, NULL, NULL);
	obj_set = _tmp4_;
	_tmp5_ = obj_set;
	_tmp6_ = obj1;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp5_, _tmp6_);
	_tmp7_ = obj_set;
	_tmp8_ = obj2;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp7_, _tmp8_);
	_tmp9_ = _data3_->cache;
	_tmp10_ = obj_set;
	folks_object_cache_store_objects ((FolksObjectCache*) _tmp9_, (GeeSet*) _tmp10_, NULL, __lambda2__gasync_ready_callback, block3_data_ref (_data3_));
	_tmp11_ = _data3_->main_loop;
	g_main_loop_run (_tmp11_);
	_data3_->new_obj_set = NULL;
	_tmp12_ = _data3_->cache;
	folks_object_cache_load_objects ((FolksObjectCache*) _tmp12_, NULL, __lambda3__gasync_ready_callback, block3_data_ref (_data3_));
	_tmp13_ = _data3_->main_loop;
	g_main_loop_run (_tmp13_);
	_tmp14_ = _data3_->new_obj_set;
	g_assert (_tmp14_ != NULL);
	_tmp15_ = _data3_->new_obj_set;
	_tmp16_ = gee_collection_get_size ((GeeCollection*) _tmp15_);
	_tmp17_ = _tmp16_;
	_tmp18_ = obj_set;
	_tmp19_ = gee_collection_get_size ((GeeCollection*) _tmp18_);
	_tmp20_ = _tmp19_;
	g_assert (_tmp17_ == _tmp20_);
	{
		GeeSet* _tmp21_;
		GeeIterator* _tmp22_ = NULL;
		GeeIterator* _new_obj_it;
		_tmp21_ = _data3_->new_obj_set;
		_tmp22_ = gee_iterable_iterator ((GeeIterable*) _tmp21_);
		_new_obj_it = _tmp22_;
		while (TRUE) {
			GeeIterator* _tmp23_;
			gboolean _tmp24_ = FALSE;
			GeeIterator* _tmp25_;
			gpointer _tmp26_ = NULL;
			TestObject* new_obj;
			gboolean partner_found;
			gboolean _tmp49_;
			_tmp23_ = _new_obj_it;
			_tmp24_ = gee_iterator_next (_tmp23_);
			if (!_tmp24_) {
				break;
			}
			_tmp25_ = _new_obj_it;
			_tmp26_ = gee_iterator_get (_tmp25_);
			new_obj = (TestObject*) _tmp26_;
			partner_found = FALSE;
			{
				GeeHashSet* _tmp27_;
				GeeIterator* _tmp28_ = NULL;
				GeeIterator* _original_obj_it;
				_tmp27_ = obj_set;
				_tmp28_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) _tmp27_);
				_original_obj_it = _tmp28_;
				while (TRUE) {
					GeeIterator* _tmp29_;
					gboolean _tmp30_ = FALSE;
					GeeIterator* _tmp31_;
					gpointer _tmp32_ = NULL;
					TestObject* original_obj;
					gboolean _tmp33_ = FALSE;
					TestObject* _tmp34_;
					const gchar* _tmp35_;
					const gchar* _tmp36_;
					TestObject* _tmp37_;
					const gchar* _tmp38_;
					const gchar* _tmp39_;
					gboolean _tmp46_;
					_tmp29_ = _original_obj_it;
					_tmp30_ = gee_iterator_next (_tmp29_);
					if (!_tmp30_) {
						break;
					}
					_tmp31_ = _original_obj_it;
					_tmp32_ = gee_iterator_get (_tmp31_);
					original_obj = (TestObject*) _tmp32_;
					_tmp34_ = new_obj;
					_tmp35_ = test_object_get_my_string (_tmp34_);
					_tmp36_ = _tmp35_;
					_tmp37_ = original_obj;
					_tmp38_ = test_object_get_my_string (_tmp37_);
					_tmp39_ = _tmp38_;
					if (g_strcmp0 (_tmp36_, _tmp39_) == 0) {
						TestObject* _tmp40_;
						guint _tmp41_;
						guint _tmp42_;
						TestObject* _tmp43_;
						guint _tmp44_;
						guint _tmp45_;
						_tmp40_ = new_obj;
						_tmp41_ = test_object_get_my_int (_tmp40_);
						_tmp42_ = _tmp41_;
						_tmp43_ = original_obj;
						_tmp44_ = test_object_get_my_int (_tmp43_);
						_tmp45_ = _tmp44_;
						_tmp33_ = _tmp42_ == _tmp45_;
					} else {
						_tmp33_ = FALSE;
					}
					_tmp46_ = _tmp33_;
					if (_tmp46_) {
						GeeHashSet* _tmp47_;
						TestObject* _tmp48_;
						_tmp47_ = obj_set;
						_tmp48_ = original_obj;
						gee_abstract_collection_remove ((GeeAbstractCollection*) _tmp47_, _tmp48_);
						partner_found = TRUE;
						_test_object_unref0 (original_obj);
						break;
					}
					_test_object_unref0 (original_obj);
				}
				_g_object_unref0 (_original_obj_it);
			}
			_tmp49_ = partner_found;
			g_assert (_tmp49_);
			_test_object_unref0 (new_obj);
		}
		_g_object_unref0 (_new_obj_it);
	}
	_tmp50_ = obj_set;
	_tmp51_ = gee_collection_get_size ((GeeCollection*) _tmp50_);
	_tmp52_ = _tmp51_;
	g_assert (_tmp52_ == 0);
	_g_object_unref0 (obj_set);
	_test_object_unref0 (obj2);
	_test_object_unref0 (obj1);
	block3_data_unref (_data3_);
	_data3_ = NULL;
}


static Block4Data* block4_data_ref (Block4Data* _data4_) {
	g_atomic_int_inc (&_data4_->_ref_count_);
	return _data4_;
}


static void block4_data_unref (Block4Data* _data4_) {
	if (g_atomic_int_dec_and_test (&_data4_->_ref_count_)) {
		_g_object_unref0 (_data4_->self);
		_g_object_unref0 (_data4_->new_obj_set);
		_g_object_unref0 (_data4_->cache);
		_g_main_loop_unref0 (_data4_->main_loop);
		g_slice_free (Block4Data, _data4_);
	}
}


static void _lambda4_ (GObject* o, GAsyncResult* r, Block4Data* _data4_) {
	ObjectCacheTests * self;
	TestCache* _tmp0_;
	GAsyncResult* _tmp1_;
	GMainLoop* _tmp2_;
	self = _data4_->self;
	g_return_if_fail (r != NULL);
	_tmp0_ = _data4_->cache;
	_tmp1_ = r;
	folks_object_cache_store_objects_finish ((FolksObjectCache*) _tmp0_, _tmp1_);
	_tmp2_ = _data4_->main_loop;
	g_main_loop_quit (_tmp2_);
}


static void __lambda4__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	_lambda4_ (source_object, res, self);
	block4_data_unref (self);
}


static void _lambda5_ (GObject* o, GAsyncResult* r, Block4Data* _data4_) {
	ObjectCacheTests * self;
	TestCache* _tmp0_;
	GAsyncResult* _tmp1_;
	GeeSet* _tmp2_ = NULL;
	GMainLoop* _tmp3_;
	self = _data4_->self;
	g_return_if_fail (r != NULL);
	_tmp0_ = _data4_->cache;
	_tmp1_ = r;
	_tmp2_ = folks_object_cache_load_objects_finish ((FolksObjectCache*) _tmp0_, _tmp1_);
	_g_object_unref0 (_data4_->new_obj_set);
	_data4_->new_obj_set = _tmp2_;
	_tmp3_ = _data4_->main_loop;
	g_main_loop_quit (_tmp3_);
}


static void __lambda5__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	_lambda5_ (source_object, res, self);
	block4_data_unref (self);
}


void object_cache_tests_test_load_objects_empty (ObjectCacheTests* self) {
	Block4Data* _data4_;
	GMainLoop* _tmp0_;
	TestCache* _tmp1_;
	TestCache* _tmp2_;
	GeeHashSet* _tmp3_;
	GeeHashSet* _tmp4_;
	GMainLoop* _tmp5_;
	TestCache* _tmp6_;
	GMainLoop* _tmp7_;
	GeeSet* _tmp8_;
	GeeSet* _tmp9_;
	gint _tmp10_;
	gint _tmp11_;
	g_return_if_fail (self != NULL);
	_data4_ = g_slice_new0 (Block4Data);
	_data4_->_ref_count_ = 1;
	_data4_->self = g_object_ref (self);
	_tmp0_ = g_main_loop_new (NULL, FALSE);
	_data4_->main_loop = _tmp0_;
	_tmp1_ = test_cache_new ("test-load-objects-empty");
	_data4_->cache = _tmp1_;
	_tmp2_ = _data4_->cache;
	_tmp3_ = gee_hash_set_new (TYPE_TEST_OBJECT, (GBoxedCopyFunc) test_object_ref, test_object_unref, NULL, NULL);
	_tmp4_ = _tmp3_;
	folks_object_cache_store_objects ((FolksObjectCache*) _tmp2_, (GeeSet*) _tmp4_, NULL, __lambda4__gasync_ready_callback, block4_data_ref (_data4_));
	_g_object_unref0 (_tmp4_);
	_tmp5_ = _data4_->main_loop;
	g_main_loop_run (_tmp5_);
	_data4_->new_obj_set = NULL;
	_tmp6_ = _data4_->cache;
	folks_object_cache_load_objects ((FolksObjectCache*) _tmp6_, NULL, __lambda5__gasync_ready_callback, block4_data_ref (_data4_));
	_tmp7_ = _data4_->main_loop;
	g_main_loop_run (_tmp7_);
	_tmp8_ = _data4_->new_obj_set;
	g_assert (_tmp8_ != NULL);
	_tmp9_ = _data4_->new_obj_set;
	_tmp10_ = gee_collection_get_size ((GeeCollection*) _tmp9_);
	_tmp11_ = _tmp10_;
	g_assert (_tmp11_ == 0);
	block4_data_unref (_data4_);
	_data4_ = NULL;
}


static Block5Data* block5_data_ref (Block5Data* _data5_) {
	g_atomic_int_inc (&_data5_->_ref_count_);
	return _data5_;
}


static void block5_data_unref (Block5Data* _data5_) {
	if (g_atomic_int_dec_and_test (&_data5_->_ref_count_)) {
		_g_object_unref0 (_data5_->self);
		_g_object_unref0 (_data5_->new_obj_set);
		_g_object_unref0 (_data5_->cache);
		_g_main_loop_unref0 (_data5_->main_loop);
		g_slice_free (Block5Data, _data5_);
	}
}


static void _lambda6_ (GObject* o, GAsyncResult* r, Block5Data* _data5_) {
	ObjectCacheTests * self;
	TestCache* _tmp0_;
	GAsyncResult* _tmp1_;
	GeeSet* _tmp2_ = NULL;
	GMainLoop* _tmp3_;
	self = _data5_->self;
	g_return_if_fail (r != NULL);
	_tmp0_ = _data5_->cache;
	_tmp1_ = r;
	_tmp2_ = folks_object_cache_load_objects_finish ((FolksObjectCache*) _tmp0_, _tmp1_);
	_g_object_unref0 (_data5_->new_obj_set);
	_data5_->new_obj_set = _tmp2_;
	_tmp3_ = _data5_->main_loop;
	g_main_loop_quit (_tmp3_);
}


static void __lambda6__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	_lambda6_ (source_object, res, self);
	block5_data_unref (self);
}


void object_cache_tests_test_load_objects_nonexistent (ObjectCacheTests* self) {
	Block5Data* _data5_;
	GMainLoop* _tmp0_;
	TestCache* _tmp1_;
	TestCache* _tmp2_;
	GMainLoop* _tmp3_;
	GeeSet* _tmp4_;
	g_return_if_fail (self != NULL);
	_data5_ = g_slice_new0 (Block5Data);
	_data5_->_ref_count_ = 1;
	_data5_->self = g_object_ref (self);
	_tmp0_ = g_main_loop_new (NULL, FALSE);
	_data5_->main_loop = _tmp0_;
	_tmp1_ = test_cache_new ("test-load-objects-nonexistent");
	_data5_->cache = _tmp1_;
	_object_cache_tests_delete_cache_directory (self);
	_data5_->new_obj_set = NULL;
	_tmp2_ = _data5_->cache;
	folks_object_cache_load_objects ((FolksObjectCache*) _tmp2_, NULL, __lambda6__gasync_ready_callback, block5_data_ref (_data5_));
	_tmp3_ = _data5_->main_loop;
	g_main_loop_run (_tmp3_);
	_tmp4_ = _data5_->new_obj_set;
	g_assert (_tmp4_ == NULL);
	block5_data_unref (_data5_);
	_data5_ = NULL;
}


static Block6Data* block6_data_ref (Block6Data* _data6_) {
	g_atomic_int_inc (&_data6_->_ref_count_);
	return _data6_;
}


static void block6_data_unref (Block6Data* _data6_) {
	if (g_atomic_int_dec_and_test (&_data6_->_ref_count_)) {
		_g_object_unref0 (_data6_->self);
		_g_object_unref0 (_data6_->new_obj_set);
		_g_object_unref0 (_data6_->cache);
		_g_main_loop_unref0 (_data6_->main_loop);
		g_slice_free (Block6Data, _data6_);
	}
}


static void _lambda7_ (GObject* o, GAsyncResult* r, Block6Data* _data6_) {
	ObjectCacheTests * self;
	TestCache* _tmp0_;
	GAsyncResult* _tmp1_;
	GMainLoop* _tmp2_;
	self = _data6_->self;
	g_return_if_fail (r != NULL);
	_tmp0_ = _data6_->cache;
	_tmp1_ = r;
	folks_object_cache_store_objects_finish ((FolksObjectCache*) _tmp0_, _tmp1_);
	_tmp2_ = _data6_->main_loop;
	g_main_loop_quit (_tmp2_);
}


static void __lambda7__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	_lambda7_ (source_object, res, self);
	block6_data_unref (self);
}


static void _lambda8_ (GObject* o, GAsyncResult* r, Block6Data* _data6_) {
	ObjectCacheTests * self;
	TestCache* _tmp0_;
	GAsyncResult* _tmp1_;
	GMainLoop* _tmp2_;
	self = _data6_->self;
	g_return_if_fail (r != NULL);
	_tmp0_ = _data6_->cache;
	_tmp1_ = r;
	folks_object_cache_clear_cache_finish ((FolksObjectCache*) _tmp0_, _tmp1_);
	_tmp2_ = _data6_->main_loop;
	g_main_loop_quit (_tmp2_);
}


static void __lambda8__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	_lambda8_ (source_object, res, self);
	block6_data_unref (self);
}


static void _lambda9_ (GObject* o, GAsyncResult* r, Block6Data* _data6_) {
	ObjectCacheTests * self;
	TestCache* _tmp0_;
	GAsyncResult* _tmp1_;
	GeeSet* _tmp2_ = NULL;
	GMainLoop* _tmp3_;
	self = _data6_->self;
	g_return_if_fail (r != NULL);
	_tmp0_ = _data6_->cache;
	_tmp1_ = r;
	_tmp2_ = folks_object_cache_load_objects_finish ((FolksObjectCache*) _tmp0_, _tmp1_);
	_g_object_unref0 (_data6_->new_obj_set);
	_data6_->new_obj_set = _tmp2_;
	_tmp3_ = _data6_->main_loop;
	g_main_loop_quit (_tmp3_);
}


static void __lambda9__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	_lambda9_ (source_object, res, self);
	block6_data_unref (self);
}


void object_cache_tests_test_clear (ObjectCacheTests* self) {
	Block6Data* _data6_;
	GMainLoop* _tmp0_;
	TestCache* _tmp1_;
	TestObject* _tmp2_;
	TestObject* obj1;
	TestObject* _tmp3_;
	TestObject* obj2;
	GeeHashSet* _tmp4_;
	GeeHashSet* obj_set;
	GeeHashSet* _tmp5_;
	TestObject* _tmp6_;
	GeeHashSet* _tmp7_;
	TestObject* _tmp8_;
	TestCache* _tmp9_;
	GeeHashSet* _tmp10_;
	GMainLoop* _tmp11_;
	TestCache* _tmp12_;
	GMainLoop* _tmp13_;
	TestCache* _tmp14_;
	GMainLoop* _tmp15_;
	GeeSet* _tmp16_;
	g_return_if_fail (self != NULL);
	_data6_ = g_slice_new0 (Block6Data);
	_data6_->_ref_count_ = 1;
	_data6_->self = g_object_ref (self);
	_tmp0_ = g_main_loop_new (NULL, FALSE);
	_data6_->main_loop = _tmp0_;
	_tmp1_ = test_cache_new ("test-clear");
	_data6_->cache = _tmp1_;
	_tmp2_ = test_object_new ("Foo", (guint) 1);
	obj1 = _tmp2_;
	_tmp3_ = test_object_new ("Bar", (guint) 2);
	obj2 = _tmp3_;
	_tmp4_ = gee_hash_set_new (TYPE_TEST_OBJECT, (GBoxedCopyFunc) test_object_ref, test_object_unref, NULL, NULL);
	obj_set = _tmp4_;
	_tmp5_ = obj_set;
	_tmp6_ = obj1;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp5_, _tmp6_);
	_tmp7_ = obj_set;
	_tmp8_ = obj2;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp7_, _tmp8_);
	_tmp9_ = _data6_->cache;
	_tmp10_ = obj_set;
	folks_object_cache_store_objects ((FolksObjectCache*) _tmp9_, (GeeSet*) _tmp10_, NULL, __lambda7__gasync_ready_callback, block6_data_ref (_data6_));
	_tmp11_ = _data6_->main_loop;
	g_main_loop_run (_tmp11_);
	_tmp12_ = _data6_->cache;
	folks_object_cache_clear_cache ((FolksObjectCache*) _tmp12_, __lambda8__gasync_ready_callback, block6_data_ref (_data6_));
	_tmp13_ = _data6_->main_loop;
	g_main_loop_run (_tmp13_);
	_data6_->new_obj_set = NULL;
	_tmp14_ = _data6_->cache;
	folks_object_cache_load_objects ((FolksObjectCache*) _tmp14_, NULL, __lambda9__gasync_ready_callback, block6_data_ref (_data6_));
	_tmp15_ = _data6_->main_loop;
	g_main_loop_run (_tmp15_);
	_tmp16_ = _data6_->new_obj_set;
	g_assert (_tmp16_ == NULL);
	_g_object_unref0 (obj_set);
	_test_object_unref0 (obj2);
	_test_object_unref0 (obj1);
	block6_data_unref (_data6_);
	_data6_ = NULL;
}


static Block7Data* block7_data_ref (Block7Data* _data7_) {
	g_atomic_int_inc (&_data7_->_ref_count_);
	return _data7_;
}


static void block7_data_unref (Block7Data* _data7_) {
	if (g_atomic_int_dec_and_test (&_data7_->_ref_count_)) {
		_g_object_unref0 (_data7_->self);
		_g_object_unref0 (_data7_->new_obj_set);
		_g_object_unref0 (_data7_->cache);
		_g_main_loop_unref0 (_data7_->main_loop);
		g_slice_free (Block7Data, _data7_);
	}
}


static void _lambda10_ (GObject* o, GAsyncResult* r, Block7Data* _data7_) {
	ObjectCacheTests * self;
	TestCache* _tmp0_;
	GAsyncResult* _tmp1_;
	GMainLoop* _tmp2_;
	self = _data7_->self;
	g_return_if_fail (r != NULL);
	_tmp0_ = _data7_->cache;
	_tmp1_ = r;
	folks_object_cache_store_objects_finish ((FolksObjectCache*) _tmp0_, _tmp1_);
	_tmp2_ = _data7_->main_loop;
	g_main_loop_quit (_tmp2_);
}


static void __lambda10__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	_lambda10_ (source_object, res, self);
	block7_data_unref (self);
}


static void _lambda11_ (GObject* o, GAsyncResult* r, Block7Data* _data7_) {
	ObjectCacheTests * self;
	TestCache* _tmp0_;
	GAsyncResult* _tmp1_;
	GMainLoop* _tmp2_;
	self = _data7_->self;
	g_return_if_fail (r != NULL);
	_tmp0_ = _data7_->cache;
	_tmp1_ = r;
	folks_object_cache_clear_cache_finish ((FolksObjectCache*) _tmp0_, _tmp1_);
	_tmp2_ = _data7_->main_loop;
	g_main_loop_quit (_tmp2_);
}


static void __lambda11__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	_lambda11_ (source_object, res, self);
	block7_data_unref (self);
}


static void _lambda12_ (GObject* o, GAsyncResult* r, Block7Data* _data7_) {
	ObjectCacheTests * self;
	TestCache* _tmp0_;
	GAsyncResult* _tmp1_;
	GeeSet* _tmp2_ = NULL;
	GMainLoop* _tmp3_;
	self = _data7_->self;
	g_return_if_fail (r != NULL);
	_tmp0_ = _data7_->cache;
	_tmp1_ = r;
	_tmp2_ = folks_object_cache_load_objects_finish ((FolksObjectCache*) _tmp0_, _tmp1_);
	_g_object_unref0 (_data7_->new_obj_set);
	_data7_->new_obj_set = _tmp2_;
	_tmp3_ = _data7_->main_loop;
	g_main_loop_quit (_tmp3_);
}


static void __lambda12__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	_lambda12_ (source_object, res, self);
	block7_data_unref (self);
}


void object_cache_tests_test_clear_empty (ObjectCacheTests* self) {
	Block7Data* _data7_;
	GMainLoop* _tmp0_;
	TestCache* _tmp1_;
	TestCache* _tmp2_;
	GeeHashSet* _tmp3_;
	GeeHashSet* _tmp4_;
	GMainLoop* _tmp5_;
	TestCache* _tmp6_;
	GMainLoop* _tmp7_;
	TestCache* _tmp8_;
	GMainLoop* _tmp9_;
	GeeSet* _tmp10_;
	g_return_if_fail (self != NULL);
	_data7_ = g_slice_new0 (Block7Data);
	_data7_->_ref_count_ = 1;
	_data7_->self = g_object_ref (self);
	_tmp0_ = g_main_loop_new (NULL, FALSE);
	_data7_->main_loop = _tmp0_;
	_tmp1_ = test_cache_new ("test-clear-empty");
	_data7_->cache = _tmp1_;
	_tmp2_ = _data7_->cache;
	_tmp3_ = gee_hash_set_new (TYPE_TEST_OBJECT, (GBoxedCopyFunc) test_object_ref, test_object_unref, NULL, NULL);
	_tmp4_ = _tmp3_;
	folks_object_cache_store_objects ((FolksObjectCache*) _tmp2_, (GeeSet*) _tmp4_, NULL, __lambda10__gasync_ready_callback, block7_data_ref (_data7_));
	_g_object_unref0 (_tmp4_);
	_tmp5_ = _data7_->main_loop;
	g_main_loop_run (_tmp5_);
	_tmp6_ = _data7_->cache;
	folks_object_cache_clear_cache ((FolksObjectCache*) _tmp6_, __lambda11__gasync_ready_callback, block7_data_ref (_data7_));
	_tmp7_ = _data7_->main_loop;
	g_main_loop_run (_tmp7_);
	_data7_->new_obj_set = NULL;
	_tmp8_ = _data7_->cache;
	folks_object_cache_load_objects ((FolksObjectCache*) _tmp8_, NULL, __lambda12__gasync_ready_callback, block7_data_ref (_data7_));
	_tmp9_ = _data7_->main_loop;
	g_main_loop_run (_tmp9_);
	_tmp10_ = _data7_->new_obj_set;
	g_assert (_tmp10_ == NULL);
	block7_data_unref (_data7_);
	_data7_ = NULL;
}


static Block8Data* block8_data_ref (Block8Data* _data8_) {
	g_atomic_int_inc (&_data8_->_ref_count_);
	return _data8_;
}


static void block8_data_unref (Block8Data* _data8_) {
	if (g_atomic_int_dec_and_test (&_data8_->_ref_count_)) {
		_g_object_unref0 (_data8_->self);
		_g_object_unref0 (_data8_->new_obj_set);
		_g_object_unref0 (_data8_->cache);
		_g_main_loop_unref0 (_data8_->main_loop);
		g_slice_free (Block8Data, _data8_);
	}
}


static void _lambda13_ (GObject* o, GAsyncResult* r, Block8Data* _data8_) {
	ObjectCacheTests * self;
	TestCache* _tmp0_;
	GAsyncResult* _tmp1_;
	GMainLoop* _tmp2_;
	self = _data8_->self;
	g_return_if_fail (r != NULL);
	_tmp0_ = _data8_->cache;
	_tmp1_ = r;
	folks_object_cache_clear_cache_finish ((FolksObjectCache*) _tmp0_, _tmp1_);
	_tmp2_ = _data8_->main_loop;
	g_main_loop_quit (_tmp2_);
}


static void __lambda13__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	_lambda13_ (source_object, res, self);
	block8_data_unref (self);
}


static void _lambda14_ (GObject* o, GAsyncResult* r, Block8Data* _data8_) {
	ObjectCacheTests * self;
	TestCache* _tmp0_;
	GAsyncResult* _tmp1_;
	GeeSet* _tmp2_ = NULL;
	GMainLoop* _tmp3_;
	self = _data8_->self;
	g_return_if_fail (r != NULL);
	_tmp0_ = _data8_->cache;
	_tmp1_ = r;
	_tmp2_ = folks_object_cache_load_objects_finish ((FolksObjectCache*) _tmp0_, _tmp1_);
	_g_object_unref0 (_data8_->new_obj_set);
	_data8_->new_obj_set = _tmp2_;
	_tmp3_ = _data8_->main_loop;
	g_main_loop_quit (_tmp3_);
}


static void __lambda14__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	_lambda14_ (source_object, res, self);
	block8_data_unref (self);
}


void object_cache_tests_test_clear_nonexistent (ObjectCacheTests* self) {
	Block8Data* _data8_;
	GMainLoop* _tmp0_;
	TestCache* _tmp1_;
	TestCache* _tmp2_;
	GMainLoop* _tmp3_;
	TestCache* _tmp4_;
	GMainLoop* _tmp5_;
	GeeSet* _tmp6_;
	g_return_if_fail (self != NULL);
	_data8_ = g_slice_new0 (Block8Data);
	_data8_->_ref_count_ = 1;
	_data8_->self = g_object_ref (self);
	_tmp0_ = g_main_loop_new (NULL, FALSE);
	_data8_->main_loop = _tmp0_;
	_tmp1_ = test_cache_new ("test-clear-nonexistent");
	_data8_->cache = _tmp1_;
	_object_cache_tests_delete_cache_directory (self);
	_tmp2_ = _data8_->cache;
	folks_object_cache_clear_cache ((FolksObjectCache*) _tmp2_, __lambda13__gasync_ready_callback, block8_data_ref (_data8_));
	_tmp3_ = _data8_->main_loop;
	g_main_loop_run (_tmp3_);
	_data8_->new_obj_set = NULL;
	_tmp4_ = _data8_->cache;
	folks_object_cache_load_objects ((FolksObjectCache*) _tmp4_, NULL, __lambda14__gasync_ready_callback, block8_data_ref (_data8_));
	_tmp5_ = _data8_->main_loop;
	g_main_loop_run (_tmp5_);
	_tmp6_ = _data8_->new_obj_set;
	g_assert (_tmp6_ == NULL);
	block8_data_unref (_data8_);
	_data8_ = NULL;
}


static Block9Data* block9_data_ref (Block9Data* _data9_) {
	g_atomic_int_inc (&_data9_->_ref_count_);
	return _data9_;
}


static void block9_data_unref (Block9Data* _data9_) {
	if (g_atomic_int_dec_and_test (&_data9_->_ref_count_)) {
		_g_object_unref0 (_data9_->self);
		_g_object_unref0 (_data9_->new_obj_set);
		_g_object_unref0 (_data9_->cache);
		_g_main_loop_unref0 (_data9_->main_loop);
		g_slice_free (Block9Data, _data9_);
	}
}


static void _lambda15_ (GObject* o, GAsyncResult* r, Block9Data* _data9_) {
	ObjectCacheTests * self;
	TestCache* _tmp0_;
	GAsyncResult* _tmp1_;
	GMainLoop* _tmp2_;
	self = _data9_->self;
	g_return_if_fail (r != NULL);
	_tmp0_ = _data9_->cache;
	_tmp1_ = r;
	folks_object_cache_store_objects_finish ((FolksObjectCache*) _tmp0_, _tmp1_);
	_tmp2_ = _data9_->main_loop;
	g_main_loop_quit (_tmp2_);
}


static void __lambda15__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	_lambda15_ (source_object, res, self);
	block9_data_unref (self);
}


static void _lambda16_ (GObject* o, GAsyncResult* r, Block9Data* _data9_) {
	ObjectCacheTests * self;
	TestCache* _tmp0_;
	GAsyncResult* _tmp1_;
	GeeSet* _tmp2_ = NULL;
	GMainLoop* _tmp3_;
	self = _data9_->self;
	g_return_if_fail (r != NULL);
	_tmp0_ = _data9_->cache;
	_tmp1_ = r;
	_tmp2_ = folks_object_cache_load_objects_finish ((FolksObjectCache*) _tmp0_, _tmp1_);
	_g_object_unref0 (_data9_->new_obj_set);
	_data9_->new_obj_set = _tmp2_;
	_tmp3_ = _data9_->main_loop;
	g_main_loop_quit (_tmp3_);
}


static void __lambda16__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	_lambda16_ (source_object, res, self);
	block9_data_unref (self);
}


void object_cache_tests_test_store_objects_cancellation (ObjectCacheTests* self) {
	Block9Data* _data9_;
	GMainLoop* _tmp0_;
	TestCache* _tmp1_;
	GeeHashSet* _tmp2_;
	GeeHashSet* obj_set;
	GeeHashSet* _tmp3_;
	TestObject* _tmp4_;
	TestObject* _tmp5_;
	GeeHashSet* _tmp6_;
	TestObject* _tmp7_;
	TestObject* _tmp8_;
	GeeHashSet* _tmp9_;
	TestObject* _tmp10_;
	TestObject* _tmp11_;
	GeeHashSet* _tmp12_;
	TestObject* _tmp13_;
	TestObject* _tmp14_;
	GCancellable* _tmp15_;
	GCancellable* cancellable;
	TestCache* _tmp16_;
	GeeHashSet* _tmp17_;
	GCancellable* _tmp18_;
	GCancellable* _tmp19_;
	GMainLoop* _tmp20_;
	TestCache* _tmp21_;
	GMainLoop* _tmp22_;
	GeeSet* _tmp23_;
	g_return_if_fail (self != NULL);
	_data9_ = g_slice_new0 (Block9Data);
	_data9_->_ref_count_ = 1;
	_data9_->self = g_object_ref (self);
	_tmp0_ = g_main_loop_new (NULL, FALSE);
	_data9_->main_loop = _tmp0_;
	_tmp1_ = test_cache_new ("test-store-objects-cancellation");
	_data9_->cache = _tmp1_;
	_tmp2_ = gee_hash_set_new (TYPE_TEST_OBJECT, (GBoxedCopyFunc) test_object_ref, test_object_unref, NULL, NULL);
	obj_set = _tmp2_;
	_tmp3_ = obj_set;
	_tmp4_ = test_object_new ("Foo", (guint) 1);
	_tmp5_ = _tmp4_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp3_, _tmp5_);
	_test_object_unref0 (_tmp5_);
	_tmp6_ = obj_set;
	_tmp7_ = test_object_new ("Bar", (guint) 2);
	_tmp8_ = _tmp7_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp6_, _tmp8_);
	_test_object_unref0 (_tmp8_);
	_tmp9_ = obj_set;
	_tmp10_ = test_object_new ("De", (guint) 3);
	_tmp11_ = _tmp10_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp9_, _tmp11_);
	_test_object_unref0 (_tmp11_);
	_tmp12_ = obj_set;
	_tmp13_ = test_object_new ("Baz", (guint) 4);
	_tmp14_ = _tmp13_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp12_, _tmp14_);
	_test_object_unref0 (_tmp14_);
	_tmp15_ = g_cancellable_new ();
	cancellable = _tmp15_;
	_tmp16_ = _data9_->cache;
	_tmp17_ = obj_set;
	_tmp18_ = cancellable;
	folks_object_cache_store_objects ((FolksObjectCache*) _tmp16_, (GeeSet*) _tmp17_, _tmp18_, __lambda15__gasync_ready_callback, block9_data_ref (_data9_));
	_tmp19_ = cancellable;
	g_cancellable_cancel (_tmp19_);
	_tmp20_ = _data9_->main_loop;
	g_main_loop_run (_tmp20_);
	_data9_->new_obj_set = NULL;
	_tmp21_ = _data9_->cache;
	folks_object_cache_load_objects ((FolksObjectCache*) _tmp21_, NULL, __lambda16__gasync_ready_callback, block9_data_ref (_data9_));
	_tmp22_ = _data9_->main_loop;
	g_main_loop_run (_tmp22_);
	_tmp23_ = _data9_->new_obj_set;
	g_assert (_tmp23_ == NULL);
	_g_object_unref0 (cancellable);
	_g_object_unref0 (obj_set);
	block9_data_unref (_data9_);
	_data9_ = NULL;
}


static Block10Data* block10_data_ref (Block10Data* _data10_) {
	g_atomic_int_inc (&_data10_->_ref_count_);
	return _data10_;
}


static void block10_data_unref (Block10Data* _data10_) {
	if (g_atomic_int_dec_and_test (&_data10_->_ref_count_)) {
		_g_object_unref0 (_data10_->self);
		_g_object_unref0 (_data10_->new_obj_set);
		_g_object_unref0 (_data10_->cache);
		_g_main_loop_unref0 (_data10_->main_loop);
		g_slice_free (Block10Data, _data10_);
	}
}


static void _lambda17_ (GObject* o, GAsyncResult* r, Block10Data* _data10_) {
	ObjectCacheTests * self;
	TestCache* _tmp0_;
	GAsyncResult* _tmp1_;
	GMainLoop* _tmp2_;
	self = _data10_->self;
	g_return_if_fail (r != NULL);
	_tmp0_ = _data10_->cache;
	_tmp1_ = r;
	folks_object_cache_store_objects_finish ((FolksObjectCache*) _tmp0_, _tmp1_);
	_tmp2_ = _data10_->main_loop;
	g_main_loop_quit (_tmp2_);
}


static void __lambda17__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	_lambda17_ (source_object, res, self);
	block10_data_unref (self);
}


static void _lambda18_ (GObject* o, GAsyncResult* r, Block10Data* _data10_) {
	ObjectCacheTests * self;
	TestCache* _tmp0_;
	GAsyncResult* _tmp1_;
	GeeSet* _tmp2_ = NULL;
	GMainLoop* _tmp3_;
	self = _data10_->self;
	g_return_if_fail (r != NULL);
	_tmp0_ = _data10_->cache;
	_tmp1_ = r;
	_tmp2_ = folks_object_cache_load_objects_finish ((FolksObjectCache*) _tmp0_, _tmp1_);
	_g_object_unref0 (_data10_->new_obj_set);
	_data10_->new_obj_set = _tmp2_;
	_tmp3_ = _data10_->main_loop;
	g_main_loop_quit (_tmp3_);
}


static void __lambda18__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	_lambda18_ (source_object, res, self);
	block10_data_unref (self);
}


void object_cache_tests_test_load_objects_cancellation (ObjectCacheTests* self) {
	Block10Data* _data10_;
	GMainLoop* _tmp0_;
	TestCache* _tmp1_;
	TestObject* _tmp2_;
	TestObject* obj1;
	TestObject* _tmp3_;
	TestObject* obj2;
	GeeHashSet* _tmp4_;
	GeeHashSet* obj_set;
	GeeHashSet* _tmp5_;
	TestObject* _tmp6_;
	GeeHashSet* _tmp7_;
	TestObject* _tmp8_;
	TestCache* _tmp9_;
	GeeHashSet* _tmp10_;
	GMainLoop* _tmp11_;
	GCancellable* _tmp12_;
	GCancellable* cancellable;
	TestCache* _tmp13_;
	GCancellable* _tmp14_;
	GCancellable* _tmp15_;
	GMainLoop* _tmp16_;
	GeeSet* _tmp17_;
	g_return_if_fail (self != NULL);
	_data10_ = g_slice_new0 (Block10Data);
	_data10_->_ref_count_ = 1;
	_data10_->self = g_object_ref (self);
	_tmp0_ = g_main_loop_new (NULL, FALSE);
	_data10_->main_loop = _tmp0_;
	_tmp1_ = test_cache_new ("test-load-objects-cancellation");
	_data10_->cache = _tmp1_;
	_tmp2_ = test_object_new ("Foo", (guint) 1);
	obj1 = _tmp2_;
	_tmp3_ = test_object_new ("Bar", (guint) 2);
	obj2 = _tmp3_;
	_tmp4_ = gee_hash_set_new (TYPE_TEST_OBJECT, (GBoxedCopyFunc) test_object_ref, test_object_unref, NULL, NULL);
	obj_set = _tmp4_;
	_tmp5_ = obj_set;
	_tmp6_ = obj1;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp5_, _tmp6_);
	_tmp7_ = obj_set;
	_tmp8_ = obj2;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp7_, _tmp8_);
	_tmp9_ = _data10_->cache;
	_tmp10_ = obj_set;
	folks_object_cache_store_objects ((FolksObjectCache*) _tmp9_, (GeeSet*) _tmp10_, NULL, __lambda17__gasync_ready_callback, block10_data_ref (_data10_));
	_tmp11_ = _data10_->main_loop;
	g_main_loop_run (_tmp11_);
	_tmp12_ = g_cancellable_new ();
	cancellable = _tmp12_;
	_data10_->new_obj_set = NULL;
	_tmp13_ = _data10_->cache;
	_tmp14_ = cancellable;
	folks_object_cache_load_objects ((FolksObjectCache*) _tmp13_, _tmp14_, __lambda18__gasync_ready_callback, block10_data_ref (_data10_));
	_tmp15_ = cancellable;
	g_cancellable_cancel (_tmp15_);
	_tmp16_ = _data10_->main_loop;
	g_main_loop_run (_tmp16_);
	_tmp17_ = _data10_->new_obj_set;
	g_assert (_tmp17_ == NULL);
	_g_object_unref0 (cancellable);
	_g_object_unref0 (obj_set);
	_test_object_unref0 (obj2);
	_test_object_unref0 (obj1);
	block10_data_unref (_data10_);
	_data10_ = NULL;
}


static Block11Data* block11_data_ref (Block11Data* _data11_) {
	g_atomic_int_inc (&_data11_->_ref_count_);
	return _data11_;
}


static void block11_data_unref (Block11Data* _data11_) {
	if (g_atomic_int_dec_and_test (&_data11_->_ref_count_)) {
		_g_object_unref0 (_data11_->self);
		_g_object_unref0 (_data11_->new_obj_set);
		_g_object_unref0 (_data11_->cache);
		_g_main_loop_unref0 (_data11_->main_loop);
		g_slice_free (Block11Data, _data11_);
	}
}


static void _lambda19_ (GObject* o, GAsyncResult* r, Block11Data* _data11_) {
	ObjectCacheTests * self;
	gdouble _tmp0_ = 0.0;
	gdouble elapsed_time;
	gint _tmp1_;
	gdouble _tmp2_;
	TestCache* _tmp3_;
	GAsyncResult* _tmp4_;
	GMainLoop* _tmp5_;
	self = _data11_->self;
	g_return_if_fail (r != NULL);
	_tmp0_ = g_test_timer_elapsed ();
	elapsed_time = _tmp0_;
	_tmp1_ = _data11_->obj_count;
	_tmp2_ = elapsed_time;
	g_message ("object-cache.vala:500: Storing %u objects in a cache file took %f seco" \
"nds.", (guint) _tmp1_, _tmp2_);
	_tmp3_ = _data11_->cache;
	_tmp4_ = r;
	folks_object_cache_store_objects_finish ((FolksObjectCache*) _tmp3_, _tmp4_);
	_tmp5_ = _data11_->main_loop;
	g_main_loop_quit (_tmp5_);
}


static void __lambda19__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	_lambda19_ (source_object, res, self);
	block11_data_unref (self);
}


static void _lambda20_ (GObject* o, GAsyncResult* r, Block11Data* _data11_) {
	ObjectCacheTests * self;
	gdouble _tmp0_ = 0.0;
	gdouble elapsed_time;
	gint _tmp1_;
	gdouble _tmp2_;
	TestCache* _tmp3_;
	GAsyncResult* _tmp4_;
	GeeSet* _tmp5_ = NULL;
	GMainLoop* _tmp6_;
	self = _data11_->self;
	g_return_if_fail (r != NULL);
	_tmp0_ = g_test_timer_elapsed ();
	elapsed_time = _tmp0_;
	_tmp1_ = _data11_->obj_count;
	_tmp2_ = elapsed_time;
	g_message ("object-cache.vala:516: Loading %u objects from a cache file took %f se" \
"conds.", (guint) _tmp1_, _tmp2_);
	_tmp3_ = _data11_->cache;
	_tmp4_ = r;
	_tmp5_ = folks_object_cache_load_objects_finish ((FolksObjectCache*) _tmp3_, _tmp4_);
	_g_object_unref0 (_data11_->new_obj_set);
	_data11_->new_obj_set = _tmp5_;
	_tmp6_ = _data11_->main_loop;
	g_main_loop_quit (_tmp6_);
}


static void __lambda20__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	_lambda20_ (source_object, res, self);
	block11_data_unref (self);
}


void object_cache_tests_test_stress (ObjectCacheTests* self) {
	Block11Data* _data11_;
	GMainLoop* _tmp0_;
	TestCache* _tmp1_;
	GeeHashSet* _tmp2_;
	GeeHashSet* obj_set;
	TestCache* _tmp12_;
	GeeHashSet* _tmp13_;
	GMainLoop* _tmp14_;
	TestCache* _tmp15_;
	GMainLoop* _tmp16_;
	GeeSet* _tmp17_;
	GeeSet* _tmp18_;
	gint _tmp19_;
	gint _tmp20_;
	GeeHashSet* _tmp21_;
	gint _tmp22_;
	gint _tmp23_;
	g_return_if_fail (self != NULL);
	_data11_ = g_slice_new0 (Block11Data);
	_data11_->_ref_count_ = 1;
	_data11_->self = g_object_ref (self);
	_tmp0_ = g_main_loop_new (NULL, FALSE);
	_data11_->main_loop = _tmp0_;
	_tmp1_ = test_cache_new ("test-stress");
	_data11_->cache = _tmp1_;
	_data11_->obj_count = 66666;
	_tmp2_ = gee_hash_set_new (TYPE_TEST_OBJECT, (GBoxedCopyFunc) test_object_ref, test_object_unref, NULL, NULL);
	obj_set = _tmp2_;
	{
		gint i;
		i = 0;
		{
			gboolean _tmp3_;
			_tmp3_ = TRUE;
			while (TRUE) {
				gboolean _tmp4_;
				gint _tmp6_;
				gint _tmp7_;
				GeeHashSet* _tmp8_;
				gint _tmp9_;
				TestObject* _tmp10_;
				TestObject* _tmp11_;
				_tmp4_ = _tmp3_;
				if (!_tmp4_) {
					gint _tmp5_;
					_tmp5_ = i;
					i = _tmp5_ + 1;
				}
				_tmp3_ = FALSE;
				_tmp6_ = i;
				_tmp7_ = _data11_->obj_count;
				if (!(_tmp6_ < _tmp7_)) {
					break;
				}
				_tmp8_ = obj_set;
				_tmp9_ = i;
				_tmp10_ = test_object_new ("bizzle", (guint) _tmp9_);
				_tmp11_ = _tmp10_;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp8_, _tmp11_);
				_test_object_unref0 (_tmp11_);
			}
		}
	}
	g_test_timer_start ();
	_tmp12_ = _data11_->cache;
	_tmp13_ = obj_set;
	folks_object_cache_store_objects ((FolksObjectCache*) _tmp12_, (GeeSet*) _tmp13_, NULL, __lambda19__gasync_ready_callback, block11_data_ref (_data11_));
	_tmp14_ = _data11_->main_loop;
	g_main_loop_run (_tmp14_);
	g_test_timer_start ();
	_data11_->new_obj_set = NULL;
	_tmp15_ = _data11_->cache;
	folks_object_cache_load_objects ((FolksObjectCache*) _tmp15_, NULL, __lambda20__gasync_ready_callback, block11_data_ref (_data11_));
	_tmp16_ = _data11_->main_loop;
	g_main_loop_run (_tmp16_);
	_tmp17_ = _data11_->new_obj_set;
	g_assert (_tmp17_ != NULL);
	_tmp18_ = _data11_->new_obj_set;
	_tmp19_ = gee_collection_get_size ((GeeCollection*) _tmp18_);
	_tmp20_ = _tmp19_;
	_tmp21_ = obj_set;
	_tmp22_ = gee_collection_get_size ((GeeCollection*) _tmp21_);
	_tmp23_ = _tmp22_;
	g_assert (_tmp20_ == _tmp23_);
	_g_object_unref0 (obj_set);
	block11_data_unref (_data11_);
	_data11_ = NULL;
}


static void object_cache_tests_class_init (ObjectCacheTestsClass * klass) {
	object_cache_tests_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ObjectCacheTestsPrivate));
	FOLKS_TEST_CASE_CLASS (klass)->set_up = object_cache_tests_real_set_up;
	FOLKS_TEST_CASE_CLASS (klass)->tear_down = object_cache_tests_real_tear_down;
	G_OBJECT_CLASS (klass)->finalize = object_cache_tests_finalize;
}


static void object_cache_tests_instance_init (ObjectCacheTests * self) {
	self->priv = OBJECT_CACHE_TESTS_GET_PRIVATE (self);
}


static void object_cache_tests_finalize (GObject* obj) {
	ObjectCacheTests * self;
	self = OBJECT_CACHE_TESTS (obj);
	_g_object_unref0 (self->priv->_cache_dir);
	G_OBJECT_CLASS (object_cache_tests_parent_class)->finalize (obj);
}


GType object_cache_tests_get_type (void) {
	static volatile gsize object_cache_tests_type_id__volatile = 0;
	if (g_once_init_enter (&object_cache_tests_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ObjectCacheTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) object_cache_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ObjectCacheTests), 0, (GInstanceInitFunc) object_cache_tests_instance_init, NULL };
		GType object_cache_tests_type_id;
		object_cache_tests_type_id = g_type_register_static (FOLKS_TYPE_TEST_CASE, "ObjectCacheTests", &g_define_type_info, 0);
		g_once_init_leave (&object_cache_tests_type_id__volatile, object_cache_tests_type_id);
	}
	return object_cache_tests_type_id__volatile;
}


gint _vala_main (gchar** args, int args_length1) {
	gint result = 0;
	GTestSuite* _tmp0_ = NULL;
	GTestSuite* root;
	GTestSuite* _tmp1_;
	ObjectCacheTests* _tmp2_;
	ObjectCacheTests* _tmp3_;
	GTestSuite* _tmp4_ = NULL;
	g_test_init (&args_length1, &args, NULL);
	_tmp0_ = g_test_get_root ();
	root = _tmp0_;
	_tmp1_ = root;
	_tmp2_ = object_cache_tests_new ();
	_tmp3_ = _tmp2_;
	_tmp4_ = folks_test_case_get_suite ((FolksTestCase*) _tmp3_);
	g_test_suite_add_suite (_tmp1_, _tmp4_);
	_g_object_unref0 (_tmp3_);
	g_test_run ();
	result = 0;
	return result;
}


int main (int argc, char ** argv) {
	g_type_init ();
	return _vala_main (argv, argc);
}


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);
}



