/* support-test.c generated by valac 0.32.1, the Vala compiler
 * generated from support-test.vala, do not modify */

/*
 * This file is part of gitg
 *
 * Copyright (C) 2013 - Jesse van den Kieboom
 *
 * gitg is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * gitg 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with gitg. If not, see <http://www.gnu.org/licenses/>.
 */

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gstdio.h>
#include <gitg-assert.h>


#define GITG_TEST_TYPE_TEST (gitg_test_test_get_type ())
#define GITG_TEST_TEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TEST_TYPE_TEST, GitgTestTest))
#define GITG_TEST_TEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TEST_TYPE_TEST, GitgTestTestClass))
#define GITG_TEST_IS_TEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TEST_TYPE_TEST))
#define GITG_TEST_IS_TEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TEST_TYPE_TEST))
#define GITG_TEST_TEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TEST_TYPE_TEST, GitgTestTestClass))

typedef struct _GitgTestTest GitgTestTest;
typedef struct _GitgTestTestClass GitgTestTestClass;
typedef struct _GitgTestTestPrivate GitgTestTestPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

struct _GitgTestTest {
	GObject parent_instance;
	GitgTestTestPrivate * priv;
};

struct _GitgTestTestClass {
	GObjectClass parent_class;
	void (*set_up) (GitgTestTest* self);
	void (*tear_down) (GitgTestTest* self);
};

struct _GitgTestTestPrivate {
	GTestSuite* d_suite;
};


static gpointer gitg_test_test_parent_class = NULL;

GType gitg_test_test_get_type (void) G_GNUC_CONST;
#define GITG_TEST_TEST_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GITG_TEST_TYPE_TEST, GitgTestTestPrivate))
enum  {
	GITG_TEST_TEST_DUMMY_PROPERTY,
	GITG_TEST_TEST_SUITE
};
void gitg_test_test_set_up (GitgTestTest* self);
static void gitg_test_test_real_set_up (GitgTestTest* self);
void gitg_test_test_tear_down (GitgTestTest* self);
static void gitg_test_test_real_tear_down (GitgTestTest* self);
GitgTestTest* gitg_test_test_new (void);
GitgTestTest* gitg_test_test_construct (GType object_type);
GTestSuite* gitg_test_test_get_suite (GitgTestTest* self);
static GObject * gitg_test_test_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static void gitg_test_test_finalize (GObject* obj);
static void _vala_gitg_test_test_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
void gitg_test_assert_assert_file_contents (const gchar* filename, const gchar* expected_contents);


static void gitg_test_test_real_set_up (GitgTestTest* self) {
}


void gitg_test_test_set_up (GitgTestTest* self) {
#line 34 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	g_return_if_fail (self != NULL);
#line 34 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	GITG_TEST_TEST_GET_CLASS (self)->set_up (self);
#line 91 "support-test.c"
}


static void gitg_test_test_real_tear_down (GitgTestTest* self) {
}


void gitg_test_test_tear_down (GitgTestTest* self) {
#line 38 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	g_return_if_fail (self != NULL);
#line 38 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	GITG_TEST_TEST_GET_CLASS (self)->tear_down (self);
#line 104 "support-test.c"
}


GitgTestTest* gitg_test_test_construct (GType object_type) {
	GitgTestTest * self = NULL;
#line 20 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	self = (GitgTestTest*) g_object_new (object_type, NULL);
#line 20 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	return self;
#line 114 "support-test.c"
}


GitgTestTest* gitg_test_test_new (void) {
#line 20 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	return gitg_test_test_construct (GITG_TEST_TYPE_TEST);
#line 121 "support-test.c"
}


GTestSuite* gitg_test_test_get_suite (GitgTestTest* self) {
	GTestSuite* result;
	GTestSuite* _tmp0_ = NULL;
#line 31 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 31 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	_tmp0_ = self->priv->d_suite;
#line 31 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	result = _tmp0_;
#line 31 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	return result;
#line 136 "support-test.c"
}


static GObject * gitg_test_test_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GObjectClass * parent_class;
	GitgTestTest * self;
	GType _tmp0_ = 0UL;
	const gchar* _tmp1_ = NULL;
	GTestSuite* _tmp2_ = NULL;
#line 24 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	parent_class = G_OBJECT_CLASS (gitg_test_test_parent_class);
#line 24 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
#line 24 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GITG_TEST_TYPE_TEST, GitgTestTest);
#line 26 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	_tmp0_ = G_TYPE_FROM_INSTANCE ((GObject*) self);
#line 26 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	_tmp1_ = g_type_name (_tmp0_);
#line 26 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	_tmp2_ = g_test_create_suite (_tmp1_);
#line 26 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	self->priv->d_suite = _tmp2_;
#line 24 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	return obj;
#line 163 "support-test.c"
}


