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

/* -*- Mode: vala; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */
/* TProcessingInstructionTest.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_TPROCESSING_INSTRUCTION_TEST (tprocessing_instruction_test_get_type ())
#define TPROCESSING_INSTRUCTION_TEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TPROCESSING_INSTRUCTION_TEST, TProcessingInstructionTest))
#define TPROCESSING_INSTRUCTION_TEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TPROCESSING_INSTRUCTION_TEST, TProcessingInstructionTestClass))
#define IS_TPROCESSING_INSTRUCTION_TEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TPROCESSING_INSTRUCTION_TEST))
#define IS_TPROCESSING_INSTRUCTION_TEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TPROCESSING_INSTRUCTION_TEST))
#define TPROCESSING_INSTRUCTION_TEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TPROCESSING_INSTRUCTION_TEST, TProcessingInstructionTestClass))

typedef struct _TProcessingInstructionTest TProcessingInstructionTest;
typedef struct _TProcessingInstructionTestClass TProcessingInstructionTestClass;
typedef struct _TProcessingInstructionTestPrivate TProcessingInstructionTestPrivate;
#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 _TProcessingInstructionTest {
	GXmlTest parent_instance;
	TProcessingInstructionTestPrivate * priv;
};

struct _TProcessingInstructionTestClass {
	GXmlTestClass parent_class;
};


static gpointer tprocessing_instruction_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 tprocessing_instruction_test_get_type (void) G_GNUC_CONST;
enum  {
	TPROCESSING_INSTRUCTION_TEST_DUMMY_PROPERTY
};
void tprocessing_instruction_test_add_tests (void);
static void __lambda218_ (void);
static void ___lambda218__gcallback (void);
TProcessingInstructionTest* tprocessing_instruction_test_new (void);
TProcessingInstructionTest* tprocessing_instruction_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 "TProcessingInstructionTest.c"
}


static void __lambda218_ (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* pi = 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/TProcessingInstructionTest.vala"
		_tmp0_ = gxml_tdocument_new ();
#line 29 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		d = _tmp0_;
#line 30 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_tmp1_ = gxml_document_create_element ((GXmlDocument*) d, "root", &_inner_error_);
#line 30 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		r = _tmp1_;
#line 30 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 30 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
			_g_object_unref0 (d);
#line 174 "TProcessingInstructionTest.c"
			goto __catch156_g_error;
		}
#line 31 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_tmp2_ = gxml_tnode_get_children ((GXmlTNode*) d);
#line 31 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_tmp3_ = _tmp2_;
#line 31 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_tmp4_ = _tmp3_;
#line 31 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		gee_collection_add ((GeeCollection*) _tmp4_, r);
#line 31 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_g_object_unref0 (_tmp4_);
#line 32 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_tmp5_ = gxml_document_create_pi ((GXmlDocument*) d, "xslt", "transform");
#line 32 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		pi = _tmp5_;
#line 33 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_tmp6_ = gxml_node_get_name (pi);
#line 33 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_tmp7_ = _tmp6_;
#line 33 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_tmp8_ = _tmp7_;
#line 33 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_vala_assert (g_strcmp0 (_tmp8_, "#processinginstruction") == 0, "pi.name == \"#processinginstruction\"");
#line 33 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_g_free0 (_tmp8_);
#line 34 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_tmp9_ = gxml_node_get_value (pi);
#line 34 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_tmp10_ = _tmp9_;
#line 34 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_tmp11_ = _tmp10_;
#line 34 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_vala_assert (g_strcmp0 (_tmp11_, "transform") == 0, "pi.value == \"transform\"");
#line 34 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_g_free0 (_tmp11_);
#line 35 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_tmp12_ = gxml_document_get_root ((GXmlDocument*) d);
#line 35 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_tmp13_ = _tmp12_;
#line 35 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_tmp14_ = _tmp13_;
#line 35 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_tmp15_ = gxml_node_get_children (_tmp14_);
#line 35 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_tmp16_ = _tmp15_;
#line 35 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_tmp17_ = _tmp16_;
#line 35 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		gee_collection_add ((GeeCollection*) _tmp17_, pi);
#line 35 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_g_object_unref0 (_tmp17_);
#line 35 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_g_object_unref0 (_tmp14_);
#line 36 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_tmp18_ = gxml_document_get_root ((GXmlDocument*) d);
#line 36 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_tmp19_ = _tmp18_;
#line 36 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_tmp20_ = _tmp19_;
#line 36 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_tmp21_ = gxml_node_get_children (_tmp20_);
#line 36 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_tmp22_ = _tmp21_;
#line 36 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_tmp23_ = _tmp22_;
#line 36 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_tmp24_ = gee_collection_get_size ((GeeCollection*) _tmp23_);
#line 36 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_tmp25_ = _tmp24_;
#line 36 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_vala_assert (_tmp25_ == 1, "d.root.children.size == 1");
#line 36 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_g_object_unref0 (_tmp23_);
#line 36 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_g_object_unref0 (_tmp20_);
#line 37 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_tmp26_ = gxml_tnode_to_string ((GXmlTNode*) d);
#line 37 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		str = _tmp26_;
#line 38 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_tmp27_ = string_contains (str, "<root><?xslt transform?></root>");
#line 38 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_vala_assert (_tmp27_, "\"<root><?xslt transform?></root>\" in str");
#line 28 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_g_free0 (str);
#line 28 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_g_object_unref0 (pi);
#line 28 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_g_object_unref0 (r);
#line 28 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_g_object_unref0 (d);
#line 267 "TProcessingInstructionTest.c"
	}
	goto __finally156;
	__catch156_g_error:
	{
		GError* e = NULL;
#line 28 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		e = _inner_error_;
#line 28 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_inner_error_ = NULL;
#line 47 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		g_assert_not_reached ();
#line 28 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		_g_error_free0 (e);
#line 281 "TProcessingInstructionTest.c"
	}
	__finally156:
#line 28 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 28 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.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/TProcessingInstructionTest.vala"
		g_clear_error (&_inner_error_);
#line 28 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
		return;
#line 292 "TProcessingInstructionTest.c"
	}
}


static void ___lambda218__gcallback (void) {
#line 27 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
	__lambda218_ ();
#line 300 "TProcessingInstructionTest.c"
}


void tprocessing_instruction_test_add_tests (void) {
#line 27 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
	g_test_add_func ("/gxml/t-processinginstruction", ___lambda218__gcallback);
#line 307 "TProcessingInstructionTest.c"
}


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


TProcessingInstructionTest* tprocessing_instruction_test_new (void) {
#line 25 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
	return tprocessing_instruction_test_construct (TYPE_TPROCESSING_INSTRUCTION_TEST);
#line 324 "TProcessingInstructionTest.c"
}


static void tprocessing_instruction_test_class_init (TProcessingInstructionTestClass * klass) {
#line 25 "/home/despinosa/Proyectos/gxml/test/TProcessingInstructionTest.vala"
	tprocessing_instruction_test_parent_class = g_type_class_peek_parent (klass);
#line 331 "TProcessingInstructionTest.c"
}


static void tprocessing_instruction_test_instance_init (TProcessingInstructionTest * self) {
}


GType tprocessing_instruction_test_get_type (void) {
	static volatile gsize tprocessing_instruction_test_type_id__volatile = 0;
	if (g_once_init_enter (&tprocessing_instruction_test_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (TProcessingInstructionTestClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tprocessing_instruction_test_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TProcessingInstructionTest), 0, (GInstanceInitFunc) tprocessing_instruction_test_instance_init, NULL };
		GType tprocessing_instruction_test_type_id;
		tprocessing_instruction_test_type_id = g_type_register_static (TYPE_GXML_TEST, "TProcessingInstructionTest", &g_define_type_info, 0);
		g_once_init_leave (&tprocessing_instruction_test_type_id__volatile, tprocessing_instruction_test_type_id);
	}
	return tprocessing_instruction_test_type_id__volatile;
}



