/* test-vala-lang.c generated by valac 0.17.2.18-57ff, the Vala compiler
 * generated from test-vala-lang.vala, do not modify */


#include <glib.h>
#include <glib-object.h>
#include "libsecret/secret.h"
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include "mock-service.h"

#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 _TestLookupAsyncExData TestLookupAsyncExData;
typedef struct _Block1Data Block1Data;
#define _g_main_loop_unref0(var) ((var == NULL) ? NULL : (var = (g_main_loop_unref (var), NULL)))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
typedef struct _TestStoreAsyncExData TestStoreAsyncExData;
typedef struct _Block2Data Block2Data;
typedef struct _TestRemoveAsyncExData TestRemoveAsyncExData;
typedef struct _Block3Data Block3Data;
#define __vala_SecretSchema_free0(var) ((var == NULL) ? NULL : (var = (_vala_SecretSchema_free (var), NULL)))
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _TestLookupAsyncExData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	SecretSchema* _tmp0_;
	gchar* _tmp1_;
	gchar* password;
	GError* e;
	const gchar* _tmp2_;
	GError * _inner_error_;
};

struct _Block1Data {
	int _ref_count_;
	GMainLoop* loop;
};

struct _TestStoreAsyncExData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	GHashTable* _tmp2_;
	GHashTable* attributes;
	GHashTable* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	GHashTable* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	GHashTable* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	SecretSchema* _tmp12_;
	GHashTable* _tmp13_;
	gchar* _tmp14_;
	gchar* password;
	const gchar* _tmp15_;
	SecretSchema* _tmp16_;
	GHashTable* _tmp17_;
	gboolean _tmp18_;
	gboolean stored;
	gboolean _tmp19_;
	SecretSchema* _tmp20_;
	GHashTable* _tmp21_;
	gchar* _tmp22_;
	gchar* _tmp23_;
	const gchar* _tmp24_;
	GError* e;
	const gchar* _tmp25_;
	GError * _inner_error_;
};

struct _Block2Data {
	int _ref_count_;
	GMainLoop* loop;
};

struct _TestRemoveAsyncExData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	GHashTable* _tmp2_;
	GHashTable* attributes;
	GHashTable* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	GHashTable* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	GHashTable* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	SecretSchema* _tmp12_;
	GHashTable* _tmp13_;
	gchar* _tmp14_;
	gchar* password;
	const gchar* _tmp15_;
	SecretSchema* _tmp16_;
	GHashTable* _tmp17_;
	gboolean _tmp18_;
	gboolean removed;
	gboolean _tmp19_;
	SecretSchema* _tmp20_;
	GHashTable* _tmp21_;
	gchar* _tmp22_;
	gchar* _tmp23_;
	const gchar* _tmp24_;
	GError* e;
	const gchar* _tmp25_;
	GError * _inner_error_;
};

struct _Block3Data {
	int _ref_count_;
	GMainLoop* loop;
};


extern SecretSchema* schema;
SecretSchema* schema = NULL;
extern SecretSchema* no_name_schema;
SecretSchema* no_name_schema = NULL;

