/* TCommentTest.c generated by valac 0.34.7, the Vala compiler
 * generated from TCommentTest.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_TCOMMENT_TEST (tcomment_test_get_type ())
#define TCOMMENT_TEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TCOMMENT_TEST, TCommentTest))
#define TCOMMENT_TEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TCOMMENT_TEST, TCommentTestClass))
#define IS_TCOMMENT_TEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TCOMMENT_TEST))
#define IS_TCOMMENT_TEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TCOMMENT_TEST))
#define TCOMMENT_TEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TCOMMENT_TEST, TCommentTestClass))

typedef struct _TCommentTest TCommentTest;
typedef struct _TCommentTestClass TCommentTestClass;
typedef struct _TCommentTestPrivate TCommentTestPrivate;
#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 _TCommentTest {
	GXmlTest parent_instance;
	TCommentTestPrivate * priv;
};

struct _TCommentTestClass {
	GXmlTestClass parent_class;
};


static gpointer tcomment_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 tcomment_test_get_type (void) G_GNUC_CONST;
enum  {
	TCOMMENT_TEST_DUMMY_PROPERTY
};
void tcomment_test_add_tests (void);
static void __lambda104_ (void);
static void ___lambda104__gtest_func (void);
TCommentTest* tcomment_test_new (void);
TCommentTest* tcomment_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 "TCommentTest.c"
}


static void __lambda104_ (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* c = NULL;
		GXmlNode* _tmp5_ = NULL;
		gchar* _tmp6_ = NULL;
		gchar* _tmp7_ = NULL;
		gchar* _tmp8_ = NULL;
		gchar* _tmp9_ = NULL;
		gchar* _tmp10_ = NULL;
		gchar* _tmp11_ = NULL;
		GXmlNode* _tmp12_ = NULL;
		GXmlNode* _tmp13_ = NULL;
		GXmlNode* _tmp14_ = NULL;
		GeeBidirList* _tmp15_ = NULL;
		GeeBidirList* _tmp16_ = NULL;
		GeeBidirList* _tmp17_ = NULL;
		GXmlNode* _tmp18_ = NULL;
		GXmlNode* _tmp19_ = NULL;
		GXmlNode* _tmp20_ = NULL;
		GeeBidirList* _tmp21_ = NULL;
		GeeBidirList* _tmp22_ = NULL;
		GeeBidirList* _tmp23_ = NULL;
		gint _tmp24_ = 0;
		gint _tmp25_ = 0;
		gchar* str = NULL;
		gchar* _tmp26_ = NULL;
		gboolean _tmp27_ = FALSE;
#line 29 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_tmp0_ = gxml_tdocument_new ();
#line 29 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		d = _tmp0_;
#line 30 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_tmp1_ = gxml_document_create_element ((GXmlDocument*) d, "root", &_inner_error_);
#line 30 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		r = _tmp1_;
#line 30 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 30 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
			_g_object_unref0 (d);
#line 174 "TCommentTest.c"
			goto __catch141_g_error;
		}
#line 31 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_tmp2_ = gxml_tnode_get_children_nodes ((GXmlTNode*) d);
#line 31 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_tmp3_ = _tmp2_;
#line 31 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_tmp4_ = _tmp3_;
#line 31 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		gee_collection_add ((GeeCollection*) _tmp4_, r);
#line 31 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_g_object_unref0 (_tmp4_);
#line 32 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_tmp5_ = gxml_document_create_comment ((GXmlDocument*) d, "This is a comment");
#line 32 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		c = _tmp5_;
#line 33 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_tmp6_ = gxml_node_get_name (c);
#line 33 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_tmp7_ = _tmp6_;
#line 33 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_tmp8_ = _tmp7_;
#line 33 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_vala_assert (g_strcmp0 (_tmp8_, "#comment") == 0, "c.name == \"#comment\"");
#line 33 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_g_free0 (_tmp8_);
#line 34 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_tmp9_ = gxml_node_get_value (c);
#line 34 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_tmp10_ = _tmp9_;
#line 34 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_tmp11_ = _tmp10_;
#line 34 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_vala_assert (g_strcmp0 (_tmp11_, "This is a comment") == 0, "c.value == \"This is a comment\"");
#line 34 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_g_free0 (_tmp11_);
#line 35 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_tmp12_ = gxml_document_get_root ((GXmlDocument*) d);
#line 35 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_tmp13_ = _tmp12_;
#line 35 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_tmp14_ = _tmp13_;
#line 35 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_tmp15_ = gxml_node_get_children_nodes (_tmp14_);
#line 35 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_tmp16_ = _tmp15_;
#line 35 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_tmp17_ = _tmp16_;
#line 35 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		gee_collection_add ((GeeCollection*) _tmp17_, c);
#line 35 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_g_object_unref0 (_tmp17_);
#line 35 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_g_object_unref0 (_tmp14_);
#line 36 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_tmp18_ = gxml_document_get_root ((GXmlDocument*) d);
#line 36 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_tmp19_ = _tmp18_;
#line 36 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_tmp20_ = _tmp19_;
#line 36 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_tmp21_ = gxml_node_get_children_nodes (_tmp20_);
#line 36 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_tmp22_ = _tmp21_;
#line 36 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_tmp23_ = _tmp22_;
#line 36 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_tmp24_ = gee_collection_get_size ((GeeCollection*) _tmp23_);
#line 36 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_tmp25_ = _tmp24_;
#line 36 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_vala_assert (_tmp25_ == 1, "d.root.children_nodes.size == 1");
#line 36 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_g_object_unref0 (_tmp23_);
#line 36 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_g_object_unref0 (_tmp20_);
#line 37 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_tmp26_ = gxml_tnode_to_string ((GXmlTNode*) d);
#line 37 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		str = _tmp26_;
#line 38 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_tmp27_ = string_contains (str, "<root><!--This is a comment--></root>");
#line 38 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_vala_assert (_tmp27_, "\"<root><!--This is a comment--></root>\" in str");
#line 28 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_g_free0 (str);
#line 28 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_g_object_unref0 (c);
#line 28 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_g_object_unref0 (r);
#line 28 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_g_object_unref0 (d);
#line 267 "TCommentTest.c"
	}
	goto __finally141;
	__catch141_g_error:
	{
		GError* e = NULL;
#line 28 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		e = _inner_error_;
#line 28 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_inner_error_ = NULL;
#line 47 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		g_assert_not_reached ();
#line 28 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		_g_error_free0 (e);
#line 281 "TCommentTest.c"
	}
	__finally141:
#line 28 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 28 "/home/despinosa/Proyectos/gxml/test/TCommentTest.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/TCommentTest.vala"
		g_clear_error (&_inner_error_);
#line 28 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
		return;
#line 292 "TCommentTest.c"
	}
}


static void ___lambda104__gtest_func (void) {
#line 27 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
	__lambda104_ ();
#line 300 "TCommentTest.c"
}


void tcomment_test_add_tests (void) {
#line 27 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
	g_test_add_func ("/gxml/t-comment", ___lambda104__gtest_func);
#line 307 "TCommentTest.c"
}


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


TCommentTest* tcomment_test_new (void) {
#line 25 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
	return tcomment_test_construct (TYPE_TCOMMENT_TEST);
#line 324 "TCommentTest.c"
}


static void tcomment_test_class_init (TCommentTestClass * klass) {
#line 25 "/home/despinosa/Proyectos/gxml/test/TCommentTest.vala"
	tcomment_test_parent_class = g_type_class_peek_parent (klass);
#line 331 "TCommentTest.c"
}


static void tcomment_test_instance_init (TCommentTest * self) {
}


GType tcomment_test_get_type (void) {
	static volatile gsize tcomment_test_type_id__volatile = 0;
	if (g_once_init_enter (&tcomment_test_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (TCommentTestClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tcomment_test_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TCommentTest), 0, (GInstanceInitFunc) tcomment_test_instance_init, NULL };
		GType tcomment_test_type_id;
		tcomment_test_type_id = g_type_register_static (TYPE_GXML_TEST, "TCommentTest", &g_define_type_info, 0);
		g_once_init_leave (&tcomment_test_type_id__volatile, tcomment_test_type_id);
	}
	return tcomment_test_type_id__volatile;
}



