/* testobject.c generated by valac 0.16.1, the Vala compiler
 * generated from testobject.vala, do not modify */


#include <glib.h>
#include <glib-object.h>
#include <fsobasics.h>
#include <stdlib.h>
#include <string.h>


#define TYPE_FOO (foo_get_type ())
#define FOO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FOO, Foo))
#define FOO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FOO, FooClass))
#define IS_FOO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FOO))
#define IS_FOO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FOO))
#define FOO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FOO, FooClass))

typedef struct _Foo Foo;
typedef struct _FooClass FooClass;
typedef struct _FooPrivate FooPrivate;

#define TYPE_FOO_BAR (foo_bar_get_type ())
#define FOO_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FOO_BAR, FooBar))
#define FOO_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FOO_BAR, FooBarClass))
#define IS_FOO_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FOO_BAR))
#define IS_FOO_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FOO_BAR))
#define FOO_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FOO_BAR, FooBarClass))

typedef struct _FooBar FooBar;
typedef struct _FooBarClass FooBarClass;
typedef struct _FooBarPrivate FooBarPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _Foo {
	FsoFrameworkAbstractObject parent_instance;
	FooPrivate * priv;
};

struct _FooClass {
	FsoFrameworkAbstractObjectClass parent_class;
};

struct _FooBar {
	FsoFrameworkAbstractObject parent_instance;
	FooBarPrivate * priv;
};

struct _FooBarClass {
	FsoFrameworkAbstractObjectClass parent_class;
};


static gpointer foo_parent_class = NULL;
static gpointer foo_bar_parent_class = NULL;

GType foo_get_type (void) G_GNUC_CONST;
enum  {
	FOO_DUMMY_PROPERTY
};
static gchar* foo_real_repr (FsoFrameworkAbstractObject* base);
Foo* foo_new (void);
Foo* foo_construct (GType object_type);
GType foo_bar_get_type (void) G_GNUC_CONST;
enum  {
	FOO_BAR_DUMMY_PROPERTY
};
static gchar* foo_bar_real_repr (FsoFrameworkAbstractObject* base);
FooBar* foo_bar_new (void);
FooBar* foo_bar_construct (GType object_type);
void test_object_creation (void);
void _vala_main (gchar** args, int args_length1);
static void _test_object_creation_gcallback (void);


static gchar* foo_real_repr (FsoFrameworkAbstractObject* base) {
	Foo * self;
	gchar* result = NULL;
	gchar* _tmp0_;
	self = (Foo*) base;
	_tmp0_ = g_strdup ("<Foo>");
	result = _tmp0_;
	return result;
}


Foo* foo_construct (GType object_type) {
	Foo * self = NULL;
	self = (Foo*) fso_framework_abstract_object_construct (object_type);
	return self;
}


Foo* foo_new (void) {
	return foo_construct (TYPE_FOO);
}


static void foo_class_init (FooClass * klass) {
	foo_parent_class = g_type_class_peek_parent (klass);
	FSO_FRAMEWORK_ABSTRACT_OBJECT_CLASS (klass)->repr = foo_real_repr;
}


static void foo_instance_init (Foo * self) {
}


/**
 * Copyright (C) 2009-2012 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
 *
 * 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, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 */
GType foo_get_type (void) {
	static volatile gsize foo_type_id__volatile = 0;
	if (g_once_init_enter (&foo_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (FooClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) foo_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Foo), 0, (GInstanceInitFunc) foo_instance_init, NULL };
		GType foo_type_id;
		foo_type_id = g_type_register_static (FSO_FRAMEWORK_TYPE_ABSTRACT_OBJECT, "Foo", &g_define_type_info, 0);
		g_once_init_leave (&foo_type_id__volatile, foo_type_id);
	}
	return foo_type_id__volatile;
}


static gchar* foo_bar_real_repr (FsoFrameworkAbstractObject* base) {
	FooBar * self;
	gchar* result = NULL;
	gchar* _tmp0_;
	self = (FooBar*) base;
	_tmp0_ = g_strdup ("<FooBar>");
	result = _tmp0_;
	return result;
}


FooBar* foo_bar_construct (GType object_type) {
	FooBar * self = NULL;
	self = (FooBar*) fso_framework_abstract_object_construct (object_type);
	return self;
}


FooBar* foo_bar_new (void) {
	return foo_bar_construct (TYPE_FOO_BAR);
}


static void foo_bar_class_init (FooBarClass * klass) {
	foo_bar_parent_class = g_type_class_peek_parent (klass);
	FSO_FRAMEWORK_ABSTRACT_OBJECT_CLASS (klass)->repr = foo_bar_real_repr;
}


static void foo_bar_instance_init (FooBar * self) {
}


GType foo_bar_get_type (void) {
	static volatile gsize foo_bar_type_id__volatile = 0;
	if (g_once_init_enter (&foo_bar_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (FooBarClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) foo_bar_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FooBar), 0, (GInstanceInitFunc) foo_bar_instance_init, NULL };
		GType foo_bar_type_id;
		foo_bar_type_id = g_type_register_static (FSO_FRAMEWORK_TYPE_ABSTRACT_OBJECT, "FooBar", &g_define_type_info, 0);
		g_once_init_leave (&foo_bar_type_id__volatile, foo_bar_type_id);
	}
	return foo_bar_type_id__volatile;
}


void test_object_creation (void) {
	Foo* _tmp0_;
	Foo* foo;
	const gchar* _tmp1_;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_;
	FooBar* _tmp4_;
	FooBar* foobar;
	const gchar* _tmp5_;
	gchar* _tmp6_ = NULL;
	gchar* _tmp7_;
	_tmp0_ = foo_new ();
	foo = _tmp0_;
	_tmp1_ = ((FsoFrameworkAbstractObject*) foo)->classname;
	g_assert (g_strcmp0 (_tmp1_, "Foo") == 0);
	_tmp2_ = fso_framework_abstract_object_repr ((FsoFrameworkAbstractObject*) foo);
	_tmp3_ = _tmp2_;
	g_assert (g_strcmp0 (_tmp3_, "<Foo>") == 0);
	_g_free0 (_tmp3_);
	_tmp4_ = foo_bar_new ();
	foobar = _tmp4_;
	_tmp5_ = ((FsoFrameworkAbstractObject*) foobar)->classname;
	g_assert (g_strcmp0 (_tmp5_, "FooBar") == 0);
	_tmp6_ = fso_framework_abstract_object_repr ((FsoFrameworkAbstractObject*) foobar);
	_tmp7_ = _tmp6_;
	g_assert (g_strcmp0 (_tmp7_, "<FooBar>") == 0);
	_g_free0 (_tmp7_);
	_g_object_unref0 (foobar);
	_g_object_unref0 (foo);
}


static void _test_object_creation_gcallback (void) {
	test_object_creation ();
}


void _vala_main (gchar** args, int args_length1) {
	g_test_init (&args_length1, &args, NULL);
	g_test_add_func ("/Object/Creation", _test_object_creation_gcallback);
	g_test_run ();
}


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