void test_lookup_sync (void);
static void test_lookup_async_ex_data_free (gpointer _data);
void test_lookup_async_ex (GAsyncReadyCallback _callback_, gpointer _user_data_);
void test_lookup_async_ex_finish (GAsyncResult* _res_);
static gboolean test_lookup_async_ex_co (TestLookupAsyncExData* _data_);
static void test_lookup_async_ex_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
void test_lookup_async (void);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static void __lambda2_ (Block1Data* _data1_, GObject* obj, GAsyncResult* async_res);
static void ___lambda2__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
void test_lookup_no_name (void);
void test_store_sync (void);
static void _g_free0_ (gpointer var);
static void test_store_async_ex_data_free (gpointer _data);
void test_store_async_ex (GAsyncReadyCallback _callback_, gpointer _user_data_);
void test_store_async_ex_finish (GAsyncResult* _res_);
static gboolean test_store_async_ex_co (TestStoreAsyncExData* _data_);
static void test_store_async_ex_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
void test_store_async (void);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static void __lambda3_ (Block2Data* _data2_, GObject* obj, GAsyncResult* async_res);
static void ___lambda3__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
void test_remove_sync (void);
static void test_remove_async_ex_data_free (gpointer _data);
void test_remove_async_ex (GAsyncReadyCallback _callback_, gpointer _user_data_);
void test_remove_async_ex_finish (GAsyncResult* _res_);
static gboolean test_remove_async_ex_co (TestRemoveAsyncExData* _data_);
static void test_remove_async_ex_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
void test_remove_async (void);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
static void __lambda4_ (Block3Data* _data3_, GObject* obj, GAsyncResult* async_res);
static void ___lambda4__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
gint _vala_main (gchar** args, int args_length1);
static void _vala_SecretSchema_free (SecretSchema* self);
static void _test_lookup_sync_gtest_data_func (gpointer self);
static void _test_lookup_async_gtest_data_func (gpointer self);
static void _test_lookup_no_name_gtest_data_func (gpointer self);
static void _test_store_sync_gtest_data_func (gpointer self);
static void _test_store_async_gtest_data_func (gpointer self);
static void _test_remove_sync_gtest_data_func (gpointer self);
static void _test_remove_async_gtest_data_func (gpointer self);


void test_lookup_sync (void) {
	GError * _inner_error_ = NULL;
	{
		SecretSchema* _tmp0_;
		gchar* _tmp1_ = NULL;
		gchar* password;
		_tmp0_ = schema;
		_tmp1_ = secret_password_lookup_sync (_tmp0_, NULL, &_inner_error_, "even", FALSE, "string", "one", "number", 1, NULL);
		password = _tmp1_;
		if (_inner_error_ != NULL) {
			goto __catch0_g_error;
		}
		_vala_assert (g_strcmp0 (password, "111") == 0, "password == \"111\"");
		_g_free0 (password);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		const gchar* _tmp2_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp2_ = e->message;
		g_error ("test-vala-lang.vala:9: %s", _tmp2_);
		_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;
	}
}


static void test_lookup_async_ex_data_free (gpointer _data) {
	TestLookupAsyncExData* _data_;
	_data_ = _data;
	g_slice_free (TestLookupAsyncExData, _data_);
}


void test_lookup_async_ex (GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TestLookupAsyncExData* _data_;
	_data_ = g_slice_new0 (TestLookupAsyncExData);
	_data_->_async_result = g_simple_async_result_new (g_object_newv (G_TYPE_OBJECT, 0, NULL), _callback_, _user_data_, test_lookup_async_ex);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, test_lookup_async_ex_data_free);
	test_lookup_async_ex_co (_data_);
}


void test_lookup_async_ex_finish (GAsyncResult* _res_) {
	TestLookupAsyncExData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void test_lookup_async_ex_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TestLookupAsyncExData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	test_lookup_async_ex_co (_data_);
}


static gboolean test_lookup_async_ex_co (TestLookupAsyncExData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_tmp0_ = schema;
		_data_->_state_ = 1;
		secret_password_lookup (_data_->_tmp0_, NULL, test_lookup_async_ex_ready, _data_, "even", FALSE, "string", "one", "number", 1, NULL);
		return FALSE;
		_state_1:
		_data_->_tmp1_ = NULL;
		_data_->_tmp1_ = secret_password_lookup_finish (_data_->_res_, &_data_->_inner_error_);
		_data_->password = _data_->_tmp1_;
		if (_data_->_inner_error_ != NULL) {
			goto __catch1_g_error;
		}
		_vala_assert (g_strcmp0 (_data_->password, "111") == 0, "password == \"111\"");
		_g_free0 (_data_->password);
	}
	goto __finally1;
	__catch1_g_error:
	{
		_data_->e = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp2_ = _data_->e->message;
		g_error ("test-vala-lang.vala:18: %s", _data_->_tmp2_);
		_g_error_free0 (_data_->e);
	}
	__finally1:
	if (_data_->_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
		g_clear_error (&_data_->_inner_error_);
		return FALSE;
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


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


static void block1_data_unref (void * _userdata_) {
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		_g_main_loop_unref0 (_data1_->loop);
		g_slice_free (Block1Data, _data1_);
	}
}


