/* TCDATATest.c generated by valac 0.28.1, 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 __lambda192_ (void);
static void ___lambda192__gcallback (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 1278 "/usr/share/vala-0.28/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, FALSE);
#line 1278 "/usr/share/vala-0.28/vapi/glib-2.0.vapi"
	g_return_val_if_fail (needle != NULL, FALSE);
#line 1279 "/usr/share/vala-0.28/vapi/glib-2.0.vapi"
	_tmp0_ = needle;
#line 1279 "/usr/share/vala-0.28/vapi/glib-2.0.vapi"
	_tmp1_ = strstr ((gchar*) self, (gchar*) _tmp0_);
#line 1279 "/usr/share/vala-0.28/vapi/glib-2.0.vapi"
	result = _tmp1_ != NULL;
#line 1279 "/usr/share/vala-0.28/vapi/glib-2.0.vapi"
	return result;
#line 123 "TCDATATest.c"
}


static void __lambda192_ (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;
		GXmlNode* cd = NULL;
		GXmlNode* _tmp5_ = NULL;
		gchar* _tmp6_ = NULL;
		gchar* _tmp7_ = NULL;
		gchar* _tmp8_ = NULL;
		GXmlNode* _tmp9_ = NULL;
		GXmlNode* _tmp10_ = NULL;
		GXmlNode* _tmp11_ = NULL;
		GeeBidirList* _tmp12_ = NULL;
		GeeBidirList* _tmp13_ = NULL;
		GeeBidirList* _tmp14_ = NULL;
		GXmlNode* _tmp15_ = NULL;
		GXmlNode* _tmp16_ = NULL;
		GXmlNode* _tmp17_ = NULL;
		GeeBidirList* _tmp18_ = NULL;
		GeeBidirList* _tmp19_ = NULL;
		GeeBidirList* _tmp20_ = NULL;
		gint _tmp21_ = 0;
		gint _tmp22_ = 0;
		gchar* str = NULL;
		gchar* _tmp23_ = NULL;
		gboolean _tmp24_ = 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 171 "TCDATATest.c"
			goto __catch154_g_error;
		}
#line 31 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp2_ = gxml_tnode_get_children ((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_document_create_cdata ((GXmlDocument*) d, "<test/>");
#line 32 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		cd = _tmp5_;
#line 33 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp6_ = gxml_node_get_value (cd);
#line 33 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp7_ = _tmp6_;
#line 33 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp8_ = _tmp7_;
#line 33 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_vala_assert (g_strcmp0 (_tmp8_, "<test/>") == 0, "cd.value == \"<test/>\"");
#line 33 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_g_free0 (_tmp8_);
#line 34 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp9_ = gxml_document_get_root ((GXmlDocument*) d);
#line 34 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp10_ = _tmp9_;
#line 34 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp11_ = _tmp10_;
#line 34 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp12_ = gxml_node_get_children (_tmp11_);
#line 34 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp13_ = _tmp12_;
#line 34 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp14_ = _tmp13_;
#line 34 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		gee_collection_add ((GeeCollection*) _tmp14_, cd);
#line 34 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_g_object_unref0 (_tmp14_);
#line 34 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_g_object_unref0 (_tmp11_);
#line 35 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp15_ = gxml_document_get_root ((GXmlDocument*) d);
#line 35 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp16_ = _tmp15_;
#line 35 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp17_ = _tmp16_;
#line 35 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp18_ = gxml_node_get_children (_tmp17_);
#line 35 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp19_ = _tmp18_;
#line 35 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp20_ = _tmp19_;
#line 35 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp21_ = gee_collection_get_size ((GeeCollection*) _tmp20_);
#line 35 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp22_ = _tmp21_;
#line 35 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_vala_assert (_tmp22_ == 1, "d.root.children.size == 1");
#line 35 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_g_object_unref0 (_tmp20_);
#line 35 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_g_object_unref0 (_tmp17_);
#line 36 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp23_ = gxml_tnode_to_string ((GXmlTNode*) d);
#line 36 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		str = _tmp23_;
#line 37 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_tmp24_ = string_contains (str, "<root><![CDATA[<test/>]]></root>");
#line 37 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
		_vala_assert (_tmp24_, "\"<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 254 "TCDATATest.c"
	}
	goto __finally154;
	__catch154_g_error:
	{
		GError* e = 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 46 "/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 268 "TCDATATest.c"
	}
	__finally154:
#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 279 "TCDATATest.c"
	}
}


static void ___lambda192__gcallback (void) {
#line 27 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
	__lambda192_ ();
#line 287 "TCDATATest.c"
}


void tcdata_test_add_tests (void) {
#line 27 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
	g_test_add_func ("/gxml/t-cdata", ___lambda192__gcallback);
#line 294 "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 304 "TCDATATest.c"
}


TCDATATest* tcdata_test_new (void) {
#line 25 "/home/despinosa/Proyectos/gxml/test/TCDATATest.vala"
	return tcdata_test_construct (TYPE_TCDATA_TEST);
#line 311 "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 318 "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;
}



