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

/* -*- Mode: vala; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
/* Notation.vala
 *
 * Copyright (C) 2016  Daniel Espinosa <esodan@gmail.com>
 * Copyright (C) 2016  Yannick Inizan <inizan.yannick@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>
 *      Yannick Inizan <inizan.yannick@gmail.com>
 */

#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gxml/gxml.h>
#include <gio/gio.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_XPATH_TEST (xpath_test_get_type ())
#define XPATH_TEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_XPATH_TEST, XPathTest))
#define XPATH_TEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_XPATH_TEST, XPathTestClass))
#define IS_XPATH_TEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_XPATH_TEST))
#define IS_XPATH_TEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_XPATH_TEST))
#define XPATH_TEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_XPATH_TEST, XPathTestClass))

typedef struct _XPathTest XPathTest;
typedef struct _XPathTestClass XPathTestClass;
typedef struct _XPathTestPrivate XPathTestPrivate;
#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 _XPathTest {
	GXmlTest parent_instance;
	XPathTestPrivate * priv;
};

struct _XPathTestClass {
	GXmlTestClass parent_class;
};

static gpointer xpath_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 xpath_test_get_type (void) G_GNUC_CONST;
#define XPATH_TEST_BOOKS "<bookstore><book category=\"COOKING\"><title lang=\"en\">Everyday Ital" \
"ian</title><author>Giada De Laurentiis</author><year>2005</year><price" \
">30.00</price></book><book category=\"CHILDREN\"><title lang=\"en\">Ha" \
"rry Potter</title><author>J K. Rowling</author><year>2005</year><price" \
">29.99</price></book><book category=\"WEB\"><title lang=\"en\">XQuery " \
"Kick Start</title><author>James McGovern</author><author>Per Bothner</" \
"author><author>Kurt Cagle</author><author>James Linn</author><author>V" \
"aidyanathan Nagarajan</author><year>2003</year><price>49.99</price></b" \
"ook><book category=\"WEB\"><title lang=\"en\">Learning XML</title><aut" \
"hor>Erik T. Ray</author><year>2003</year><price>39.95</price></book></" \
"bookstore>"
void xpath_test_add_tests (void);
static void __lambda60_ (void);
static void ___lambda60__gtest_func (void);
XPathTest* xpath_test_new (void);
XPathTest* xpath_test_construct (GType object_type);
GXmlTest* gxml_test_new (void);
GXmlTest* gxml_test_construct (GType object_type);
static void _vala_array_destroy (gpointer array,
                          gint array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gint array_length,
                       GDestroyNotify destroy_func);

