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

/* -*- Mode: vala; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */
/* TCDATATest.vala
 *
 * Copyright (C) 2011-2015  Daniel Espinosa <esodan@gmail.com>
 *
 * 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:
 *      Daniel Espinosa <esodan@gmail.com>
 */

#include <glib.h>
#include <glib-object.h>
#include <gxml/gxml.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>


#define TYPE_GXML_TEST (gxml_test_get_type ())
#define GXML_TEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_GXML_TEST, GXmlTest))
#define GXML_TEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_GXML_TEST, GXmlTestClass))
#define IS_GXML_TEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_GXML_TEST))
#define IS_GXML_TEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_GXML_TEST))
#define GXML_TEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_GXML_TEST, GXmlTestClass))

typedef struct _GXmlTest GXmlTest;
typedef struct _GXmlTestClass GXmlTestClass;
typedef struct _GXmlTestPrivate GXmlTestPrivate;

#define TYPE_TCDATA_TEST (tcdata_test_get_type ())
#define TCDATA_TEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TCDATA_TEST, TCDATATest))
#define TCDATA_TEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TCDATA_TEST, TCDATATestClass))
#define IS_TCDATA_TEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TCDATA_TEST))
#define IS_TCDATA_TEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TCDATA_TEST))
#define TCDATA_TEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TCDATA_TEST, TCDATATestClass))

typedef struct _TCDATATest TCDATATest;
typedef struct _TCDATATestClass TCDATATestClass;
typedef struct _TCDATATestPrivate TCDATATestPrivate;
#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);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _GXmlTest {
	GTypeInstance parent_instance;
	volatile int ref_count;
	GXmlTestPrivate * priv;
};

struct _GXmlTestClass {
	GTypeClass parent_class;
	void (*finalize) (GXmlTest *self);
};

struct _TCDATATest {
	GXmlTest parent_instance;
	TCDATATestPrivate * priv;
};

struct _TCDATATestClass {
	GXmlTestClass parent_class;
};


static gpointer tcdata_test_parent_class = NULL;

