/* avatar-cache.c generated by valac 0.26.0.36-540e, the Vala compiler
 * generated from avatar-cache.vala, do not modify */

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

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


#define TYPE_AVATAR_CACHE_TESTS (avatar_cache_tests_get_type ())
#define AVATAR_CACHE_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_AVATAR_CACHE_TESTS, AvatarCacheTests))
#define AVATAR_CACHE_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_AVATAR_CACHE_TESTS, AvatarCacheTestsClass))
#define IS_AVATAR_CACHE_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_AVATAR_CACHE_TESTS))
#define IS_AVATAR_CACHE_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_AVATAR_CACHE_TESTS))
#define AVATAR_CACHE_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_AVATAR_CACHE_TESTS, AvatarCacheTestsClass))

typedef struct _AvatarCacheTests AvatarCacheTests;
typedef struct _AvatarCacheTestsClass AvatarCacheTestsClass;
typedef struct _AvatarCacheTestsPrivate AvatarCacheTestsPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_main_loop_unref0(var) ((var == NULL) ? NULL : (var = (g_main_loop_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _Block1Data Block1Data;
typedef struct _Block2Data Block2Data;
typedef struct _Block3Data Block3Data;
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _AvatarCacheTests {
	FolksTestCase parent_instance;
	AvatarCacheTestsPrivate * priv;
};

struct _AvatarCacheTestsClass {
	FolksTestCaseClass parent_class;
};

struct _AvatarCacheTestsPrivate {
	FolksAvatarCache* _cache;
	GFile* _cache_dir;
	GLoadableIcon* _avatar;
	GMainLoop* _main_loop;
};

struct _Block1Data {
	int _ref_count_;
	AvatarCacheTests* self;
	GLoadableIcon* avatar;
};

struct _Block2Data {
	int _ref_count_;
	AvatarCacheTests* self;
	guint n_remaining;
};

struct _Block3Data {
	int _ref_count_;
	Block2Data * _data2_;
	guint i;
};


static gpointer avatar_cache_tests_parent_class = NULL;

GType avatar_cache_tests_get_type (void) G_GNUC_CONST;
#define AVATAR_CACHE_TESTS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_AVATAR_CACHE_TESTS, AvatarCacheTestsPrivate))
enum  {
	AVATAR_CACHE_TESTS_DUMMY_PROPERTY
};
AvatarCacheTests* avatar_cache_tests_new (void);
AvatarCacheTests* avatar_cache_tests_construct (GType object_type);
void avatar_cache_tests_test_store_and_load_avatar (AvatarCacheTests* self);
static void _avatar_cache_tests_test_store_and_load_avatar_folks_test_case_test_method (gpointer self);
void avatar_cache_tests_test_store_avatar_overwrite (AvatarCacheTests* self);
static void _avatar_cache_tests_test_store_avatar_overwrite_folks_test_case_test_method (gpointer self);
void avatar_cache_tests_test_store_many_avatars (AvatarCacheTests* self);
static void _avatar_cache_tests_test_store_many_avatars_folks_test_case_test_method (gpointer self);
void avatar_cache_tests_test_load_avatar_non_existent (AvatarCacheTests* self);
static void _avatar_cache_tests_test_load_avatar_non_existent_folks_test_case_test_method (gpointer self);
void avatar_cache_tests_test_remove_avatar (AvatarCacheTests* self);
static void _avatar_cache_tests_test_remove_avatar_folks_test_case_test_method (gpointer self);
void avatar_cache_tests_test_remove_avatar_non_existent (AvatarCacheTests* self);
static void _avatar_cache_tests_test_remove_avatar_non_existent_folks_test_case_test_method (gpointer self);
void avatar_cache_tests_test_build_uri_for_avatar (AvatarCacheTests* self);
static void _avatar_cache_tests_test_build_uri_for_avatar_folks_test_case_test_method (gpointer self);
static void avatar_cache_tests_real_set_up (FolksTestCase* base);
void _avatar_cache_tests_delete_cache_directory (AvatarCacheTests* self);
static void avatar_cache_tests_real_tear_down (FolksTestCase* base);
void _avatar_cache_tests_delete_directory (AvatarCacheTests* self, GFile* dir, GError** error);
void _avatar_cache_tests_assert_store_avatar (AvatarCacheTests* self, const gchar* id, GLoadableIcon* avatar);
static void __lambda4_ (AvatarCacheTests* self, GObject* obj, GAsyncResult* res);
static void ___lambda4__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
GLoadableIcon* _avatar_cache_tests_assert_load_avatar (AvatarCacheTests* self, const gchar* id);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static void __lambda5_ (Block1Data* _data1_, GObject* obj, GAsyncResult* res);
static void ___lambda5__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
void _avatar_cache_tests_assert_remove_avatar (AvatarCacheTests* self, const gchar* id);
static void __lambda9_ (AvatarCacheTests* self, GObject* obj, GAsyncResult* res);
static void ___lambda9__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
void _avatar_cache_tests_assert_avatars_equal (AvatarCacheTests* self, GLoadableIcon* a, GLoadableIcon* b);
static void __lambda6_ (AvatarCacheTests* self, GObject* object, GAsyncResult* _result_);
static void ___lambda6__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
static void _____lambda7_ (Block3Data* _data3_, GObject* obj, GAsyncResult* res);
static void ______lambda7__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static gboolean ___lambda8_ (AvatarCacheTests* self);
static gboolean ____lambda8__gsource_func (gpointer self);
static void avatar_cache_tests_finalize (GObject* obj);
gint _vala_main (gchar** args, int args_length1);


static void _avatar_cache_tests_test_store_and_load_avatar_folks_test_case_test_method (gpointer self) {
#line 43 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	avatar_cache_tests_test_store_and_load_avatar ((AvatarCacheTests*) self);
#line 144 "avatar-cache.c"
}


static void _avatar_cache_tests_test_store_avatar_overwrite_folks_test_case_test_method (gpointer self) {
#line 44 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	avatar_cache_tests_test_store_avatar_overwrite ((AvatarCacheTests*) self);
#line 151 "avatar-cache.c"
}


static void _avatar_cache_tests_test_store_many_avatars_folks_test_case_test_method (gpointer self) {
#line 46 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	avatar_cache_tests_test_store_many_avatars ((AvatarCacheTests*) self);
#line 158 "avatar-cache.c"
}


static void _avatar_cache_tests_test_load_avatar_non_existent_folks_test_case_test_method (gpointer self) {
#line 47 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	avatar_cache_tests_test_load_avatar_non_existent ((AvatarCacheTests*) self);
#line 165 "avatar-cache.c"
}


static void _avatar_cache_tests_test_remove_avatar_folks_test_case_test_method (gpointer self) {
#line 49 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	avatar_cache_tests_test_remove_avatar ((AvatarCacheTests*) self);
#line 172 "avatar-cache.c"
}


static void _avatar_cache_tests_test_remove_avatar_non_existent_folks_test_case_test_method (gpointer self) {
#line 50 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	avatar_cache_tests_test_remove_avatar_non_existent ((AvatarCacheTests*) self);
#line 179 "avatar-cache.c"
}


static void _avatar_cache_tests_test_build_uri_for_avatar_folks_test_case_test_method (gpointer self) {
#line 52 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	avatar_cache_tests_test_build_uri_for_avatar ((AvatarCacheTests*) self);
#line 186 "avatar-cache.c"
}


AvatarCacheTests* avatar_cache_tests_construct (GType object_type) {
	AvatarCacheTests * self = NULL;
	gchar* tmp_path = NULL;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	GFile* _tmp3_ = NULL;
#line 34 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	self = (AvatarCacheTests*) folks_test_case_construct (object_type, "AvatarCache");
#line 38 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp0_ = g_get_tmp_dir ();
#line 38 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp1_ = g_strconcat (_tmp0_, "/folks-avatar-cache-tests", NULL);
#line 38 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	tmp_path = _tmp1_;
#line 39 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_setenv ("XDG_CACHE_HOME", tmp_path, TRUE);
#line 40 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp2_ = g_get_user_cache_dir ();
#line 40 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_vala_assert (g_strcmp0 (_tmp2_, tmp_path) == 0, "Environment.get_user_cache_dir () == tmp_path");
#line 41 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp3_ = g_file_new_for_path (tmp_path);
#line 41 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_g_object_unref0 (self->priv->_cache_dir);
#line 41 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	self->priv->_cache_dir = _tmp3_;
#line 43 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	folks_test_case_add_test ((FolksTestCase*) self, "store-and-load-avatar", _avatar_cache_tests_test_store_and_load_avatar_folks_test_case_test_method, self);
#line 44 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	folks_test_case_add_test ((FolksTestCase*) self, "store-avatar-overwrite", _avatar_cache_tests_test_store_avatar_overwrite_folks_test_case_test_method, self);
#line 46 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	folks_test_case_add_test ((FolksTestCase*) self, "store-many-avatars", _avatar_cache_tests_test_store_many_avatars_folks_test_case_test_method, self);
#line 47 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	folks_test_case_add_test ((FolksTestCase*) self, "load-avatar-non-existent", _avatar_cache_tests_test_load_avatar_non_existent_folks_test_case_test_method, self);
#line 49 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	folks_test_case_add_test ((FolksTestCase*) self, "remove-avatar", _avatar_cache_tests_test_remove_avatar_folks_test_case_test_method, self);
#line 50 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	folks_test_case_add_test ((FolksTestCase*) self, "remove-avatar-non-existent", _avatar_cache_tests_test_remove_avatar_non_existent_folks_test_case_test_method, self);
#line 52 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	folks_test_case_add_test ((FolksTestCase*) self, "build-uri-for-avatar", _avatar_cache_tests_test_build_uri_for_avatar_folks_test_case_test_method, self);
#line 32 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_g_free0 (tmp_path);
#line 32 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	return self;
#line 235 "avatar-cache.c"
}


AvatarCacheTests* avatar_cache_tests_new (void) {
#line 32 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	return avatar_cache_tests_construct (TYPE_AVATAR_CACHE_TESTS);
#line 242 "avatar-cache.c"
}


static void avatar_cache_tests_real_set_up (FolksTestCase* base) {
	AvatarCacheTests * self;
	FolksAvatarCache* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	GFile* _tmp3_ = NULL;
	GFile* _tmp4_ = NULL;
	GFileIcon* _tmp5_ = NULL;
	GMainLoop* _tmp6_ = NULL;
#line 55 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	self = (AvatarCacheTests*) base;
#line 57 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	FOLKS_TEST_CASE_CLASS (avatar_cache_tests_parent_class)->set_up (G_TYPE_CHECK_INSTANCE_CAST (self, FOLKS_TYPE_TEST_CASE, FolksTestCase));
#line 58 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_avatar_cache_tests_delete_cache_directory (self);
#line 60 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp0_ = folks_avatar_cache_dup ();
#line 60 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_g_object_unref0 (self->priv->_cache);
#line 60 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	self->priv->_cache = _tmp0_;
#line 61 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp1_ = folks_test_utils_get_source_test_data ("data/avatar-01.jpg");
#line 61 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp2_ = _tmp1_;
#line 61 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp3_ = g_file_new_for_path (_tmp2_);
#line 61 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp4_ = _tmp3_;
#line 61 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp5_ = (GFileIcon*) g_file_icon_new (_tmp4_);
#line 61 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_g_object_unref0 (self->priv->_avatar);
#line 61 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	self->priv->_avatar = (GLoadableIcon*) _tmp5_;
#line 61 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_g_object_unref0 (_tmp4_);
#line 61 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_g_free0 (_tmp2_);
#line 65 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp6_ = g_main_loop_new (NULL, FALSE);
#line 65 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_g_main_loop_unref0 (self->priv->_main_loop);
#line 65 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	self->priv->_main_loop = _tmp6_;
#line 291 "avatar-cache.c"
}


static void avatar_cache_tests_real_tear_down (FolksTestCase* base) {
	AvatarCacheTests * self;
#line 68 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	self = (AvatarCacheTests*) base;
#line 70 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_g_main_loop_unref0 (self->priv->_main_loop);
#line 70 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	self->priv->_main_loop = NULL;
#line 71 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_g_object_unref0 (self->priv->_avatar);
#line 71 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	self->priv->_avatar = NULL;
#line 72 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_g_object_unref0 (self->priv->_cache);
#line 72 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	self->priv->_cache = NULL;
#line 73 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_avatar_cache_tests_delete_cache_directory (self);
#line 74 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	FOLKS_TEST_CASE_CLASS (avatar_cache_tests_parent_class)->tear_down (G_TYPE_CHECK_INSTANCE_CAST (self, FOLKS_TYPE_TEST_CASE, FolksTestCase));
#line 315 "avatar-cache.c"
}


void _avatar_cache_tests_delete_directory (AvatarCacheTests* self, GFile* dir, GError** error) {
	GFileEnumerator* enumerator = NULL;
	GFile* _tmp0_ = NULL;
	GFileEnumerator* _tmp1_ = NULL;
	GFileInfo* file_info = NULL;
	GFileEnumerator* _tmp2_ = NULL;
	GFileInfo* _tmp3_ = NULL;
	GFileEnumerator* _tmp17_ = NULL;
	GFile* _tmp18_ = NULL;
	GError * _inner_error_ = NULL;
#line 77 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_return_if_fail (self != NULL);
#line 77 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_return_if_fail (dir != NULL);
#line 80 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp0_ = dir;
#line 80 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp1_ = g_file_enumerate_children (_tmp0_, G_FILE_ATTRIBUTE_STANDARD_NAME, G_FILE_QUERY_INFO_NONE, NULL, &_inner_error_);
#line 80 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	enumerator = _tmp1_;
#line 80 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 80 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		g_propagate_error (error, _inner_error_);
#line 80 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		return;
#line 345 "avatar-cache.c"
	}
#line 84 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp2_ = enumerator;
#line 84 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp3_ = g_file_enumerator_next_file (_tmp2_, NULL, &_inner_error_);
#line 84 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	file_info = _tmp3_;
#line 84 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 84 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		g_propagate_error (error, _inner_error_);
#line 84 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_g_object_unref0 (enumerator);
#line 84 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		return;
#line 361 "avatar-cache.c"
	}
#line 85 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	while (TRUE) {
#line 365 "avatar-cache.c"
		GFileInfo* _tmp4_ = NULL;
		GFile* child_file = NULL;
		GFile* _tmp5_ = NULL;
		GFileInfo* _tmp6_ = NULL;
		const gchar* _tmp7_ = NULL;
		GFile* _tmp8_ = NULL;
		GFile* _tmp9_ = NULL;
		GFileType _tmp10_ = 0;
		GFileInfo* _tmp13_ = NULL;
		GFileEnumerator* _tmp14_ = NULL;
		GFileInfo* _tmp15_ = NULL;
		GFileInfo* _tmp16_ = NULL;
#line 85 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp4_ = file_info;
#line 85 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		if (!(_tmp4_ != NULL)) {
#line 85 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
			break;
#line 384 "avatar-cache.c"
		}
#line 87 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp5_ = dir;
#line 87 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp6_ = file_info;
#line 87 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp7_ = g_file_info_get_name (_tmp6_);
#line 87 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp8_ = g_file_get_child (_tmp5_, _tmp7_);
#line 87 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		child_file = _tmp8_;
#line 89 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp9_ = child_file;
#line 89 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp10_ = g_file_query_file_type (_tmp9_, G_FILE_QUERY_INFO_NONE, NULL);
#line 89 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		if (_tmp10_ == G_FILE_TYPE_DIRECTORY) {
#line 402 "avatar-cache.c"
			GFile* _tmp11_ = NULL;
#line 92 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
			_tmp11_ = child_file;
#line 92 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
			_avatar_cache_tests_delete_directory (self, _tmp11_, &_inner_error_);
#line 92 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 92 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				g_propagate_error (error, _inner_error_);
#line 92 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				_g_object_unref0 (child_file);
#line 92 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				_g_object_unref0 (file_info);
#line 92 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				_g_object_unref0 (enumerator);
#line 92 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				return;
#line 420 "avatar-cache.c"
			}
		} else {
			GFile* _tmp12_ = NULL;
#line 96 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
			_tmp12_ = child_file;
#line 96 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
			g_file_delete (_tmp12_, NULL, &_inner_error_);
#line 96 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 96 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				g_propagate_error (error, _inner_error_);
#line 96 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				_g_object_unref0 (child_file);
#line 96 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				_g_object_unref0 (file_info);
#line 96 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				_g_object_unref0 (enumerator);
#line 96 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				return;
#line 440 "avatar-cache.c"
			}
		}