static void
__lambda60_ (void)
{
	GError* _inner_error0_ = NULL;
	{
		GXmlDocument* document = NULL;
		GFile* rf = NULL;
		GFile* _tmp0_;
		GFile* _tmp1_;
		GXmlDocument* _tmp8_;
		GXmlXPathObject* object = NULL;
		GXmlDocument* _tmp9_;
		GXmlXPathObject* _tmp10_;
		GXmlXPathObject* _tmp11_;
		GXmlXPathObjectType _tmp12_;
		GXmlXPathObjectType _tmp13_;
		GXmlDomElement** array = NULL;
		GXmlXPathObject* _tmp14_;
		GXmlDomHTMLCollection* _tmp15_;
		GXmlDomHTMLCollection* _tmp16_;
		gint _tmp17_ = 0;
		GXmlDomElement** _tmp18_;
		gint array_length1;
		gint _array_size_;
		GXmlDomElement** _tmp19_;
		gint _tmp19__length1;
		GXmlDomElement** _tmp20_;
		gint _tmp20__length1;
		GXmlDomElement* _tmp21_;
		gchar* _tmp22_;
		gchar* _tmp23_;
		gchar* _tmp24_;
		GXmlDomElement** _tmp25_;
		gint _tmp25__length1;
		GXmlDomElement* _tmp26_;
		gchar* _tmp27_;
		gchar* _tmp28_;
		gchar* _tmp29_;
		GXmlDomElement** _tmp30_;
		gint _tmp30__length1;
		GXmlDomElement* _tmp31_;
		gchar* _tmp32_;
		gchar* _tmp33_;
		gchar* _tmp34_;
		GXmlDomElement** _tmp35_;
		gint _tmp35__length1;
		GXmlDomElement* _tmp36_;
		gchar* _tmp37_;
		gchar* _tmp38_;
		gchar* _tmp39_;
		GXmlXPathObject* _tmp40_ = NULL;
		GXmlDocument* _tmp41_;
		GXmlXPathObject* _tmp42_;
		GXmlXPathObject* _tmp43_;
		GXmlXPathObject* _tmp44_;
		GXmlXPathObjectType _tmp45_;
		GXmlXPathObjectType _tmp46_;
		GXmlXPathObject* _tmp47_;
		GXmlDomHTMLCollection* _tmp48_;
		GXmlDomHTMLCollection* _tmp49_;
		gint _tmp50_ = 0;
		GXmlDomElement** _tmp51_;
		GXmlDomElement** _tmp52_;
		gint _tmp52__length1;
		GXmlDomElement** _tmp53_;
		gint _tmp53__length1;
		GXmlDomElement* _tmp54_;
		gchar* _tmp55_;
		gchar* _tmp56_;
		gchar* _tmp57_;
		GXmlXPathObject* _tmp58_ = NULL;
		GXmlDocument* _tmp59_;
		GXmlXPathObject* _tmp60_;
		GXmlXPathObject* _tmp61_;
		GXmlXPathObject* _tmp62_;
		GXmlXPathObjectType _tmp63_;
		GXmlXPathObjectType _tmp64_;
		GXmlXPathObject* _tmp65_;
		GXmlDomHTMLCollection* _tmp66_;
		GXmlDomHTMLCollection* _tmp67_;
		gint _tmp68_ = 0;
		GXmlDomElement** _tmp69_;
		GXmlDomElement** _tmp70_;
		gint _tmp70__length1;
		GXmlDomElement** _tmp71_;
		gint _tmp71__length1;
		GXmlDomElement* _tmp72_;
		gchar* _tmp73_;
		gchar* _tmp74_;
		gchar* _tmp75_;
		GXmlDomElement** _tmp76_;
		gint _tmp76__length1;
		GXmlDomElement* _tmp77_;
		gchar* _tmp78_;
		gchar* _tmp79_;
		gchar* _tmp80_;
		GXmlDomElement** _tmp81_;
		gint _tmp81__length1;
		GXmlDomElement* _tmp82_;
		gchar* _tmp83_;
		gchar* _tmp84_;
		gchar* _tmp85_;
		GXmlDomElement** _tmp86_;
		gint _tmp86__length1;
		GXmlDomElement* _tmp87_;
		gchar* _tmp88_;
		gchar* _tmp89_;
		gchar* _tmp90_;
		GXmlXPathObject* _tmp91_ = NULL;
		GXmlDocument* _tmp92_;
		GXmlXPathObject* _tmp93_;
		GXmlXPathObject* _tmp94_;
		GXmlXPathObject* _tmp95_;
		GXmlXPathObjectType _tmp96_;
		GXmlXPathObjectType _tmp97_;
		GXmlXPathObject* _tmp98_;
		GXmlDomHTMLCollection* _tmp99_;
		GXmlDomHTMLCollection* _tmp100_;
		gint _tmp101_ = 0;
		GXmlDomElement** _tmp102_;
		GXmlDomElement** _tmp103_;
		gint _tmp103__length1;
		GXmlDomElement** _tmp104_;
		gint _tmp104__length1;
		GXmlDomElement* _tmp105_;
		gchar* _tmp106_;
		gchar* _tmp107_;
		gchar* _tmp108_;
		GXmlDomElement** _tmp109_;
		gint _tmp109__length1;
		GXmlDomElement* _tmp110_;
		gchar* _tmp111_;
		gchar* _tmp112_;
		gchar* _tmp113_;
#line 33 "XPathTest.vala"
		document = NULL;
#line 34 "XPathTest.vala"
		_tmp0_ = g_file_new_for_uri ("http://www.w3schools.com/xsl/books.xml");
#line 34 "XPathTest.vala"
		rf = _tmp0_;
#line 35 "XPathTest.vala"
		_tmp1_ = rf;
#line 35 "XPathTest.vala"
		if (g_file_query_exists (_tmp1_, NULL)) {
#line 260 "XPathTest.c"
			GXmlGDocument* _tmp2_ = NULL;
			GXmlGDocument* _tmp3_;
			GXmlGDocument* _tmp4_;
#line 36 "XPathTest.vala"
			_tmp3_ = gxml_gdocument_new_from_uri ("http://www.w3schools.com/xsl/books.xml", 0, &_inner_error0_);
#line 36 "XPathTest.vala"
			_tmp2_ = _tmp3_;
#line 36 "XPathTest.vala"
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 36 "XPathTest.vala"
				_g_object_unref0 (rf);
#line 36 "XPathTest.vala"
				_g_object_unref0 (document);
#line 274 "XPathTest.c"
				goto __catch71_g_error;
			}
#line 36 "XPathTest.vala"
			_tmp4_ = _tmp2_;
#line 36 "XPathTest.vala"
			_tmp2_ = NULL;
#line 36 "XPathTest.vala"
			_g_object_unref0 (document);
#line 36 "XPathTest.vala"
			document = (GXmlDocument*) _tmp4_;
#line 35 "XPathTest.vala"
			_g_object_unref0 (_tmp2_);
#line 287 "XPathTest.c"
		} else {
			GXmlGDocument* _tmp5_ = NULL;
			GXmlGDocument* _tmp6_;
			GXmlGDocument* _tmp7_;
#line 38 "XPathTest.vala"
			_tmp6_ = gxml_gdocument_new_from_string (XPATH_TEST_BOOKS, 0, &_inner_error0_);
#line 38 "XPathTest.vala"
			_tmp5_ = _tmp6_;
#line 38 "XPathTest.vala"
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 38 "XPathTest.vala"
				_g_object_unref0 (rf);
#line 38 "XPathTest.vala"
				_g_object_unref0 (document);
#line 302 "XPathTest.c"
				goto __catch71_g_error;
			}
#line 38 "XPathTest.vala"
			_tmp7_ = _tmp5_;
#line 38 "XPathTest.vala"
			_tmp5_ = NULL;
#line 38 "XPathTest.vala"
			_g_object_unref0 (document);
#line 38 "XPathTest.vala"
			document = (GXmlDocument*) _tmp7_;
#line 35 "XPathTest.vala"
			_g_object_unref0 (_tmp5_);
#line 315 "XPathTest.c"
		}