static void __lambda2_ (Block1Data* _data1_, GObject* obj, GAsyncResult* async_res) {
	g_return_if_fail (async_res != NULL);
	g_main_loop_quit (_data1_->loop);
}


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


void test_lookup_async (void) {
	Block1Data* _data1_;
	GMainLoop* _tmp0_;
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	_tmp0_ = g_main_loop_new (NULL, FALSE);
	_data1_->loop = _tmp0_;
	test_lookup_async_ex (___lambda2__gasync_ready_callback, block1_data_ref (_data1_));
	g_main_loop_run (_data1_->loop);
	block1_data_unref (_data1_);
	_data1_ = NULL;
}


void test_lookup_no_name (void) {
	GError * _inner_error_ = NULL;
	{
		SecretSchema* _tmp0_;
		gchar* _tmp1_ = NULL;
		gchar* password;
		const gchar* _tmp2_;
		SecretSchema* _tmp3_;
		gchar* _tmp4_ = NULL;
		gchar* _tmp5_;
		const gchar* _tmp6_;
		_tmp0_ = schema;
		_tmp1_ = secret_password_lookup_sync (_tmp0_, NULL, &_inner_error_, "number", 5, NULL);
		password = _tmp1_;
		if (_inner_error_ != NULL) {
			goto __catch2_g_error;
		}
		_tmp2_ = password;
		_vala_assert (_tmp2_ == NULL, "password == null");
		_tmp3_ = no_name_schema;
		_tmp4_ = secret_password_lookup_sync (_tmp3_, NULL, &_inner_error_, "number", 5, NULL);
		_tmp5_ = _tmp4_;
		if (_inner_error_ != NULL) {
			_g_free0 (password);
			goto __catch2_g_error;
		}
		_g_free0 (password);
		password = _tmp5_;
		_tmp6_ = password;
		_vala_assert (g_strcmp0 (_tmp6_, "555") == 0, "password == \"555\"");
		_g_free0 (password);
	}
	goto __finally2;
	__catch2_g_error:
	{
		GError* e = NULL;
		const gchar* _tmp7_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp7_ = e->message;
		g_error ("test-vala-lang.vala:38: %s", _tmp7_);
		_g_error_free0 (e);
	}
	__finally2:
	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;
	}
}


static void _g_free0_ (gpointer var) {
	var = (g_free (var), NULL);
}