#line 99 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp14_ = enumerator;
#line 99 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp15_ = g_file_enumerator_next_file (_tmp14_, NULL, &_inner_error_);
#line 99 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp13_ = _tmp15_;
#line 99 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 99 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
			g_propagate_error (error, _inner_error_);
#line 99 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
			_g_object_unref0 (child_file);
#line 99 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
			_g_object_unref0 (file_info);
#line 99 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
			_g_object_unref0 (enumerator);
#line 99 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
			return;
#line 461 "avatar-cache.c"
		}
#line 99 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp16_ = _tmp13_;
#line 99 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp13_ = NULL;
#line 99 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_g_object_unref0 (file_info);
#line 99 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		file_info = _tmp16_;
#line 85 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_g_object_unref0 (_tmp13_);
#line 85 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_g_object_unref0 (child_file);
#line 475 "avatar-cache.c"
	}
#line 101 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp17_ = enumerator;
#line 101 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_file_enumerator_close (_tmp17_, NULL, &_inner_error_);
#line 101 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 101 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		g_propagate_error (error, _inner_error_);
#line 101 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_g_object_unref0 (file_info);
#line 101 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_g_object_unref0 (enumerator);
#line 101 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		return;
#line 491 "avatar-cache.c"
	}
#line 104 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp18_ = dir;
#line 104 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_file_delete (_tmp18_, NULL, &_inner_error_);
#line 104 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 104 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		g_propagate_error (error, _inner_error_);
#line 104 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_g_object_unref0 (file_info);
#line 104 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_g_object_unref0 (enumerator);
#line 104 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		return;
#line 507 "avatar-cache.c"
	}