#line 39 "XPathTest.vala"
		_tmp8_ = document;
#line 39 "XPathTest.vala"
		_vala_assert (_tmp8_ != NULL, "document != null");
#line 40 "XPathTest.vala"
		_tmp9_ = document;
#line 40 "XPathTest.vala"
		_tmp10_ = gxml_xpath_context_evaluate (G_TYPE_CHECK_INSTANCE_TYPE (_tmp9_, GXML_TYPE_XPATH_CONTEXT) ? ((GXmlXPathContext*) _tmp9_) : NULL, "/bookstore/book/title", NULL, &_inner_error0_);
#line 40 "XPathTest.vala"
		object = _tmp10_;
#line 40 "XPathTest.vala"
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 40 "XPathTest.vala"
			_g_object_unref0 (rf);
#line 40 "XPathTest.vala"
			_g_object_unref0 (document);
#line 333 "XPathTest.c"
			goto __catch71_g_error;
		}
#line 41 "XPathTest.vala"
		_tmp11_ = object;
#line 41 "XPathTest.vala"
		_tmp12_ = gxml_xpath_object_get_object_type (_tmp11_);
#line 41 "XPathTest.vala"
		_tmp13_ = _tmp12_;
#line 41 "XPathTest.vala"
		_vala_assert (_tmp13_ == GXML_XPATH_OBJECT_TYPE_NODESET, "object.object_type == XPathObjectType.NODESET");
#line 42 "XPathTest.vala"
		_tmp14_ = object;
#line 42 "XPathTest.vala"
		_tmp15_ = gxml_xpath_object_get_nodeset (_tmp14_);
#line 42 "XPathTest.vala"
		_tmp16_ = _tmp15_;
#line 42 "XPathTest.vala"
		_tmp18_ = gxml_dom_html_collection_to_array (_tmp16_, &_tmp17_);
#line 42 "XPathTest.vala"
		array = _tmp18_;
#line 42 "XPathTest.vala"
		array_length1 = _tmp17_;
#line 42 "XPathTest.vala"
		_array_size_ = array_length1;
#line 43 "XPathTest.vala"
		_tmp19_ = array;
#line 43 "XPathTest.vala"
		_tmp19__length1 = array_length1;