void test_store_sync (void) {
	GError * _inner_error_ = NULL;
	{
		GHashFunc _tmp0_;
		GEqualFunc _tmp1_;
		GHashTable* _tmp2_;
		GHashTable* attributes;
		GHashTable* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		GHashTable* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		GHashTable* _tmp9_;
		gchar* _tmp10_;
		gchar* _tmp11_;
		SecretSchema* _tmp12_;
		GHashTable* _tmp13_;
		gchar* _tmp14_ = NULL;
		gchar* password;
		const gchar* _tmp15_;
		SecretSchema* _tmp16_;
		GHashTable* _tmp17_;
		gboolean _tmp18_ = FALSE;
		gboolean stored;
		gboolean _tmp19_;
		SecretSchema* _tmp20_;
		GHashTable* _tmp21_;
		gchar* _tmp22_ = NULL;
		gchar* _tmp23_;
		const gchar* _tmp24_;
		_tmp0_ = g_str_hash;
		_tmp1_ = g_str_equal;
		_tmp2_ = g_hash_table_new_full (_tmp0_, _tmp1_, _g_free0_, _g_free0_);
		attributes = _tmp2_;
		_tmp3_ = attributes;
		_tmp4_ = g_strdup ("even");
		_tmp5_ = g_strdup ("false");
		g_hash_table_insert (_tmp3_, _tmp4_, _tmp5_);
		_tmp6_ = attributes;
		_tmp7_ = g_strdup ("string");
		_tmp8_ = g_strdup ("nine");
		g_hash_table_insert (_tmp6_, _tmp7_, _tmp8_);
		_tmp9_ = attributes;
		_tmp10_ = g_strdup ("number");
		_tmp11_ = g_strdup ("9");
		g_hash_table_insert (_tmp9_, _tmp10_, _tmp11_);
		_tmp12_ = schema;
		_tmp13_ = attributes;
		_tmp14_ = secret_password_lookupv_sync (_tmp12_, _tmp13_, NULL, &_inner_error_);
		password = _tmp14_;
		if (_inner_error_ != NULL) {
			_g_hash_table_unref0 (attributes);
			goto __catch3_g_error;
		}
		_tmp15_ = password;
		_vala_assert (_tmp15_ == NULL, "password == null");
		_tmp16_ = schema;
		_tmp17_ = attributes;
		_tmp18_ = secret_password_storev_sync (_tmp16_, _tmp17_, SECRET_COLLECTION_DEFAULT, "The number ", "999", NULL, &_inner_error_);
		stored = _tmp18_;
		if (_inner_error_ != NULL) {
			_g_free0 (password);
			_g_hash_table_unref0 (attributes);
			goto __catch3_g_error;
		}
		_tmp19_ = stored;
		_vala_assert (_tmp19_, "stored");
		_tmp20_ = schema;
		_tmp21_ = attributes;
		_tmp22_ = secret_password_lookupv_sync (_tmp20_, _tmp21_, NULL, &_inner_error_);
		_tmp23_ = _tmp22_;
		if (_inner_error_ != NULL) {
			_g_free0 (password);
			_g_hash_table_unref0 (attributes);
			goto __catch3_g_error;
		}
		_g_free0 (password);
		password = _tmp23_;
		_tmp24_ = password;
		_vala_assert (g_strcmp0 (_tmp24_, "999") == 0, "password == \"999\"");
		_g_free0 (password);
		_g_hash_table_unref0 (attributes);
	}
	goto __finally3;
	__catch3_g_error:
	{
		GError* e = NULL;
		const gchar* _tmp25_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp25_ = e->message;
		g_error ("test-vala-lang.vala:58: %s", _tmp25_);
		_g_error_free0 (e);
	}
	__finally3:
	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;
	}
}


static void test_store_async_ex_data_free (gpointer _data) {
	TestStoreAsyncExData* _data_;
	_data_ = _data;
	g_slice_free (TestStoreAsyncExData, _data_);
}


void test_store_async_ex (GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TestStoreAsyncExData* _data_;
	_data_ = g_slice_new0 (TestStoreAsyncExData);
	_data_->_async_result = g_simple_async_result_new (g_object_newv (G_TYPE_OBJECT, 0, NULL), _callback_, _user_data_, test_store_async_ex);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, test_store_async_ex_data_free);
	test_store_async_ex_co (_data_);
}


void test_store_async_ex_finish (GAsyncResult* _res_) {
	TestStoreAsyncExData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void test_store_async_ex_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TestStoreAsyncExData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	test_store_async_ex_co (_data_);
}