#line 77 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_g_object_unref0 (file_info);
#line 77 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_g_object_unref0 (enumerator);
#line 513 "avatar-cache.c"
}


void _avatar_cache_tests_delete_cache_directory (AvatarCacheTests* self) {
	GError * _inner_error_ = NULL;
#line 107 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_return_if_fail (self != NULL);
#line 521 "avatar-cache.c"
	{
		GFile* _tmp0_ = NULL;
#line 111 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp0_ = self->priv->_cache_dir;
#line 111 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_avatar_cache_tests_delete_directory (self, _tmp0_, &_inner_error_);
#line 111 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 530 "avatar-cache.c"
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
#line 109 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		e = _inner_error_;
#line 109 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_inner_error_ = NULL;
#line 109 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_g_error_free0 (e);
#line 544 "avatar-cache.c"
	}
	__finally0:
#line 109 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 109 "/opt/gnome3/source/folks/tests/folks/avatar-cache.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 109 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		g_clear_error (&_inner_error_);
#line 109 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		return;
#line 555 "avatar-cache.c"
	}
}


static void __lambda4_ (AvatarCacheTests* self, GObject* obj, GAsyncResult* res) {
	GMainLoop* _tmp5_ = NULL;
	GError * _inner_error_ = NULL;
#line 121 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_return_if_fail (res != NULL);
#line 565 "avatar-cache.c"
	{
		FolksAvatarCache* _tmp0_ = NULL;
		GAsyncResult* _tmp1_ = NULL;
		gchar* _tmp2_ = NULL;
		gchar* _tmp3_ = NULL;
#line 125 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp0_ = self->priv->_cache;
#line 125 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp1_ = res;
#line 125 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp2_ = folks_avatar_cache_store_avatar_finish (_tmp0_, _tmp1_, &_inner_error_);
#line 125 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp3_ = _tmp2_;
#line 125 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_g_free0 (_tmp3_);
#line 125 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 583 "avatar-cache.c"
			goto __catch1_g_error;
		}
	}
	goto __finally1;
	__catch1_g_error:
	{
		GError* e = NULL;
		const gchar* _tmp4_ = NULL;
#line 123 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		e = _inner_error_;
#line 123 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_inner_error_ = NULL;
#line 129 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp4_ = e->message;
#line 129 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		g_error ("avatar-cache.vala:129: Error storing avatar: %s", _tmp4_);
#line 123 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_g_error_free0 (e);
#line 602 "avatar-cache.c"
	}
	__finally1:
