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


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

#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_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)))
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);



void test_read_alias (void);
gint _vala_main (gchar** args, int args_length1);
static void _test_read_alias_gtest_data_func (gpointer self);


void test_read_alias (void) {
	GError * _inner_error_ = NULL;
	{
		SecretService* _tmp0_ = NULL;
		SecretService* service;
		SecretService* _tmp1_;
		gchar* _tmp2_ = NULL;
		gchar* path;
		const gchar* _tmp3_;
		_tmp0_ = secret_service_get_sync (SECRET_SERVICE_NONE, NULL, &_inner_error_);
		service = _tmp0_;
		if (_inner_error_ != NULL) {
			goto __catch0_g_error;
		}
		_tmp1_ = service;
		_tmp2_ = secret_service_read_alias_dbus_path_sync (_tmp1_, "default", NULL, &_inner_error_);
		path = _tmp2_;
		if (_inner_error_ != NULL) {
			_g_object_unref0 (service);
			goto __catch0_g_error;
		}
		_tmp3_ = path;
		_vala_assert (_tmp3_ != NULL, "path != null");
		_g_free0 (path);
		_g_object_unref0 (service);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		const gchar* _tmp4_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp4_ = e->message;
		g_error ("test-vala-unstable.vala:7: %s", _tmp4_);
		_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_read_alias_gtest_data_func (gpointer self) {
	test_read_alias ();
}


gint _vala_main (gchar** args, int args_length1) {
	gint result = 0;
	gint _tmp1_ = 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 __catch1_g_error;
		}
	}
	goto __finally1;
	__catch1_g_error:
	{
		GError* e = NULL;
		const gchar* _tmp0_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp0_ = e->message;
		g_error ("test-vala-unstable.vala:17: Unable to start mock service: %s", _tmp0_);
		_g_error_free0 (e);
	}
	__finally1:
	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;
	}
	g_test_add_data_func ("/vala/unstable/read-alias", NULL, _test_read_alias_gtest_data_func);
	_tmp1_ = g_test_run ();
	res = _tmp1_;
	mock_service_stop ();
	result = res;
	return result;
}


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