#line 43 "XPathTest.vala"
		_vala_assert (_tmp19__length1 == 4, "array.length == 4");
#line 44 "XPathTest.vala"
		_tmp20_ = array;
#line 44 "XPathTest.vala"
		_tmp20__length1 = array_length1;
#line 44 "XPathTest.vala"
		_tmp21_ = _tmp20_[0];
#line 44 "XPathTest.vala"
		_tmp22_ = gxml_dom_node_get_node_value ((GXmlDomNode*) _tmp21_);
#line 44 "XPathTest.vala"
		_tmp23_ = _tmp22_;
#line 44 "XPathTest.vala"
		_tmp24_ = _tmp23_;
#line 44 "XPathTest.vala"
		_vala_assert (g_strcmp0 (_tmp24_, "Everyday Italian") == 0, "array[0].node_value == \"Everyday Italian\"");
#line 44 "XPathTest.vala"
		_g_free0 (_tmp24_);
#line 45 "XPathTest.vala"
		_tmp25_ = array;
#line 45 "XPathTest.vala"
		_tmp25__length1 = array_length1;
#line 45 "XPathTest.vala"
		_tmp26_ = _tmp25_[1];
#line 45 "XPathTest.vala"
		_tmp27_ = gxml_dom_node_get_node_value ((GXmlDomNode*) _tmp26_);
#line 45 "XPathTest.vala"
		_tmp28_ = _tmp27_;
#line 45 "XPathTest.vala"
		_tmp29_ = _tmp28_;
#line 45 "XPathTest.vala"
		_vala_assert (g_strcmp0 (_tmp29_, "Harry Potter") == 0, "array[1].node_value == \"Harry Potter\"");
#line 45 "XPathTest.vala"
		_g_free0 (_tmp29_);
#line 46 "XPathTest.vala"
		_tmp30_ = array;
#line 46 "XPathTest.vala"
		_tmp30__length1 = array_length1;
#line 46 "XPathTest.vala"
		_tmp31_ = _tmp30_[2];
#line 46 "XPathTest.vala"
		_tmp32_ = gxml_dom_node_get_node_value ((GXmlDomNode*) _tmp31_);
#line 46 "XPathTest.vala"
		_tmp33_ = _tmp32_;
#line 46 "XPathTest.vala"
		_tmp34_ = _tmp33_;
#line 46 "XPathTest.vala"
		_vala_assert (g_strcmp0 (_tmp34_, "XQuery Kick Start") == 0, "array[2].node_value == \"XQuery Kick Start\"");
#line 46 "XPathTest.vala"
		_g_free0 (_tmp34_);
#line 47 "XPathTest.vala"
		_tmp35_ = array;
#line 47 "XPathTest.vala"
		_tmp35__length1 = array_length1;
#line 47 "XPathTest.vala"
		_tmp36_ = _tmp35_[3];
#line 47 "XPathTest.vala"
		_tmp37_ = gxml_dom_node_get_node_value ((GXmlDomNode*) _tmp36_);
#line 47 "XPathTest.vala"
		_tmp38_ = _tmp37_;
#line 47 "XPathTest.vala"
		_tmp39_ = _tmp38_;
#line 47 "XPathTest.vala"
		_vala_assert (g_strcmp0 (_tmp39_, "Learning XML") == 0, "array[3].node_value == \"Learning XML\"");
#line 47 "XPathTest.vala"
		_g_free0 (_tmp39_);
#line 48 "XPathTest.vala"
		_tmp41_ = document;
#line 48 "XPathTest.vala"
		_tmp42_ = gxml_xpath_context_evaluate (G_TYPE_CHECK_INSTANCE_TYPE (_tmp41_, GXML_TYPE_XPATH_CONTEXT) ? ((GXmlXPathContext*) _tmp41_) : NULL, "/bookstore/book[1]/title", NULL, &_inner_error0_);
#line 48 "XPathTest.vala"
		_tmp40_ = _tmp42_;
#line 48 "XPathTest.vala"
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 48 "XPathTest.vala"
			array = (_vala_array_free (array, array_length1, (GDestroyNotify) g_object_unref), NULL);
#line 48 "XPathTest.vala"
			_g_object_unref0 (object);
#line 48 "XPathTest.vala"
			_g_object_unref0 (rf);
#line 48 "XPathTest.vala"
			_g_object_unref0 (document);