#line 123 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 123 "/opt/gnome3/source/folks/tests/folks/avatar-cache.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 123 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		g_clear_error (&_inner_error_);
#line 123 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		return;
#line 613 "avatar-cache.c"
	}
#line 132 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp5_ = self->priv->_main_loop;
#line 132 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_main_loop_quit (_tmp5_);
#line 619 "avatar-cache.c"
}


static void ___lambda4__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
#line 121 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	__lambda4_ ((AvatarCacheTests*) self, source_object, res);
#line 121 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_object_unref (self);
#line 628 "avatar-cache.c"
}


void _avatar_cache_tests_assert_store_avatar (AvatarCacheTests* self, const gchar* id, GLoadableIcon* avatar) {
	FolksAvatarCache* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	GLoadableIcon* _tmp2_ = NULL;
	GMainLoop* _tmp3_ = NULL;
#line 119 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_return_if_fail (self != NULL);
#line 119 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_return_if_fail (id != NULL);
#line 119 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_return_if_fail (avatar != NULL);
#line 121 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp0_ = self->priv->_cache;
#line 121 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp1_ = id;
#line 121 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp2_ = avatar;
#line 121 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	folks_avatar_cache_store_avatar (_tmp0_, _tmp1_, _tmp2_, ___lambda4__gasync_ready_callback, g_object_ref (self));
#line 135 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp3_ = self->priv->_main_loop;
#line 135 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_main_loop_run (_tmp3_);
#line 655 "avatar-cache.c"
}


static Block1Data* block1_data_ref (Block1Data* _data1_) {
#line 138 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_atomic_int_inc (&_data1_->_ref_count_);
#line 138 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	return _data1_;
#line 664 "avatar-cache.c"
}


static void block1_data_unref (void * _userdata_) {
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
#line 138 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
#line 673 "avatar-cache.c"
		AvatarCacheTests* self;
#line 138 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		self = _data1_->self;
#line 138 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_g_object_unref0 (_data1_->avatar);
#line 138 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_g_object_unref0 (self);
#line 138 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		g_slice_free (Block1Data, _data1_);
#line 683 "avatar-cache.c"
	}
}


static void __lambda5_ (Block1Data* _data1_, GObject* obj, GAsyncResult* res) {
	AvatarCacheTests* self;
	GMainLoop* _tmp6_ = NULL;
	GError * _inner_error_ = NULL;
#line 142 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	self = _data1_->self;
#line 142 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_return_if_fail (res != NULL);
#line 696 "avatar-cache.c"
	{
		GLoadableIcon* _tmp0_ = NULL;
		FolksAvatarCache* _tmp1_ = NULL;
		GAsyncResult* _tmp2_ = NULL;
		GLoadableIcon* _tmp3_ = NULL;
		GLoadableIcon* _tmp4_ = NULL;
#line 146 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp1_ = self->priv->_cache;
#line 146 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp2_ = res;
#line 146 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp3_ = folks_avatar_cache_load_avatar_finish (_tmp1_, _tmp2_, &_inner_error_);
#line 146 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp0_ = _tmp3_;
#line 146 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 713 "avatar-cache.c"
			goto __catch2_g_error;
		}
#line 146 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp4_ = _tmp0_;
#line 146 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp0_ = NULL;
#line 146 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_g_object_unref0 (_data1_->avatar);
#line 146 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_data1_->avatar = _tmp4_;
#line 144 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_g_object_unref0 (_tmp0_);
#line 726 "avatar-cache.c"
	}
	goto __finally2;
	__catch2_g_error:
	{
		GError* e = NULL;
		const gchar* _tmp5_ = NULL;
#line 144 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		e = _inner_error_;
#line 144 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_inner_error_ = NULL;
#line 150 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp5_ = e->message;
#line 150 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		g_error ("avatar-cache.vala:150: Error loading avatar: %s", _tmp5_);
#line 144 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_g_error_free0 (e);
#line 743 "avatar-cache.c"
	}
	__finally2:
#line 144 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 144 "/opt/gnome3/source/folks/tests/folks/avatar-cache.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 144 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		g_clear_error (&_inner_error_);
#line 144 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		return;
#line 754 "avatar-cache.c"
	}
#line 153 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp6_ = self->priv->_main_loop;
#line 153 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_main_loop_quit (_tmp6_);
#line 760 "avatar-cache.c"
}


static void ___lambda5__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
#line 142 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	__lambda5_ (self, source_object, res);
#line 142 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	block1_data_unref (self);
#line 769 "avatar-cache.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 158 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	return self ? g_object_ref (self) : NULL;
#line 776 "avatar-cache.c"
}