static gboolean test_store_async_ex_co (TestStoreAsyncExData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g_str_hash;
	_data_->_tmp1_ = g_str_equal;
	_data_->_tmp2_ = g_hash_table_new_full (_data_->_tmp0_, _data_->_tmp1_, _g_free0_, _g_free0_);
	_data_->attributes = _data_->_tmp2_;
	_data_->_tmp3_ = _data_->attributes;
	_data_->_tmp4_ = g_strdup ("even");
	_data_->_tmp5_ = g_strdup ("true");
	g_hash_table_insert (_data_->_tmp3_, _data_->_tmp4_, _data_->_tmp5_);
	_data_->_tmp6_ = _data_->attributes;
	_data_->_tmp7_ = g_strdup ("string");
	_data_->_tmp8_ = g_strdup ("eight");
	g_hash_table_insert (_data_->_tmp6_, _data_->_tmp7_, _data_->_tmp8_);
	_data_->_tmp9_ = _data_->attributes;
	_data_->_tmp10_ = g_strdup ("number");
	_data_->_tmp11_ = g_strdup ("8");
	g_hash_table_insert (_data_->_tmp9_, _data_->_tmp10_, _data_->_tmp11_);
	{
		_data_->_tmp12_ = schema;
		_data_->_tmp13_ = _data_->attributes;
		_data_->_state_ = 1;
		secret_password_lookupv (_data_->_tmp12_, _data_->_tmp13_, NULL, test_store_async_ex_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp14_ = NULL;
		_data_->_tmp14_ = secret_password_lookup_finish (_data_->_res_, &_data_->_inner_error_);
		_data_->password = _data_->_tmp14_;
		if (_data_->_inner_error_ != NULL) {
			goto __catch4_g_error;
		}
		_data_->_tmp15_ = _data_->password;
		_vala_assert (_data_->_tmp15_ == NULL, "password == null");
		_data_->_tmp16_ = schema;
		_data_->_tmp17_ = _data_->attributes;
		_data_->_state_ = 2;
		secret_password_storev (_data_->_tmp16_, _data_->_tmp17_, SECRET_COLLECTION_DEFAULT, "The number nine", "999", NULL, test_store_async_ex_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp18_ = FALSE;
		_data_->_tmp18_ = secret_password_store_finish (_data_->_res_, &_data_->_inner_error_);
		_data_->stored = _data_->_tmp18_;
		if (_data_->_inner_error_ != NULL) {
			_g_free0 (_data_->password);
			goto __catch4_g_error;
		}
		_data_->_tmp19_ = _data_->stored;
		_vala_assert (_data_->_tmp19_, "stored");
		_data_->_tmp20_ = schema;
		_data_->_tmp21_ = _data_->attributes;
		_data_->_state_ = 3;
		secret_password_lookupv (_data_->_tmp20_, _data_->_tmp21_, NULL, test_store_async_ex_ready, _data_);
		return FALSE;
		_state_3:
		_data_->_tmp22_ = NULL;
		_data_->_tmp22_ = secret_password_lookup_finish (_data_->_res_, &_data_->_inner_error_);
		_data_->_tmp23_ = _data_->_tmp22_;
		if (_data_->_inner_error_ != NULL) {
			_g_free0 (_data_->password);
			goto __catch4_g_error;
		}
		_g_free0 (_data_->password);
		_data_->password = _data_->_tmp23_;
		_data_->_tmp24_ = _data_->password;
		_vala_assert (g_strcmp0 (_data_->_tmp24_, "999") == 0, "password == \"999\"");
		_g_free0 (_data_->password);
	}
	goto __finally4;
	__catch4_g_error:
	{
		_data_->e = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp25_ = _data_->e->message;
		g_error ("test-vala-lang.vala:78: %s", _data_->_tmp25_);
		_g_error_free0 (_data_->e);
	}
	__finally4:
	if (_data_->_inner_error_ != NULL) {
		_g_hash_table_unref0 (_data_->attributes);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
		g_clear_error (&_data_->_inner_error_);
		return FALSE;
	}
	_g_hash_table_unref0 (_data_->attributes);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


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


static void block2_data_unref (void * _userdata_) {
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		_g_main_loop_unref0 (_data2_->loop);
		g_slice_free (Block2Data, _data2_);
	}
}


static void __lambda3_ (Block2Data* _data2_, GObject* obj, GAsyncResult* async_res) {
	g_return_if_fail (async_res != NULL);
	g_main_loop_quit (_data2_->loop);
}


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


void test_store_async (void) {
	Block2Data* _data2_;
	GMainLoop* _tmp0_;
	_data2_ = g_slice_new0 (Block2Data);
	_data2_->_ref_count_ = 1;
	_tmp0_ = g_main_loop_new (NULL, FALSE);
	_data2_->loop = _tmp0_;
	test_store_async_ex (___lambda3__gasync_ready_callback, block2_data_ref (_data2_));
	g_main_loop_run (_data2_->loop);
	block2_data_unref (_data2_);
	_data2_ = NULL;
}


void test_remove_sync (void) {
	GError * _inner_error_ = NULL;
	{
		GHashFunc _tmp0_;
		GEqualFunc _tmp1_;
		GHashTable* _tmp2_;
		GHashTable* attributes;
		GHashTable* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		GHashTable* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		GHashTable* _tmp9_;
		gchar* _tmp10_;
		gchar* _tmp11_;
		SecretSchema* _tmp12_;
		GHashTable* _tmp13_;
		gchar* _tmp14_ = NULL;
		gchar* password;
		const gchar* _tmp15_;
		SecretSchema* _tmp16_;
		GHashTable* _tmp17_;
		gboolean _tmp18_ = FALSE;
		gboolean removed;
		gboolean _tmp19_;
		SecretSchema* _tmp20_;
		GHashTable* _tmp21_;
		gchar* _tmp22_ = NULL;
		gchar* _tmp23_;
		const gchar* _tmp24_;
		_tmp0_ = g_str_hash;
		_tmp1_ = g_str_equal;
		_tmp2_ = g_hash_table_new_full (_tmp0_, _tmp1_, _g_free0_, _g_free0_);
		attributes = _tmp2_;
		_tmp3_ = attributes;
		_tmp4_ = g_strdup ("even");
		_tmp5_ = g_strdup ("false");
		g_hash_table_insert (_tmp3_, _tmp4_, _tmp5_);
		_tmp6_ = attributes;
		_tmp7_ = g_strdup ("string");
		_tmp8_ = g_strdup ("nine");
		g_hash_table_insert (_tmp6_, _tmp7_, _tmp8_);
		_tmp9_ = attributes;
		_tmp10_ = g_strdup ("number");
		_tmp11_ = g_strdup ("9");
		g_hash_table_insert (_tmp9_, _tmp10_, _tmp11_);
		_tmp12_ = schema;
		_tmp13_ = attributes;
		_tmp14_ = secret_password_lookupv_sync (_tmp12_, _tmp13_, NULL, &_inner_error_);
		password = _tmp14_;
		if (_inner_error_ != NULL) {
			_g_hash_table_unref0 (attributes);
			goto __catch5_g_error;
		}
		_tmp15_ = password;
		_vala_assert (g_strcmp0 (_tmp15_, "999") == 0, "password == \"999\"");
		_tmp16_ = schema;
		_tmp17_ = attributes;
		_tmp18_ = secret_password_removev_sync (_tmp16_, _tmp17_, NULL, &_inner_error_);
		removed = _tmp18_;
		if (_inner_error_ != NULL) {
			_g_free0 (password);
			_g_hash_table_unref0 (attributes);
			goto __catch5_g_error;
		}
		_tmp19_ = removed;
		_vala_assert (_tmp19_, "removed");
		_tmp20_ = schema;
		_tmp21_ = attributes;
		_tmp22_ = secret_password_lookupv_sync (_tmp20_, _tmp21_, NULL, &_inner_error_);
		_tmp23_ = _tmp22_;
		if (_inner_error_ != NULL) {
			_g_free0 (password);
			_g_hash_table_unref0 (attributes);
			goto __catch5_g_error;
		}
		_g_free0 (password);
		password = _tmp23_;
		_tmp24_ = password;
		_vala_assert (_tmp24_ == NULL, "password == null");
		_g_free0 (password);
		_g_hash_table_unref0 (attributes);
	}
	goto __finally5;
	__catch5_g_error:
	{
		GError* e = NULL;
		const gchar* _tmp25_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp25_ = e->message;
		g_error ("test-vala-lang.vala:106: %s", _tmp25_);
		_g_error_free0 (e);
	}
	__finally5:
	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;
	}
}


static void test_remove_async_ex_data_free (gpointer _data) {
	TestRemoveAsyncExData* _data_;
	_data_ = _data;
	g_slice_free (TestRemoveAsyncExData, _data_);
}


void test_remove_async_ex (GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TestRemoveAsyncExData* _data_;
	_data_ = g_slice_new0 (TestRemoveAsyncExData);
	_data_->_async_result = g_simple_async_result_new (g_object_newv (G_TYPE_OBJECT, 0, NULL), _callback_, _user_data_, test_remove_async_ex);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, test_remove_async_ex_data_free);
	test_remove_async_ex_co (_data_);
}