#line 444 "XPathTest.c"
			goto __catch71_g_error;
		}
#line 48 "XPathTest.vala"
		_tmp43_ = _tmp40_;
#line 48 "XPathTest.vala"
		_tmp40_ = NULL;
#line 48 "XPathTest.vala"
		_g_object_unref0 (object);
#line 48 "XPathTest.vala"
		object = _tmp43_;
#line 49 "XPathTest.vala"
		_tmp44_ = object;
#line 49 "XPathTest.vala"
		_tmp45_ = gxml_xpath_object_get_object_type (_tmp44_);
#line 49 "XPathTest.vala"
		_tmp46_ = _tmp45_;
#line 49 "XPathTest.vala"
		_vala_assert (_tmp46_ == GXML_XPATH_OBJECT_TYPE_NODESET, "object.object_type == XPathObjectType.NODESET");
#line 50 "XPathTest.vala"
		_tmp47_ = object;
#line 50 "XPathTest.vala"
		_tmp48_ = gxml_xpath_object_get_nodeset (_tmp47_);
#line 50 "XPathTest.vala"
		_tmp49_ = _tmp48_;
#line 50 "XPathTest.vala"
		_tmp51_ = gxml_dom_html_collection_to_array (_tmp49_, &_tmp50_);
#line 50 "XPathTest.vala"
		array = (_vala_array_free (array, array_length1, (GDestroyNotify) g_object_unref), NULL);
#line 50 "XPathTest.vala"
		array = _tmp51_;
#line 50 "XPathTest.vala"
		array_length1 = _tmp50_;
#line 50 "XPathTest.vala"
		_array_size_ = array_length1;
#line 51 "XPathTest.vala"
		_tmp52_ = array;
#line 51 "XPathTest.vala"
		_tmp52__length1 = array_length1;
#line 51 "XPathTest.vala"
		_vala_assert (_tmp52__length1 == 1, "array.length == 1");
#line 52 "XPathTest.vala"
		_tmp53_ = array;
#line 52 "XPathTest.vala"
		_tmp53__length1 = array_length1;
#line 52 "XPathTest.vala"
		_tmp54_ = _tmp53_[0];
#line 52 "XPathTest.vala"
		_tmp55_ = gxml_dom_node_get_node_value ((GXmlDomNode*) _tmp54_);
#line 52 "XPathTest.vala"
		_tmp56_ = _tmp55_;
#line 52 "XPathTest.vala"
		_tmp57_ = _tmp56_;
#line 52 "XPathTest.vala"
		_vala_assert (g_strcmp0 (_tmp57_, "Everyday Italian") == 0, "array[0].node_value == \"Everyday Italian\"");
#line 52 "XPathTest.vala"
		_g_free0 (_tmp57_);
#line 53 "XPathTest.vala"
		_tmp59_ = document;
#line 53 "XPathTest.vala"
		_tmp60_ = gxml_xpath_context_evaluate (G_TYPE_CHECK_INSTANCE_TYPE (_tmp59_, GXML_TYPE_XPATH_CONTEXT) ? ((GXmlXPathContext*) _tmp59_) : NULL, "/bookstore/book/price[text()]", NULL, &_inner_error0_);
#line 53 "XPathTest.vala"
		_tmp58_ = _tmp60_;
#line 53 "XPathTest.vala"
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 53 "XPathTest.vala"
			_g_object_unref0 (_tmp40_);
#line 53 "XPathTest.vala"
			array = (_vala_array_free (array, array_length1, (GDestroyNotify) g_object_unref), NULL);
#line 53 "XPathTest.vala"
			_g_object_unref0 (object);
#line 53 "XPathTest.vala"
			_g_object_unref0 (rf);
#line 53 "XPathTest.vala"
			_g_object_unref0 (document);
#line 519 "XPathTest.c"
			goto __catch71_g_error;
		}
#line 53 "XPathTest.vala"
		_tmp61_ = _tmp58_;
#line 53 "XPathTest.vala"
		_tmp58_ = NULL;
#line 53 "XPathTest.vala"
		_g_object_unref0 (object);
#line 53 "XPathTest.vala"
		object = _tmp61_;
#line 54 "XPathTest.vala"
		_tmp62_ = object;
#line 54 "XPathTest.vala"
		_tmp63_ = gxml_xpath_object_get_object_type (_tmp62_);