GLoadableIcon* _avatar_cache_tests_assert_load_avatar (AvatarCacheTests* self, const gchar* id) {
	GLoadableIcon* result = NULL;
	Block1Data* _data1_;
	FolksAvatarCache* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	GMainLoop* _tmp2_ = NULL;
	GLoadableIcon* _tmp3_ = NULL;
#line 138 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 138 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_return_val_if_fail (id != NULL, NULL);
#line 138 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_data1_ = g_slice_new0 (Block1Data);
#line 138 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_data1_->_ref_count_ = 1;
#line 138 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_data1_->self = g_object_ref (self);
#line 140 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_data1_->avatar = NULL;
#line 142 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp0_ = self->priv->_cache;
#line 142 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp1_ = id;
#line 142 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	folks_avatar_cache_load_avatar (_tmp0_, _tmp1_, ___lambda5__gasync_ready_callback, block1_data_ref (_data1_));
#line 156 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp2_ = self->priv->_main_loop;
#line 156 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_main_loop_run (_tmp2_);
#line 158 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp3_ = _g_object_ref0 (_data1_->avatar);
#line 158 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	result = _tmp3_;
#line 158 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	block1_data_unref (_data1_);
#line 158 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_data1_ = NULL;
#line 158 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	return result;
#line 819 "avatar-cache.c"
}


static void __lambda9_ (AvatarCacheTests* self, GObject* obj, GAsyncResult* res) {
	GMainLoop* _tmp3_ = NULL;
	GError * _inner_error_ = NULL;
#line 163 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_return_if_fail (res != NULL);
#line 828 "avatar-cache.c"
	{
		FolksAvatarCache* _tmp0_ = NULL;
		GAsyncResult* _tmp1_ = NULL;
#line 167 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp0_ = self->priv->_cache;
#line 167 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp1_ = res;
#line 167 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		folks_avatar_cache_remove_avatar_finish (_tmp0_, _tmp1_, &_inner_error_);
#line 167 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 840 "avatar-cache.c"
			goto __catch3_g_error;
		}
	}
	goto __finally3;
	__catch3_g_error:
	{
		GError* e = NULL;
		const gchar* _tmp2_ = NULL;
#line 165 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		e = _inner_error_;
#line 165 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_inner_error_ = NULL;
#line 171 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp2_ = e->message;
#line 171 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		g_error ("avatar-cache.vala:171: Error removing avatar: %s", _tmp2_);
#line 165 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_g_error_free0 (e);
#line 859 "avatar-cache.c"
	}
	__finally3:
#line 165 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 165 "/opt/gnome3/source/folks/tests/folks/avatar-cache.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 165 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		g_clear_error (&_inner_error_);
#line 165 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		return;
#line 870 "avatar-cache.c"
	}
#line 174 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp3_ = self->priv->_main_loop;
#line 174 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_main_loop_quit (_tmp3_);
#line 876 "avatar-cache.c"
}


static void ___lambda9__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
#line 163 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	__lambda9_ ((AvatarCacheTests*) self, source_object, res);
#line 163 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_object_unref (self);
#line 885 "avatar-cache.c"
}


void _avatar_cache_tests_assert_remove_avatar (AvatarCacheTests* self, const gchar* id) {
	FolksAvatarCache* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	GMainLoop* _tmp2_ = NULL;
#line 161 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_return_if_fail (self != NULL);
#line 161 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_return_if_fail (id != NULL);
#line 163 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp0_ = self->priv->_cache;
#line 163 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp1_ = id;
#line 163 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	folks_avatar_cache_remove_avatar (_tmp0_, _tmp1_, ___lambda9__gasync_ready_callback, g_object_ref (self));
#line 177 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp2_ = self->priv->_main_loop;
#line 177 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_main_loop_run (_tmp2_);
#line 907 "avatar-cache.c"
}


static void __lambda6_ (AvatarCacheTests* self, GObject* object, GAsyncResult* _result_) {
	GAsyncResult* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	GMainLoop* _tmp2_ = NULL;
#line 182 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_return_if_fail (_result_ != NULL);
#line 184 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp0_ = _result_;
#line 184 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp1_ = folks_test_utils_loadable_icons_content_equal_finish (_tmp0_);
#line 184 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_vala_assert (_tmp1_, "TestUtils.loadable_icons_content_equal.end (result)");
#line 185 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp2_ = self->priv->_main_loop;
#line 185 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_main_loop_quit (_tmp2_);
#line 927 "avatar-cache.c"
}


static void ___lambda6__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
#line 182 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	__lambda6_ ((AvatarCacheTests*) self, source_object, res);
#line 182 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_object_unref (self);
#line 936 "avatar-cache.c"
}


void _avatar_cache_tests_assert_avatars_equal (AvatarCacheTests* self, GLoadableIcon* a, GLoadableIcon* b) {
	GLoadableIcon* _tmp0_ = NULL;
	GLoadableIcon* _tmp1_ = NULL;
	GMainLoop* _tmp2_ = NULL;
#line 180 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_return_if_fail (self != NULL);
#line 180 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_return_if_fail (a != NULL);
#line 180 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_return_if_fail (b != NULL);
#line 182 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp0_ = a;
#line 182 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp1_ = b;
#line 182 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	folks_test_utils_loadable_icons_content_equal (_tmp0_, _tmp1_, -1, ___lambda6__gasync_ready_callback, g_object_ref (self));
#line 188 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp2_ = self->priv->_main_loop;
#line 188 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_main_loop_run (_tmp2_);
#line 960 "avatar-cache.c"
}


void avatar_cache_tests_test_store_and_load_avatar (AvatarCacheTests* self) {
	GLoadableIcon* _tmp0_ = NULL;
	GLoadableIcon* avatar = NULL;
	GLoadableIcon* _tmp1_ = NULL;
	GLoadableIcon* _tmp2_ = NULL;
#line 191 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_return_if_fail (self != NULL);
#line 194 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp0_ = self->priv->_avatar;
#line 194 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_avatar_cache_tests_assert_store_avatar (self, "test-store-avatar-id", _tmp0_);
#line 197 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp1_ = _avatar_cache_tests_assert_load_avatar (self, "test-store-avatar-id");
#line 197 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	avatar = _tmp1_;
#line 200 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_vala_assert (avatar != NULL, "avatar != null");
#line 201 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_vala_assert (G_TYPE_CHECK_INSTANCE_TYPE (avatar, g_loadable_icon_get_type ()), "avatar is LoadableIcon");
#line 202 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp2_ = self->priv->_avatar;
#line 202 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_avatar_cache_tests_assert_avatars_equal (self, _tmp2_, avatar);
#line 191 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_g_object_unref0 (avatar);
#line 989 "avatar-cache.c"
}