gpointer gxml_test_ref (gpointer instance);
void gxml_test_unref (gpointer instance);
GParamSpec* param_spec_gxml_test (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_gxml_test (GValue* value, gpointer v_object);
void value_take_gxml_test (GValue* value, gpointer v_object);
gpointer value_get_gxml_test (const GValue* value);
GType gxml_test_get_type (void) G_GNUC_CONST;
GType tcdata_test_get_type (void) G_GNUC_CONST;
enum  {
	TCDATA_TEST_DUMMY_PROPERTY
};
void tcdata_test_add_tests (void);
static void __lambda103_ (void);
static void ___lambda103__gtest_func (void);
TCDATATest* tcdata_test_new (void);
TCDATATest* tcdata_test_construct (GType object_type);
GXmlTest* gxml_test_new (void);
GXmlTest* gxml_test_construct (GType object_type);


static gboolean string_contains (const gchar* self, const gchar* needle) {
	gboolean result = FALSE;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
#line 1376 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, FALSE);
#line 1376 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	g_return_val_if_fail (needle != NULL, FALSE);
#line 1377 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp0_ = needle;
#line 1377 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp1_ = strstr ((gchar*) self, (gchar*) _tmp0_);
#line 1377 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	result = _tmp1_ != NULL;
#line 1377 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	return result;
#line 123 "TCDATATest.c"
}


static const gchar* string_to_string (const gchar* self) {
	const gchar* result = NULL;
#line 1412 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1413 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	result = self;
#line 1413 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	return result;
#line 135 "TCDATATest.c"
}


static void __lambda103_ (void) {
	GError * _inner_error_ = NULL;
	{
		GXmlTDocument* d = NULL;
		GXmlTDocument* _tmp0_ = NULL;
		GXmlNode* r = NULL;
		GXmlNode* _tmp1_ = NULL;
		GeeBidirList* _tmp2_ = NULL;
		GeeBidirList* _tmp3_ = NULL;
		GeeBidirList* _tmp4_ = NULL;
		GeeBidirList* _tmp5_ = NULL;
		GeeBidirList* _tmp6_ = NULL;
		GeeBidirList* _tmp7_ = NULL;
		gint _tmp8_ = 0;
		gint _tmp9_ = 0;
		gchar* _tmp10_ = NULL;
		gchar* _tmp11_ = NULL;
		GXmlNode* cd = NULL;
		GXmlNode* _tmp12_ = NULL;
		gchar* _tmp13_ = NULL;
		gchar* _tmp14_ = NULL;
		gchar* _tmp15_ = NULL;
		GXmlNode* _tmp16_ = NULL;
		GXmlNode* _tmp17_ = NULL;
		GXmlNode* _tmp18_ = NULL;
		GeeBidirList* _tmp19_ = NULL;
		GeeBidirList* _tmp20_ = NULL;
		GeeBidirList* _tmp21_ = NULL;
		GXmlNode* _tmp22_ = NULL;
		GXmlNode* _tmp23_ = NULL;
		GXmlNode* _tmp24_ = NULL;
		GeeBidirList* _tmp25_ = NULL;
		GeeBidirList* _tmp26_ = NULL;
		GeeBidirList* _tmp27_ = NULL;
		gint _tmp28_ = 0;
		gint _tmp29_ = 0;
		gchar* str = NULL;
		gchar* _tmp30_ = NULL;
		gchar* _tmp31_ = NULL;
		gchar* _tmp32_ = NULL;
		gboolean _tmp33_ = FALSE;
#line 29 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp0_ = gxml_tdocument_new ();
#line 29 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		d = _tmp0_;
#line 30 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp1_ = gxml_document_create_element ((GXmlDocument*) d, "root", &_inner_error_);
#line 30 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		r = _tmp1_;
#line 30 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 30 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
			_g_object_unref0 (d);
#line 192 "TCDATATest.c"
			goto __catch140_g_error;
		}
#line 31 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp2_ = gxml_tnode_get_children_nodes ((GXmlTNode*) d);
#line 31 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp3_ = _tmp2_;
#line 31 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp4_ = _tmp3_;
#line 31 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		gee_collection_add ((GeeCollection*) _tmp4_, r);
#line 31 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_g_object_unref0 (_tmp4_);
#line 32 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp5_ = gxml_tnode_get_children_nodes ((GXmlTNode*) d);
#line 32 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp6_ = _tmp5_;
#line 32 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp7_ = _tmp6_;
#line 32 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp8_ = gee_collection_get_size ((GeeCollection*) _tmp7_);
#line 32 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp9_ = _tmp8_;
#line 32 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_vala_assert (_tmp9_ == 1, "d.children_nodes.size == 1");
#line 32 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_g_object_unref0 (_tmp7_);
#line 33 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp10_ = gxml_tnode_to_string ((GXmlTNode*) d);
#line 33 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp11_ = _tmp10_;
#line 33 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		g_message ("TCDATATest.vala:33: %s", _tmp11_);
#line 33 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_g_free0 (_tmp11_);
#line 34 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp12_ = gxml_document_create_cdata ((GXmlDocument*) d, "<test/>");
#line 34 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		cd = _tmp12_;
#line 35 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp13_ = gxml_node_get_value (cd);
#line 35 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp14_ = _tmp13_;
#line 35 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp15_ = _tmp14_;
#line 35 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_vala_assert (g_strcmp0 (_tmp15_, "<test/>") == 0, "cd.value == \"<test/>\"");
#line 35 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_g_free0 (_tmp15_);
#line 36 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp16_ = gxml_document_get_root ((GXmlDocument*) d);
#line 36 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp17_ = _tmp16_;
#line 36 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp18_ = _tmp17_;
#line 36 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp19_ = gxml_node_get_children_nodes (_tmp18_);
#line 36 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp20_ = _tmp19_;
#line 36 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp21_ = _tmp20_;
#line 36 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		gee_collection_add ((GeeCollection*) _tmp21_, cd);
#line 36 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_g_object_unref0 (_tmp21_);
#line 36 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_g_object_unref0 (_tmp18_);
#line 37 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp22_ = gxml_document_get_root ((GXmlDocument*) d);
#line 37 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp23_ = _tmp22_;
#line 37 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp24_ = _tmp23_;
#line 37 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp25_ = gxml_node_get_children_nodes (_tmp24_);
#line 37 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp26_ = _tmp25_;
#line 37 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp27_ = _tmp26_;
#line 37 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp28_ = gee_collection_get_size ((GeeCollection*) _tmp27_);
#line 37 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp29_ = _tmp28_;
#line 37 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_vala_assert (_tmp29_ == 1, "d.root.children_nodes.size == 1");
#line 37 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_g_object_unref0 (_tmp27_);
#line 37 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_g_object_unref0 (_tmp24_);
#line 38 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp30_ = gxml_tnode_to_string ((GXmlTNode*) d);
#line 38 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		str = _tmp30_;
#line 39 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp31_ = gxml_tnode_to_string ((GXmlTNode*) d);
#line 39 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp32_ = _tmp31_;
#line 39 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		g_message ("TCDATATest.vala:39: %s", _tmp32_);
#line 39 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_g_free0 (_tmp32_);
#line 40 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp33_ = string_contains (str, "<root><![CDATA[<test/>]]></root>");
#line 40 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_vala_assert (_tmp33_, "\"<root><![CDATA[<test/>]]></root>\" in str");
#line 28 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_g_free0 (str);
#line 28 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_g_object_unref0 (cd);
#line 28 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_g_object_unref0 (r);
#line 28 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_g_object_unref0 (d);
#line 305 "TCDATATest.c"
	}
	goto __finally140;
	__catch140_g_error:
	{
		GError* e = NULL;
		const gchar* _tmp34_ = NULL;
		const gchar* _tmp35_ = NULL;
		gchar* _tmp36_ = NULL;
		gchar* _tmp37_ = NULL;
#line 28 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		e = _inner_error_;
#line 28 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_inner_error_ = NULL;
#line 43 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp34_ = e->message;
#line 43 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp35_ = string_to_string (_tmp34_);
#line 43 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp36_ = g_strconcat ("ERROR: ", _tmp35_, NULL);
#line 43 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp37_ = _tmp36_;
#line 43 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		g_message ("TCDATATest.vala:43: %s", _tmp37_);
#line 43 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_g_free0 (_tmp37_);
#line 44 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		g_assert_not_reached ();
#line 28 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_g_error_free0 (e);
#line 335 "TCDATATest.c"
	}
	__finally140:
#line 28 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 28 "/home/despinosa/Proyectos/gxml/test/TCDATATest.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 28 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		g_clear_error (&_inner_error_);
#line 28 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		return;
#line 346 "TCDATATest.c"
	}
}