static void gitg_test_test_class_init (GitgTestTestClass * klass) {
#line 20 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	gitg_test_test_parent_class = g_type_class_peek_parent (klass);
#line 20 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	g_type_class_add_private (klass, sizeof (GitgTestTestPrivate));
#line 20 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	((GitgTestTestClass *) klass)->set_up = gitg_test_test_real_set_up;
#line 20 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	((GitgTestTestClass *) klass)->tear_down = gitg_test_test_real_tear_down;
#line 20 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_gitg_test_test_get_property;
#line 20 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	G_OBJECT_CLASS (klass)->constructor = gitg_test_test_constructor;
#line 20 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	G_OBJECT_CLASS (klass)->finalize = gitg_test_test_finalize;
#line 20 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_TEST_TEST_SUITE, g_param_spec_pointer ("suite", "suite", "suite", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
#line 184 "support-test.c"
}


static void gitg_test_test_instance_init (GitgTestTest * self) {
#line 20 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	self->priv = GITG_TEST_TEST_GET_PRIVATE (self);
#line 191 "support-test.c"
}


static void gitg_test_test_finalize (GObject* obj) {
	GitgTestTest * self;
#line 20 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GITG_TEST_TYPE_TEST, GitgTestTest);
#line 20 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	G_OBJECT_CLASS (gitg_test_test_parent_class)->finalize (obj);
#line 201 "support-test.c"
}


GType gitg_test_test_get_type (void) {
	static volatile gsize gitg_test_test_type_id__volatile = 0;
	if (g_once_init_enter (&gitg_test_test_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GitgTestTestClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gitg_test_test_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GitgTestTest), 0, (GInstanceInitFunc) gitg_test_test_instance_init, NULL };
		GType gitg_test_test_type_id;
		gitg_test_test_type_id = g_type_register_static (G_TYPE_OBJECT, "GitgTestTest", &g_define_type_info, 0);
		g_once_init_leave (&gitg_test_test_type_id__volatile, gitg_test_test_type_id);
	}
	return gitg_test_test_type_id__volatile;
}


static void _vala_gitg_test_test_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	GitgTestTest * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GITG_TEST_TYPE_TEST, GitgTestTest);
#line 20 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	switch (property_id) {
#line 20 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
		case GITG_TEST_TEST_SUITE:
#line 20 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
		g_value_set_pointer (value, gitg_test_test_get_suite (self));
#line 20 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
		break;
#line 228 "support-test.c"
		default:
#line 20 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 20 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
		break;
#line 234 "support-test.c"
	}
}


void gitg_test_assert_assert_file_contents (const gchar* filename, const gchar* expected_contents) {
	gchar* contents = NULL;
	gsize len = 0UL;
	const gchar* _tmp4_ = NULL;
	GError * _inner_error_ = NULL;
#line 45 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	g_return_if_fail (filename != NULL);
#line 45 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	g_return_if_fail (expected_contents != NULL);
#line 248 "support-test.c"
	{
		const gchar* _tmp0_ = NULL;
		gchar* _tmp1_ = NULL;
		gsize _tmp2_ = 0UL;
#line 52 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
		_tmp0_ = filename;
#line 52 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
		g_file_get_contents (_tmp0_, &_tmp1_, &_tmp2_, &_inner_error_);
#line 52 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
		_g_free0 (contents);
#line 52 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
		contents = _tmp1_;
#line 52 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
		len = _tmp2_;
#line 52 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 265 "support-test.c"
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp3_ = NULL;
#line 50 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
		e = _inner_error_;
#line 50 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
		_inner_error_ = NULL;
#line 56 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
		_tmp3_ = e;
#line 56 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
		gitg_test_assert_assert_no_error (_tmp3_);
#line 50 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
		_g_error_free0 (e);
#line 284 "support-test.c"
	}
	__finally0:
#line 50 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 50 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
		_g_free0 (contents);
#line 50 "/home/jesse/dev/gitg/tests/gitg/support-test.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 50 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
		g_clear_error (&_inner_error_);
#line 50 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
		return;
#line 297 "support-test.c"
	}
#line 59 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	_tmp4_ = expected_contents;
#line 59 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	gitg_test_assert_assert_streq (contents, _tmp4_);
#line 45 "/home/jesse/dev/gitg/tests/gitg/support-test.vala"
	_g_free0 (contents);
#line 305 "support-test.c"
}