void avatar_cache_tests_test_store_avatar_overwrite (AvatarCacheTests* self) {
	GLoadableIcon* _tmp0_ = NULL;
	GLoadableIcon* _tmp1_ = NULL;
	GLoadableIcon* avatar = NULL;
	GLoadableIcon* _tmp2_ = NULL;
	GLoadableIcon* _tmp3_ = NULL;
#line 205 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_return_if_fail (self != NULL);
#line 208 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp0_ = self->priv->_avatar;
#line 208 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_avatar_cache_tests_assert_store_avatar (self, "test-store-avatar-ow-id", _tmp0_);
#line 209 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp1_ = self->priv->_avatar;
#line 209 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_avatar_cache_tests_assert_store_avatar (self, "test-store-avatar-ow-id", _tmp1_);
#line 212 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp2_ = _avatar_cache_tests_assert_load_avatar (self, "test-store-avatar-ow-id");
#line 212 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	avatar = _tmp2_;
#line 215 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_vala_assert (avatar != NULL, "avatar != null");
#line 216 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_vala_assert (G_TYPE_CHECK_INSTANCE_TYPE (avatar, g_loadable_icon_get_type ()), "avatar is LoadableIcon");
#line 217 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp3_ = self->priv->_avatar;
#line 217 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_avatar_cache_tests_assert_avatars_equal (self, _tmp3_, avatar);
#line 205 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_g_object_unref0 (avatar);
#line 1023 "avatar-cache.c"
}


static Block2Data* block2_data_ref (Block2Data* _data2_) {
#line 220 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_atomic_int_inc (&_data2_->_ref_count_);
#line 220 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	return _data2_;
#line 1032 "avatar-cache.c"
}


static void block2_data_unref (void * _userdata_) {
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
#line 220 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
#line 1041 "avatar-cache.c"
		AvatarCacheTests* self;
#line 220 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		self = _data2_->self;
#line 220 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_g_object_unref0 (self);
#line 220 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		g_slice_free (Block2Data, _data2_);
#line 1049 "avatar-cache.c"
	}
}


static Block3Data* block3_data_ref (Block3Data* _data3_) {
#line 227 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_atomic_int_inc (&_data3_->_ref_count_);
#line 227 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	return _data3_;
#line 1059 "avatar-cache.c"
}


static void block3_data_unref (void * _userdata_) {
	Block3Data* _data3_;
	_data3_ = (Block3Data*) _userdata_;
#line 227 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
#line 1068 "avatar-cache.c"
		AvatarCacheTests* self;
#line 227 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		self = _data3_->_data2_->self;
#line 227 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		block2_data_unref (_data3_->_data2_);
#line 227 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_data3_->_data2_ = NULL;
#line 227 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		g_slice_free (Block3Data, _data3_);
#line 1078 "avatar-cache.c"
	}
}


static void _____lambda7_ (Block3Data* _data3_, GObject* obj, GAsyncResult* res) {
	Block2Data* _data2_;
	AvatarCacheTests* self;
	GError * _inner_error_ = NULL;
#line 231 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_data2_ = _data3_->_data2_;
#line 231 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	self = _data2_->self;
#line 231 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_return_if_fail (res != NULL);
#line 1093 "avatar-cache.c"
	{
		FolksAvatarCache* _tmp0_ = NULL;
		GAsyncResult* _tmp1_ = NULL;
		gchar* _tmp2_ = NULL;
		gchar* _tmp3_ = NULL;
		guint _tmp4_ = 0U;
#line 235 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp0_ = self->priv->_cache;
#line 235 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp1_ = res;
#line 235 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp2_ = folks_avatar_cache_store_avatar_finish (_tmp0_, _tmp1_, &_inner_error_);
#line 235 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp3_ = _tmp2_;
#line 235 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_g_free0 (_tmp3_);
#line 235 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1112 "avatar-cache.c"
			goto __catch4_g_error;
		}
#line 236 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp4_ = _data2_->n_remaining;
#line 236 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_data2_->n_remaining = _tmp4_ - 1;
#line 1119 "avatar-cache.c"
	}
	goto __finally4;
	__catch4_g_error:
	{
		GError* e = NULL;
		guint _tmp5_ = 0U;
		const gchar* _tmp6_ = NULL;
#line 233 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		e = _inner_error_;
#line 233 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_inner_error_ = NULL;
#line 240 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp5_ = _data3_->i;
#line 240 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp6_ = e->message;
#line 240 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		g_error ("avatar-cache.vala:240: Error storing avatar %u: %s", _tmp5_, _tmp6_);
#line 233 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_g_error_free0 (e);
#line 1139 "avatar-cache.c"
	}
	__finally4:
#line 233 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 233 "/opt/gnome3/source/folks/tests/folks/avatar-cache.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 233 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		g_clear_error (&_inner_error_);
#line 233 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		return;
#line 1150 "avatar-cache.c"
	}
}


static void ______lambda7__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
#line 231 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_____lambda7_ (self, source_object, res);
#line 231 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	block3_data_unref (self);
#line 1160 "avatar-cache.c"
}


static gboolean ___lambda8_ (AvatarCacheTests* self) {
	gboolean result = FALSE;
	GMainLoop* _tmp0_ = NULL;
#line 251 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp0_ = self->priv->_main_loop;
#line 251 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_main_loop_quit (_tmp0_);
#line 252 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	result = FALSE;
#line 252 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	return result;
#line 1175 "avatar-cache.c"
}


static gboolean ____lambda8__gsource_func (gpointer self) {
	gboolean result;
	result = ___lambda8_ ((AvatarCacheTests*) self);
#line 249 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	return result;
#line 1184 "avatar-cache.c"
}