void test_remove_async_ex_finish (GAsyncResult* _res_) {
	TestRemoveAsyncExData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void test_remove_async_ex_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TestRemoveAsyncExData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	test_remove_async_ex_co (_data_);
}


static gboolean test_remove_async_ex_co (TestRemoveAsyncExData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g_str_hash;
	_data_->_tmp1_ = g_str_equal;
	_data_->_tmp2_ = g_hash_table_new_full (_data_->_tmp0_, _data_->_tmp1_, _g_free0_, _g_free0_);
	_data_->attributes = _data_->_tmp2_;
	_data_->_tmp3_ = _data_->attributes;
	_data_->_tmp4_ = g_strdup ("even");
	_data_->_tmp5_ = g_strdup ("true");
	g_hash_table_insert (_data_->_tmp3_, _data_->_tmp4_, _data_->_tmp5_);
	_data_->_tmp6_ = _data_->attributes;
	_data_->_tmp7_ = g_strdup ("string");
	_data_->_tmp8_ = g_strdup ("eight");
	g_hash_table_insert (_data_->_tmp6_, _data_->_tmp7_, _data_->_tmp8_);
	_data_->_tmp9_ = _data_->attributes;
	_data_->_tmp10_ = g_strdup ("number");
	_data_->_tmp11_ = g_strdup ("8");
	g_hash_table_insert (_data_->_tmp9_, _data_->_tmp10_, _data_->_tmp11_);
	{
		_data_->_tmp12_ = schema;
		_data_->_tmp13_ = _data_->attributes;
		_data_->_state_ = 1;
		secret_password_lookupv (_data_->_tmp12_, _data_->_tmp13_, NULL, test_remove_async_ex_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp14_ = NULL;
		_data_->_tmp14_ = secret_password_lookup_finish (_data_->_res_, &_data_->_inner_error_);
		_data_->password = _data_->_tmp14_;
		if (_data_->_inner_error_ != NULL) {
			goto __catch6_g_error;
		}
		_data_->_tmp15_ = _data_->password;
		_vala_assert (g_strcmp0 (_data_->_tmp15_, "999") == 0, "password == \"999\"");
		_data_->_tmp16_ = schema;
		_data_->_tmp17_ = _data_->attributes;
		_data_->_state_ = 2;
		secret_password_removev (_data_->_tmp16_, _data_->_tmp17_, NULL, test_remove_async_ex_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp18_ = FALSE;
		_data_->_tmp18_ = secret_password_remove_finish (_data_->_res_, &_data_->_inner_error_);
		_data_->removed = _data_->_tmp18_;
		if (_data_->_inner_error_ != NULL) {
			_g_free0 (_data_->password);
			goto __catch6_g_error;
		}
		_data_->_tmp19_ = _data_->removed;
		_vala_assert (_data_->_tmp19_, "removed");
		_data_->_tmp20_ = schema;
		_data_->_tmp21_ = _data_->attributes;
		_data_->_state_ = 3;
		secret_password_lookupv (_data_->_tmp20_, _data_->_tmp21_, NULL, test_remove_async_ex_ready, _data_);
		return FALSE;
		_state_3:
		_data_->_tmp22_ = NULL;
		_data_->_tmp22_ = secret_password_lookup_finish (_data_->_res_, &_data_->_inner_error_);
		_data_->_tmp23_ = _data_->_tmp22_;
		if (_data_->_inner_error_ != NULL) {
			_g_free0 (_data_->password);
			goto __catch6_g_error;
		}
		_g_free0 (_data_->password);
		_data_->password = _data_->_tmp23_;
		_data_->_tmp24_ = _data_->password;
		_vala_assert (_data_->_tmp24_ == NULL, "password == null");
		_g_free0 (_data_->password);
	}
	goto __finally6;
	__catch6_g_error:
	{
		_data_->e = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp25_ = _data_->e->message;
		g_error ("test-vala-lang.vala:126: %s", _data_->_tmp25_);
		_g_error_free0 (_data_->e);
	}
	__finally6:
	if (_data_->_inner_error_ != NULL) {
		_g_hash_table_unref0 (_data_->attributes);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
		g_clear_error (&_data_->_inner_error_);
		return FALSE;
	}
	_g_hash_table_unref0 (_data_->attributes);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


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


static void block3_data_unref (void * _userdata_) {
	Block3Data* _data3_;
	_data3_ = (Block3Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
		_g_main_loop_unref0 (_data3_->loop);
		g_slice_free (Block3Data, _data3_);
	}
}


static void __lambda4_ (Block3Data* _data3_, GObject* obj, GAsyncResult* async_res) {
	g_return_if_fail (async_res != NULL);
	g_main_loop_quit (_data3_->loop);
}


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


void test_remove_async (void) {
	Block3Data* _data3_;
	GMainLoop* _tmp0_;
	_data3_ = g_slice_new0 (Block3Data);
	_data3_->_ref_count_ = 1;
	_tmp0_ = g_main_loop_new (NULL, FALSE);
	_data3_->loop = _tmp0_;
	test_remove_async_ex (___lambda4__gasync_ready_callback, block3_data_ref (_data3_));
	g_main_loop_run (_data3_->loop);
	block3_data_unref (_data3_);
	_data3_ = NULL;
}


static void _vala_SecretSchema_free (SecretSchema* self) {
	g_boxed_free (secret_schema_get_type (), self);
}


static void _test_lookup_sync_gtest_data_func (gpointer self) {
	test_lookup_sync ();
}


static void _test_lookup_async_gtest_data_func (gpointer self) {
	test_lookup_async ();
}


static void _test_lookup_no_name_gtest_data_func (gpointer self) {
	test_lookup_no_name ();
}


static void _test_store_sync_gtest_data_func (gpointer self) {
	test_store_sync ();
}


static void _test_store_async_gtest_data_func (gpointer self) {
	test_store_async ();
}


static void _test_remove_sync_gtest_data_func (gpointer self) {
	test_remove_sync ();
}


static void _test_remove_async_gtest_data_func (gpointer self) {
	test_remove_async ();
}


gint _vala_main (gchar** args, int args_length1) {
	gint result = 0;
	gint _tmp3_ = 0;
	gint res;
	GError * _inner_error_ = NULL;
	g_test_init (&args_length1, &args, NULL);
	{
		mock_service_start ("mock-service-normal.py", &_inner_error_);
		if (_inner_error_ != NULL) {
			goto __catch7_g_error;
		}
	}
	goto __finally7;
	__catch7_g_error:
	{
		GError* e = NULL;
		const gchar* _tmp0_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp0_ = e->message;
		g_error ("test-vala-lang.vala:144: Unable to start mock service: %s", _tmp0_);
		_g_error_free0 (e);
	}
	__finally7:
	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 0;
	}
	{
		SecretSchema* _tmp1_;
		SecretSchema* _tmp2_;
		_tmp1_ = secret_schema_new ("org.mock.Schema", SECRET_SCHEMA_NONE, "number", SECRET_SCHEMA_ATTRIBUTE_INTEGER, "string", SECRET_SCHEMA_ATTRIBUTE_STRING, "even", SECRET_SCHEMA_ATTRIBUTE_BOOLEAN, NULL);
		__vala_SecretSchema_free0 (schema);
		schema = _tmp1_;
		_tmp2_ = secret_schema_new ("unused.Schema.Name", SECRET_SCHEMA_DONT_MATCH_NAME, "number", SECRET_SCHEMA_ATTRIBUTE_INTEGER, "string", SECRET_SCHEMA_ATTRIBUTE_STRING, NULL);
		__vala_SecretSchema_free0 (no_name_schema);
		no_name_schema = _tmp2_;
	}
	g_test_add_data_func ("/vala/lookup/sync", NULL, _test_lookup_sync_gtest_data_func);
	g_test_add_data_func ("/vala/lookup/async", NULL, _test_lookup_async_gtest_data_func);
	g_test_add_data_func ("/vala/lookup/no-name", NULL, _test_lookup_no_name_gtest_data_func);
	g_test_add_data_func ("/vala/store/sync", NULL, _test_store_sync_gtest_data_func);
	g_test_add_data_func ("/vala/store/async", NULL, _test_store_async_gtest_data_func);
	g_test_add_data_func ("/vala/remove/sync", NULL, _test_remove_sync_gtest_data_func);
	g_test_add_data_func ("/vala/remove/async", NULL, _test_remove_async_gtest_data_func);
	_tmp3_ = g_test_run ();
	res = _tmp3_;
	mock_service_stop ();
	__vala_SecretSchema_free0 (schema);
	schema = NULL;
	result = res;
	return result;
}


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