static void ___lambda103__gtest_func (void) {
#line 27 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
	__lambda103_ ();
#line 354 "TCDATATest.c"
}


void tcdata_test_add_tests (void) {
#line 27 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
	g_test_add_func ("/gxml/t-cdata", ___lambda103__gtest_func);
#line 361 "TCDATATest.c"
}


TCDATATest* tcdata_test_construct (GType object_type) {
	TCDATATest* self = NULL;
#line 25 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
	self = (TCDATATest*) gxml_test_construct (object_type);
#line 25 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
	return self;
#line 371 "TCDATATest.c"
}


TCDATATest* tcdata_test_new (void) {
#line 25 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
	return tcdata_test_construct (TYPE_TCDATA_TEST);
#line 378 "TCDATATest.c"
}


static void tcdata_test_class_init (TCDATATestClass * klass) {
#line 25 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
	tcdata_test_parent_class = g_type_class_peek_parent (klass);
#line 385 "TCDATATest.c"
}


static void tcdata_test_instance_init (TCDATATest * self) {
}


GType tcdata_test_get_type (void) {
	static volatile gsize tcdata_test_type_id__volatile = 0;
	if (g_once_init_enter (&tcdata_test_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (TCDATATestClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tcdata_test_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TCDATATest), 0, (GInstanceInitFunc) tcdata_test_instance_init, NULL };
		GType tcdata_test_type_id;
		tcdata_test_type_id = g_type_register_static (TYPE_GXML_TEST, "TCDATATest", &g_define_type_info, 0);
		g_once_init_leave (&tcdata_test_type_id__volatile, tcdata_test_type_id);
	}
	return tcdata_test_type_id__volatile;
}