void avatar_cache_tests_test_store_many_avatars (AvatarCacheTests* self) {
	Block2Data* _data2_;
#line 224 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	static const guint n_avatars = (guint) 1000;
#line 220 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_return_if_fail (self != NULL);
#line 220 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_data2_ = g_slice_new0 (Block2Data);
#line 220 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_data2_->_ref_count_ = 1;
#line 220 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_data2_->self = g_object_ref (self);
#line 225 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_data2_->n_remaining = n_avatars;
#line 1202 "avatar-cache.c"
	{
		Block3Data* _data3_;
#line 227 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_data3_ = g_slice_new0 (Block3Data);
#line 227 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_data3_->_ref_count_ = 1;
#line 227 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_data3_->_data2_ = block2_data_ref (_data2_);
#line 227 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_data3_->i = (guint) 0;
#line 1213 "avatar-cache.c"
		{
			gboolean _tmp0_ = FALSE;
#line 227 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
			_tmp0_ = TRUE;
#line 227 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
			while (TRUE) {
#line 1220 "avatar-cache.c"
				guint _tmp2_ = 0U;
				gchar* id = NULL;
				guint _tmp3_ = 0U;
				gchar* _tmp4_ = NULL;
				FolksAvatarCache* _tmp5_ = NULL;
				const gchar* _tmp6_ = NULL;
				GLoadableIcon* _tmp7_ = NULL;
#line 227 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				if (!_tmp0_) {
#line 1230 "avatar-cache.c"
					guint _tmp1_ = 0U;
#line 227 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
					_tmp1_ = _data3_->i;
#line 227 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
					_data3_->i = _tmp1_ + 1;
#line 1236 "avatar-cache.c"
				}
#line 227 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				_tmp0_ = FALSE;
#line 227 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				_tmp2_ = _data3_->i;
#line 227 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				if (!(_tmp2_ < n_avatars)) {
#line 227 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
					break;
#line 1246 "avatar-cache.c"
				}
#line 229 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				_tmp3_ = _data3_->i;
#line 229 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				_tmp4_ = g_strdup_printf ("test-store-many-avatars-%u", _tmp3_);
#line 229 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				id = _tmp4_;
#line 231 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				_tmp5_ = self->priv->_cache;
#line 231 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				_tmp6_ = id;
#line 231 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				_tmp7_ = self->priv->_avatar;
#line 231 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				folks_avatar_cache_store_avatar (_tmp5_, _tmp6_, _tmp7_, ______lambda7__gasync_ready_callback, block3_data_ref (_data3_));
#line 227 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				_g_free0 (id);
#line 1264 "avatar-cache.c"
			}
		}
#line 227 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		block3_data_unref (_data3_);
#line 227 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_data3_ = NULL;
#line 1271 "avatar-cache.c"
	}
#line 247 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	while (TRUE) {
#line 1275 "avatar-cache.c"
		guint _tmp8_ = 0U;
		GMainLoop* _tmp9_ = NULL;
#line 247 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp8_ = _data2_->n_remaining;
#line 247 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		if (!(_tmp8_ > ((guint) 0))) {
#line 247 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
			break;
#line 1284 "avatar-cache.c"
		}
#line 249 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ____lambda8__gsource_func, g_object_ref (self), g_object_unref);
#line 255 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		_tmp9_ = self->priv->_main_loop;
#line 255 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		g_main_loop_run (_tmp9_);
#line 1292 "avatar-cache.c"
	}
	{
		guint i = 0U;
#line 259 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
		i = (guint) 0;
#line 1298 "avatar-cache.c"
		{
			gboolean _tmp10_ = FALSE;
#line 259 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
			_tmp10_ = TRUE;
#line 259 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
			while (TRUE) {
#line 1305 "avatar-cache.c"
				guint _tmp12_ = 0U;
				gchar* id = NULL;
				guint _tmp13_ = 0U;
				gchar* _tmp14_ = NULL;
				GLoadableIcon* avatar = NULL;
				const gchar* _tmp15_ = NULL;
				GLoadableIcon* _tmp16_ = NULL;
				GLoadableIcon* _tmp17_ = NULL;
				GLoadableIcon* _tmp18_ = NULL;
				GLoadableIcon* _tmp19_ = NULL;
				GLoadableIcon* _tmp20_ = NULL;
#line 259 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				if (!_tmp10_) {
#line 1319 "avatar-cache.c"
					guint _tmp11_ = 0U;
#line 259 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
					_tmp11_ = i;
#line 259 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
					i = _tmp11_ + 1;
#line 1325 "avatar-cache.c"
				}
#line 259 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				_tmp10_ = FALSE;
#line 259 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				_tmp12_ = i;
#line 259 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				if (!(_tmp12_ < n_avatars)) {
#line 259 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
					break;
#line 1335 "avatar-cache.c"
				}
#line 261 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				_tmp13_ = i;
#line 261 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				_tmp14_ = g_strdup_printf ("test-store-many-avatars-%u", _tmp13_);
#line 261 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				id = _tmp14_;
#line 262 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				_tmp15_ = id;
#line 262 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				_tmp16_ = _avatar_cache_tests_assert_load_avatar (self, _tmp15_);
#line 262 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				avatar = _tmp16_;
#line 264 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				_tmp17_ = avatar;
#line 264 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				_vala_assert (_tmp17_ != NULL, "avatar != null");
#line 265 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				_tmp18_ = avatar;
#line 265 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				_vala_assert (G_TYPE_CHECK_INSTANCE_TYPE (_tmp18_, g_loadable_icon_get_type ()), "avatar is LoadableIcon");
#line 266 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				_tmp19_ = self->priv->_avatar;
#line 266 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				_tmp20_ = avatar;
#line 266 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				_avatar_cache_tests_assert_avatars_equal (self, _tmp19_, _tmp20_);
#line 259 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				_g_object_unref0 (avatar);
#line 259 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
				_g_free0 (id);
#line 1367 "avatar-cache.c"
			}
		}
	}
#line 220 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	block2_data_unref (_data2_);
#line 220 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_data2_ = NULL;
#line 1375 "avatar-cache.c"
}


void avatar_cache_tests_test_load_avatar_non_existent (AvatarCacheTests* self) {
	GLoadableIcon* avatar = NULL;
	GLoadableIcon* _tmp0_ = NULL;
#line 270 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_return_if_fail (self != NULL);
#line 273 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp0_ = _avatar_cache_tests_assert_load_avatar (self, "test-load-avatar-non-existent");
#line 273 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	avatar = _tmp0_;
#line 274 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_vala_assert (avatar == NULL, "avatar == null");
#line 270 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_g_object_unref0 (avatar);
#line 1392 "avatar-cache.c"
}