#line 54 "XPathTest.vala"
		_tmp64_ = _tmp63_;
#line 54 "XPathTest.vala"
		_vala_assert (_tmp64_ == GXML_XPATH_OBJECT_TYPE_NODESET, "object.object_type == XPathObjectType.NODESET");
#line 55 "XPathTest.vala"
		_tmp65_ = object;
#line 55 "XPathTest.vala"
		_tmp66_ = gxml_xpath_object_get_nodeset (_tmp65_);
#line 55 "XPathTest.vala"
		_tmp67_ = _tmp66_;
#line 55 "XPathTest.vala"
		_tmp69_ = gxml_dom_html_collection_to_array (_tmp67_, &_tmp68_);
#line 55 "XPathTest.vala"
		array = (_vala_array_free (array, array_length1, (GDestroyNotify) g_object_unref), NULL);
#line 55 "XPathTest.vala"
		array = _tmp69_;
#line 55 "XPathTest.vala"
		array_length1 = _tmp68_;
#line 55 "XPathTest.vala"
		_array_size_ = array_length1;
#line 56 "XPathTest.vala"
		_tmp70_ = array;
#line 56 "XPathTest.vala"
		_tmp70__length1 = array_length1;
#line 56 "XPathTest.vala"
		_vala_assert (_tmp70__length1 == 4, "array.length == 4");
#line 57 "XPathTest.vala"
		_tmp71_ = array;
#line 57 "XPathTest.vala"
		_tmp71__length1 = array_length1;
#line 57 "XPathTest.vala"
		_tmp72_ = _tmp71_[0];
#line 57 "XPathTest.vala"
		_tmp73_ = gxml_dom_node_get_node_value ((GXmlDomNode*) _tmp72_);
#line 57 "XPathTest.vala"
		_tmp74_ = _tmp73_;
#line 57 "XPathTest.vala"
		_tmp75_ = _tmp74_;
#line 57 "XPathTest.vala"
		_vala_assert (g_strcmp0 (_tmp75_, "30.00") == 0, "array[0].node_value == \"30.00\"");
#line 57 "XPathTest.vala"
		_g_free0 (_tmp75_);
#line 58 "XPathTest.vala"
		_tmp76_ = array;
#line 58 "XPathTest.vala"
		_tmp76__length1 = array_length1;
#line 58 "XPathTest.vala"
		_tmp77_ = _tmp76_[1];
#line 58 "XPathTest.vala"
		_tmp78_ = gxml_dom_node_get_node_value ((GXmlDomNode*) _tmp77_);
#line 58 "XPathTest.vala"
		_tmp79_ = _tmp78_;
#line 58 "XPathTest.vala"
		_tmp80_ = _tmp79_;
#line 58 "XPathTest.vala"
		_vala_assert (g_strcmp0 (_tmp80_, "29.99") == 0, "array[1].node_value == \"29.99\"");
#line 58 "XPathTest.vala"
		_g_free0 (_tmp80_);
#line 59 "XPathTest.vala"
		_tmp81_ = array;
#line 59 "XPathTest.vala"
		_tmp81__length1 = array_length1;
#line 59 "XPathTest.vala"
		_tmp82_ = _tmp81_[2];
#line 59 "XPathTest.vala"
		_tmp83_ = gxml_dom_node_get_node_value ((GXmlDomNode*) _tmp82_);
#line 59 "XPathTest.vala"
		_tmp84_ = _tmp83_;
#line 59 "XPathTest.vala"
		_tmp85_ = _tmp84_;
#line 59 "XPathTest.vala"
		_vala_assert (g_strcmp0 (_tmp85_, "49.99") == 0, "array[2].node_value == \"49.99\"");
#line 59 "XPathTest.vala"
		_g_free0 (_tmp85_);
#line 60 "XPathTest.vala"
		_tmp86_ = array;
#line 60 "XPathTest.vala"
		_tmp86__length1 = array_length1;
#line 60 "XPathTest.vala"
		_tmp87_ = _tmp86_[3];
#line 60 "XPathTest.vala"
		_tmp88_ = gxml_dom_node_get_node_value ((GXmlDomNode*) _tmp87_);
#line 60 "XPathTest.vala"
		_tmp89_ = _tmp88_;
#line 60 "XPathTest.vala"
		_tmp90_ = _tmp89_;