void avatar_cache_tests_test_remove_avatar (AvatarCacheTests* self) {
	GLoadableIcon* avatar = NULL;
	GLoadableIcon* _tmp0_ = NULL;
	GLoadableIcon* _tmp1_ = NULL;
	GLoadableIcon* _tmp2_ = NULL;
	GLoadableIcon* _tmp3_ = NULL;
	GLoadableIcon* _tmp4_ = NULL;
#line 277 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_return_if_fail (self != NULL);
#line 279 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	avatar = NULL;
#line 282 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp0_ = self->priv->_avatar;
#line 282 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_avatar_cache_tests_assert_store_avatar (self, "test-remove-avatar", _tmp0_);
#line 285 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp1_ = _avatar_cache_tests_assert_load_avatar (self, "test-remove-avatar");
#line 285 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_g_object_unref0 (avatar);
#line 285 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	avatar = _tmp1_;
#line 286 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp2_ = avatar;
#line 286 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_vala_assert (_tmp2_ != NULL, "avatar != null");
#line 289 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_avatar_cache_tests_assert_remove_avatar (self, "test-remove-avatar");
#line 292 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp3_ = _avatar_cache_tests_assert_load_avatar (self, "test-remove-avatar");
#line 292 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_g_object_unref0 (avatar);
#line 292 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	avatar = _tmp3_;
#line 293 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp4_ = avatar;
#line 293 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_vala_assert (_tmp4_ == NULL, "avatar == null");
#line 277 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_g_object_unref0 (avatar);
#line 1435 "avatar-cache.c"
}


void avatar_cache_tests_test_remove_avatar_non_existent (AvatarCacheTests* self) {
	GLoadableIcon* avatar = NULL;
	GLoadableIcon* _tmp0_ = NULL;
#line 296 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_return_if_fail (self != NULL);
#line 299 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp0_ = _avatar_cache_tests_assert_load_avatar (self, "test-remove-avatar-non-existent");
#line 299 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	avatar = _tmp0_;
#line 300 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_vala_assert (avatar == NULL, "avatar == null");
#line 303 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_avatar_cache_tests_assert_remove_avatar (self, "test-remove-avatar-non-existent");
#line 296 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_g_object_unref0 (avatar);
#line 1454 "avatar-cache.c"
}


void avatar_cache_tests_test_build_uri_for_avatar (AvatarCacheTests* self) {
	gchar* uri = NULL;
	FolksAvatarCache* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
#line 306 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_return_if_fail (self != NULL);
#line 309 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp0_ = self->priv->_cache;
#line 309 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp1_ = folks_avatar_cache_build_uri_for_avatar (_tmp0_, "test-id");
#line 309 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	uri = _tmp1_;
#line 310 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_vala_assert (uri != NULL, "uri != null");
#line 311 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp2_ = g_uri_parse_scheme (uri);
#line 311 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp3_ = _tmp2_;
#line 311 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_vala_assert (_tmp3_ != NULL, "Uri.parse_scheme (uri) != null");
#line 311 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_g_free0 (_tmp3_);
#line 306 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_g_free0 (uri);
#line 1484 "avatar-cache.c"
}


static void avatar_cache_tests_class_init (AvatarCacheTestsClass * klass) {
#line 25 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	avatar_cache_tests_parent_class = g_type_class_peek_parent (klass);
#line 25 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_type_class_add_private (klass, sizeof (AvatarCacheTestsPrivate));
#line 25 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	((FolksTestCaseClass *) klass)->set_up = avatar_cache_tests_real_set_up;
#line 25 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	((FolksTestCaseClass *) klass)->tear_down = avatar_cache_tests_real_tear_down;
#line 25 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	G_OBJECT_CLASS (klass)->finalize = avatar_cache_tests_finalize;
#line 1499 "avatar-cache.c"
}


static void avatar_cache_tests_instance_init (AvatarCacheTests * self) {
#line 25 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	self->priv = AVATAR_CACHE_TESTS_GET_PRIVATE (self);
#line 1506 "avatar-cache.c"
}


static void avatar_cache_tests_finalize (GObject* obj) {
	AvatarCacheTests * self;
#line 25 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_AVATAR_CACHE_TESTS, AvatarCacheTests);
#line 27 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_g_object_unref0 (self->priv->_cache);
#line 28 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_g_object_unref0 (self->priv->_cache_dir);
#line 29 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_g_object_unref0 (self->priv->_avatar);
#line 30 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_g_main_loop_unref0 (self->priv->_main_loop);
#line 25 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	G_OBJECT_CLASS (avatar_cache_tests_parent_class)->finalize (obj);
#line 1524 "avatar-cache.c"
}


GType avatar_cache_tests_get_type (void) {
	static volatile gsize avatar_cache_tests_type_id__volatile = 0;
	if (g_once_init_enter (&avatar_cache_tests_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (AvatarCacheTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) avatar_cache_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (AvatarCacheTests), 0, (GInstanceInitFunc) avatar_cache_tests_instance_init, NULL };
		GType avatar_cache_tests_type_id;
		avatar_cache_tests_type_id = g_type_register_static (FOLKS_TYPE_TEST_CASE, "AvatarCacheTests", &g_define_type_info, 0);
		g_once_init_leave (&avatar_cache_tests_type_id__volatile, avatar_cache_tests_type_id);
	}
	return avatar_cache_tests_type_id__volatile;
}


gint _vala_main (gchar** args, int args_length1) {
	gint result = 0;
	AvatarCacheTests* tests = NULL;
	AvatarCacheTests* _tmp0_ = NULL;
#line 317 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_test_init (&args_length1, &args, NULL);
#line 319 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_tmp0_ = avatar_cache_tests_new ();
#line 319 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	tests = _tmp0_;
#line 320 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	folks_test_case_register ((FolksTestCase*) tests);
#line 321 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	g_test_run ();
#line 322 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	folks_test_case_final_tear_down ((FolksTestCase*) tests);
#line 324 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	result = 0;
#line 324 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	_g_object_unref0 (tests);
#line 324 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	return result;
#line 1562 "avatar-cache.c"
}


int main (int argc, char ** argv) {
#if !GLIB_CHECK_VERSION (2,35,0)
	g_type_init ();
#endif
#line 315 "/opt/gnome3/source/folks/tests/folks/avatar-cache.vala"
	return _vala_main (argv, argc);
#line 1572 "avatar-cache.c"
}