#line 60 "XPathTest.vala"
		_vala_assert (g_strcmp0 (_tmp90_, "39.95") == 0, "array[3].node_value == \"39.95\"");
#line 60 "XPathTest.vala"
		_g_free0 (_tmp90_);
#line 61 "XPathTest.vala"
		_tmp92_ = document;
#line 61 "XPathTest.vala"
		_tmp93_ = gxml_xpath_context_evaluate (G_TYPE_CHECK_INSTANCE_TYPE (_tmp92_, GXML_TYPE_XPATH_CONTEXT) ? ((GXmlXPathContext*) _tmp92_) : NULL, "/bookstore/book[price>35]/price", NULL, &_inner_error0_);
#line 61 "XPathTest.vala"
		_tmp91_ = _tmp93_;
#line 61 "XPathTest.vala"
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 61 "XPathTest.vala"
			_g_object_unref0 (_tmp58_);
#line 61 "XPathTest.vala"
			_g_object_unref0 (_tmp40_);
#line 61 "XPathTest.vala"
			array = (_vala_array_free (array, array_length1, (GDestroyNotify) g_object_unref), NULL);
#line 61 "XPathTest.vala"
			_g_object_unref0 (object);
#line 61 "XPathTest.vala"
			_g_object_unref0 (rf);
#line 61 "XPathTest.vala"
			_g_object_unref0 (document);
#line 644 "XPathTest.c"
			goto __catch71_g_error;
		}
#line 61 "XPathTest.vala"
		_tmp94_ = _tmp91_;
#line 61 "XPathTest.vala"
		_tmp91_ = NULL;
#line 61 "XPathTest.vala"
		_g_object_unref0 (object);
#line 61 "XPathTest.vala"
		object = _tmp94_;
#line 62 "XPathTest.vala"
		_tmp95_ = object;
#line 62 "XPathTest.vala"
		_tmp96_ = gxml_xpath_object_get_object_type (_tmp95_);
#line 62 "XPathTest.vala"
		_tmp97_ = _tmp96_;
#line 62 "XPathTest.vala"
		_vala_assert (_tmp97_ == GXML_XPATH_OBJECT_TYPE_NODESET, "object.object_type == XPathObjectType.NODESET");
#line 63 "XPathTest.vala"
		_tmp98_ = object;
#line 63 "XPathTest.vala"
		_tmp99_ = gxml_xpath_object_get_nodeset (_tmp98_);
#line 63 "XPathTest.vala"
		_tmp100_ = _tmp99_;
#line 63 "XPathTest.vala"
		_tmp102_ = gxml_dom_html_collection_to_array (_tmp100_, &_tmp101_);
#line 63 "XPathTest.vala"
		array = (_vala_array_free (array, array_length1, (GDestroyNotify) g_object_unref), NULL);
#line 63 "XPathTest.vala"
		array = _tmp102_;
#line 63 "XPathTest.vala"
		array_length1 = _tmp101_;
#line 63 "XPathTest.vala"
		_array_size_ = array_length1;
#line 64 "XPathTest.vala"
		_tmp103_ = array;
#line 64 "XPathTest.vala"
		_tmp103__length1 = array_length1;
#line 64 "XPathTest.vala"
		_vala_assert (_tmp103__length1 == 2, "array.length == 2");
#line 65 "XPathTest.vala"
		_tmp104_ = array;
#line 65 "XPathTest.vala"
		_tmp104__length1 = array_length1;
#line 65 "XPathTest.vala"
		_tmp105_ = _tmp104_[0];
#line 65 "XPathTest.vala"
		_tmp106_ = gxml_dom_node_get_node_value ((GXmlDomNode*) _tmp105_);
#line 65 "XPathTest.vala"
		_tmp107_ = _tmp106_;
#line 65 "XPathTest.vala"
		_tmp108_ = _tmp107_;
#line 65 "XPathTest.vala"
		_vala_assert (g_strcmp0 (_tmp108_, "49.99") == 0, "array[0].node_value == \"49.99\"");
#line 65 "XPathTest.vala"
		_g_free0 (_tmp108_);
#line 66 "XPathTest.vala"
		_tmp109_ = array;
#line 66 "XPathTest.vala"
		_tmp109__length1 = array_length1;
#line 66 "XPathTest.vala"
		_tmp110_ = _tmp109_[1];
#line 66 "XPathTest.vala"
		_tmp111_ = gxml_dom_node_get_node_value ((GXmlDomNode*) _tmp110_);
#line 66 "XPathTest.vala"
		_tmp112_ = _tmp111_;
#line 66 "XPathTest.vala"
		_tmp113_ = _tmp112_;
#line 66 "XPathTest.vala"
		_vala_assert (g_strcmp0 (_tmp113_, "39.95") == 0, "array[1].node_value == \"39.95\"");
#line 66 "XPathTest.vala"
		_g_free0 (_tmp113_);
#line 32 "XPathTest.vala"
		_g_object_unref0 (_tmp91_);
#line 32 "XPathTest.vala"
		_g_object_unref0 (_tmp58_);
#line 32 "XPathTest.vala"
		_g_object_unref0 (_tmp40_);
#line 32 "XPathTest.vala"
		array = (_vala_array_free (array, array_length1, (GDestroyNotify) g_object_unref), NULL);
#line 32 "XPathTest.vala"
		_g_object_unref0 (object);
#line 32 "XPathTest.vala"
		_g_object_unref0 (rf);
#line 32 "XPathTest.vala"
		_g_object_unref0 (document);
#line 731 "XPathTest.c"
	}
	goto __finally71;
	__catch71_g_error:
	{
		GError* e = NULL;
		const gchar* _tmp114_;
		gchar* _tmp115_;
		gchar* _tmp116_;
#line 32 "XPathTest.vala"
		e = _inner_error0_;
#line 32 "XPathTest.vala"
		_inner_error0_ = NULL;
#line 68 "XPathTest.vala"
		_tmp114_ = e->message;
#line 68 "XPathTest.vala"
		_tmp115_ = g_strconcat ("ERROR: ", _tmp114_, NULL);
#line 68 "XPathTest.vala"
		_tmp116_ = _tmp115_;
#line 68 "XPathTest.vala"
		g_message ("XPathTest.vala:68: %s", _tmp116_);
#line 68 "XPathTest.vala"
		_g_free0 (_tmp116_);
#line 69 "XPathTest.vala"
		g_assert_not_reached ();
#line 32 "XPathTest.vala"
		_g_error_free0 (e);
#line 758 "XPathTest.c"
	}
	__finally71:
#line 32 "XPathTest.vala"
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 32 "XPathTest.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
#line 32 "XPathTest.vala"
		g_clear_error (&_inner_error0_);
#line 32 "XPathTest.vala"
		return;
#line 769 "XPathTest.c"
	}
}

static void
___lambda60__gtest_func (void)
{
#line 31 "XPathTest.vala"
	__lambda60_ ();
#line 778 "XPathTest.c"
}

void
xpath_test_add_tests (void)
{
#line 31 "XPathTest.vala"
	g_test_add_func ("/gxml/gelement/xpath", ___lambda60__gtest_func);
#line 786 "XPathTest.c"
}

XPathTest*
xpath_test_construct (GType object_type)
{
	XPathTest* self = NULL;
#line 27 "XPathTest.vala"
	self = (XPathTest*) gxml_test_construct (object_type);
#line 27 "XPathTest.vala"
	return self;
#line 797 "XPathTest.c"
}

XPathTest*
xpath_test_new (void)
{
#line 27 "XPathTest.vala"
	return xpath_test_construct (TYPE_XPATH_TEST);
#line 805 "XPathTest.c"
}

static void
xpath_test_class_init (XPathTestClass * klass,
                       gpointer klass_data)
{
#line 27 "XPathTest.vala"
	xpath_test_parent_class = g_type_class_peek_parent (klass);
#line 814 "XPathTest.c"
}

static void
xpath_test_instance_init (XPathTest * self,
                          gpointer klass)
{
}

GType
xpath_test_get_type (void)
{
	static volatile gsize xpath_test_type_id__volatile = 0;
	if (g_once_init_enter (&xpath_test_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (XPathTestClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xpath_test_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XPathTest), 0, (GInstanceInitFunc) xpath_test_instance_init, NULL };
		GType xpath_test_type_id;
		xpath_test_type_id = g_type_register_static (TYPE_GXML_TEST, "XPathTest", &g_define_type_info, 0);
		g_once_init_leave (&xpath_test_type_id__volatile, xpath_test_type_id);
	}
	return xpath_test_type_id__volatile;
}

static void
_vala_array_destroy (gpointer array,
                     gint array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gint array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

