/* where-clause-test.c generated by valac 0.20.1, the Vala compiler
 * generated from where-clause-test.vala, do not modify */

/* where-clause-test.vala
 *
 * Copyright © 2011 Collabora Ltd.
 *             By Siegfried-Angel Gevatter Pujals <siegfried@gevatter.com>
 *
 * This program 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 program 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 General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include "zeitgeist-internal.h"


#define TYPE_PUBLIC_WHERE_CLAUSE (public_where_clause_get_type ())
#define PUBLIC_WHERE_CLAUSE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PUBLIC_WHERE_CLAUSE, PublicWhereClause))
#define PUBLIC_WHERE_CLAUSE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PUBLIC_WHERE_CLAUSE, PublicWhereClauseClass))
#define IS_PUBLIC_WHERE_CLAUSE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PUBLIC_WHERE_CLAUSE))
#define IS_PUBLIC_WHERE_CLAUSE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PUBLIC_WHERE_CLAUSE))
#define PUBLIC_WHERE_CLAUSE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PUBLIC_WHERE_CLAUSE, PublicWhereClauseClass))

typedef struct _PublicWhereClause PublicWhereClause;
typedef struct _PublicWhereClauseClass PublicWhereClauseClass;
typedef struct _PublicWhereClausePrivate PublicWhereClausePrivate;
#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_ptr_array_unref0(var) ((var == NULL) ? NULL : (var = (g_ptr_array_unref (var), NULL)))

struct _PublicWhereClause {
	ZeitgeistWhereClause parent_instance;
	PublicWhereClausePrivate * priv;
};

struct _PublicWhereClauseClass {
	ZeitgeistWhereClauseClass parent_class;
};


static gpointer public_where_clause_parent_class = NULL;

gint _vala_main (gchar** args, int args_length1);
void basic_test (void);
static void _basic_test_gtest_func (void);
void nested_test (void);
static void _nested_test_gtest_func (void);
void nested_negation_test (void);
static void _nested_negation_test_gtest_func (void);
void match_condition_test (void);
static void _match_condition_test_gtest_func (void);
void right_boundary_test (void);
static void _right_boundary_test_gtest_func (void);
GType public_where_clause_get_type (void) G_GNUC_CONST;
enum  {
	PUBLIC_WHERE_CLAUSE_DUMMY_PROPERTY
};
PublicWhereClause* public_where_clause_new (ZeitgeistWhereClauseType type, gboolean negate);
PublicWhereClause* public_where_clause_construct (GType object_type, ZeitgeistWhereClauseType type, gboolean negate);
gchar* public_where_clause_get_right_boundary (const gchar* text);
static void _g_free0_ (gpointer var);


static void _basic_test_gtest_func (void) {
#line 31 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	basic_test ();
#line 82 "where-clause-test.c"
}


static void _nested_test_gtest_func (void) {
#line 32 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	nested_test ();
#line 89 "where-clause-test.c"
}


static void _nested_negation_test_gtest_func (void) {
#line 33 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	nested_negation_test ();
#line 96 "where-clause-test.c"
}


static void _match_condition_test_gtest_func (void) {
#line 34 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	match_condition_test ();
#line 103 "where-clause-test.c"
}


static void _right_boundary_test_gtest_func (void) {
#line 35 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	right_boundary_test ();
#line 110 "where-clause-test.c"
}


gint _vala_main (gchar** args, int args_length1) {
	gint result = 0;
	gint _tmp0_ = 0;
#line 26 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	g_test_init (&args_length1, &args, NULL);
#line 29 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL);
#line 31 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	g_test_add_func ("/WhereClause/basic", _basic_test_gtest_func);
#line 32 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	g_test_add_func ("/WhereClause/nested", _nested_test_gtest_func);
#line 33 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	g_test_add_func ("/WhereClause/nested_negation", _nested_negation_test_gtest_func);
#line 34 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	g_test_add_func ("/WhereClause/match_condition", _match_condition_test_gtest_func);
#line 35 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	g_test_add_func ("/WhereClause/glob/right_boundary", _right_boundary_test_gtest_func);
#line 37 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp0_ = g_test_run ();
#line 37 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	result = _tmp0_;
#line 37 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	return result;
#line 137 "where-clause-test.c"
}


int main (int argc, char ** argv) {
#line 24 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	g_type_init ();
#line 24 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	return _vala_main (argv, argc);
#line 146 "where-clause-test.c"
}


PublicWhereClause* public_where_clause_construct (GType object_type, ZeitgeistWhereClauseType type, gboolean negate) {
	PublicWhereClause * self = NULL;
	ZeitgeistWhereClauseType _tmp0_;
	gboolean _tmp1_;
#line 45 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp0_ = type;
#line 45 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp1_ = negate;
#line 45 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	self = (PublicWhereClause*) zeitgeist_where_clause_construct (object_type, _tmp0_, _tmp1_);
#line 43 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	return self;
#line 162 "where-clause-test.c"
}


PublicWhereClause* public_where_clause_new (ZeitgeistWhereClauseType type, gboolean negate) {
#line 43 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	return public_where_clause_construct (TYPE_PUBLIC_WHERE_CLAUSE, type, negate);
#line 169 "where-clause-test.c"
}


gchar* public_where_clause_get_right_boundary (const gchar* text) {
	gchar* result = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_ = NULL;
#line 48 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	g_return_val_if_fail (text != NULL, NULL);
#line 50 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp0_ = text;
#line 50 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp1_ = zeitgeist_where_clause_get_right_boundary (_tmp0_);
#line 50 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	result = _tmp1_;
#line 50 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	return result;
#line 187 "where-clause-test.c"
}


static void public_where_clause_class_init (PublicWhereClauseClass * klass) {
#line 40 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	public_where_clause_parent_class = g_type_class_peek_parent (klass);
#line 194 "where-clause-test.c"
}


static void public_where_clause_instance_init (PublicWhereClause * self) {
}


GType public_where_clause_get_type (void) {
	static volatile gsize public_where_clause_type_id__volatile = 0;
	if (g_once_init_enter (&public_where_clause_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (PublicWhereClauseClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) public_where_clause_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublicWhereClause), 0, (GInstanceInitFunc) public_where_clause_instance_init, NULL };
		GType public_where_clause_type_id;
		public_where_clause_type_id = g_type_register_static (ZEITGEIST_TYPE_WHERE_CLAUSE, "PublicWhereClause", &g_define_type_info, 0);
		g_once_init_leave (&public_where_clause_type_id__volatile, public_where_clause_type_id);
	}
	return public_where_clause_type_id__volatile;
}


void basic_test (void) {
	ZeitgeistWhereClause* where = NULL;
	ZeitgeistWhereClause* _tmp0_;
	ZeitgeistWhereClause* _tmp1_;
	ZeitgeistWhereClause* _tmp2_;
	ZeitgeistWhereClause* _tmp3_;
	gchar* _tmp4_ = NULL;
	gchar* _tmp5_;
	ZeitgeistWhereClause* _tmp6_;
	ZeitgeistWhereClause* _tmp7_;
	ZeitgeistWhereClause* _tmp8_;
	ZeitgeistWhereClause* _tmp9_;
	gchar* _tmp10_ = NULL;
	gchar* _tmp11_;
	ZeitgeistWhereClause* _tmp12_;
	ZeitgeistWhereClause* _tmp13_;
	ZeitgeistWhereClause* _tmp14_;
	gchar* _tmp15_ = NULL;
	gchar* _tmp16_;
#line 59 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp0_ = zeitgeist_where_clause_new (ZEITGEIST_WHERE_CLAUSE_TYPE_AND, FALSE);
#line 59 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_g_object_unref0 (where);
#line 59 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	where = _tmp0_;
#line 60 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp1_ = where;
#line 60 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	zeitgeist_where_clause_add (_tmp1_, "1st condition", NULL);
#line 61 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp2_ = where;
#line 61 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	zeitgeist_where_clause_add (_tmp2_, "2nd condition", NULL);
#line 62 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp3_ = where;
#line 62 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp4_ = zeitgeist_where_clause_get_sql_conditions (_tmp3_);
#line 62 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp5_ = _tmp4_;
#line 62 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	g_assert_cmpstr (_tmp5_, ==, "(1st condition AND 2nd condition)");
#line 62 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_g_free0 (_tmp5_);
#line 64 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp6_ = zeitgeist_where_clause_new (ZEITGEIST_WHERE_CLAUSE_TYPE_OR, FALSE);
#line 64 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_g_object_unref0 (where);
#line 64 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	where = _tmp6_;
#line 65 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp7_ = where;
#line 65 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	zeitgeist_where_clause_add (_tmp7_, "1st condition", NULL);
#line 66 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp8_ = where;
#line 66 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	zeitgeist_where_clause_add (_tmp8_, "2nd condition", NULL);
#line 67 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp9_ = where;
#line 67 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp10_ = zeitgeist_where_clause_get_sql_conditions (_tmp9_);
#line 67 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp11_ = _tmp10_;
#line 67 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	g_assert_cmpstr (_tmp11_, ==, "(1st condition OR 2nd condition)");
#line 67 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_g_free0 (_tmp11_);
#line 69 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp12_ = zeitgeist_where_clause_new (ZEITGEIST_WHERE_CLAUSE_TYPE_AND, TRUE);
#line 69 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_g_object_unref0 (where);
#line 69 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	where = _tmp12_;
#line 70 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp13_ = where;
#line 70 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	zeitgeist_where_clause_add (_tmp13_, "some condition", NULL);
#line 71 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp14_ = where;
#line 71 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp15_ = zeitgeist_where_clause_get_sql_conditions (_tmp14_);
#line 71 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp16_ = _tmp15_;
#line 71 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	g_assert_cmpstr (_tmp16_, ==, "NOT some condition");
#line 71 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_g_free0 (_tmp16_);
#line 55 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_g_object_unref0 (where);
#line 303 "where-clause-test.c"
}


static void _g_free0_ (gpointer var) {
#line 81 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	var = (g_free (var), NULL);
#line 310 "where-clause-test.c"
}


static gpointer _g_ptr_array_ref0 (gpointer self) {
#line 96 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	return self ? g_ptr_array_ref (self) : NULL;
#line 317 "where-clause-test.c"
}


static gint g_ptr_array_get_length (GPtrArray* self) {
	gint result;
	guint _tmp0_;
#line 4095 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, 0);
#line 4095 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
	_tmp0_ = self->len;
#line 4095 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
	result = (gint) _tmp0_;
#line 4095 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
	return result;
#line 332 "where-clause-test.c"
}


static void g_ptr_array_set_length (GPtrArray* self, gint value) {
	gint _tmp0_;
#line 4096 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
	g_return_if_fail (self != NULL);
#line 4096 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
	_tmp0_ = value;
#line 4096 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
	g_ptr_array_set_size (self, _tmp0_);
#line 344 "where-clause-test.c"
}


void nested_test (void) {
	ZeitgeistWhereClause* _tmp0_;
	ZeitgeistWhereClause* where;
	ZeitgeistWhereClause* _tmp1_;
	ZeitgeistWhereClause* subwhere;
	gchar* _tmp5_ = NULL;
	gchar* _tmp6_;
#line 76 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp0_ = zeitgeist_where_clause_new (ZEITGEIST_WHERE_CLAUSE_TYPE_AND, FALSE);
#line 76 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	where = _tmp0_;
#line 77 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	zeitgeist_where_clause_add (where, "1st condition", "arg1");
#line 79 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp1_ = zeitgeist_where_clause_new (ZEITGEIST_WHERE_CLAUSE_TYPE_OR, FALSE);
#line 79 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	subwhere = _tmp1_;
#line 365 "where-clause-test.c"
	{
		GPtrArray* _tmp2_;
		GPtrArray* args;
		gchar* _tmp3_;
		gchar* _tmp4_;
#line 81 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
		_tmp2_ = g_ptr_array_new_with_free_func (_g_free0_);
#line 81 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
		args = _tmp2_;
#line 82 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
		_tmp3_ = g_strdup ("arg2");
#line 82 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
		g_ptr_array_add (args, _tmp3_);
#line 83 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
		_tmp4_ = g_strdup ("arg3");
#line 83 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
		g_ptr_array_add (args, _tmp4_);
#line 84 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
		zeitgeist_where_clause_add_with_array (subwhere, "2nd condition", args);
#line 85 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
		zeitgeist_where_clause_add (subwhere, "3rd condition", NULL);
#line 80 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
		_g_ptr_array_unref0 (args);
#line 389 "where-clause-test.c"
	}
#line 88 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	zeitgeist_where_clause_extend (where, subwhere);
#line 89 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	zeitgeist_where_clause_add (where, "last condition", NULL);
#line 91 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp5_ = zeitgeist_where_clause_get_sql_conditions (where);
#line 91 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp6_ = _tmp5_;
#line 91 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	g_assert_cmpstr (_tmp6_, ==, "(1st condition AND (2nd condition OR 3rd condition) AND " "last condition)");
#line 91 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_g_free0 (_tmp6_);
#line 403 "where-clause-test.c"
	{
		GPtrArray* _tmp7_ = NULL;
		GPtrArray* _tmp8_;
		GPtrArray* args;
		gint _tmp9_;
		gint _tmp10_;
		gconstpointer _tmp11_ = NULL;
		gconstpointer _tmp12_ = NULL;
		gconstpointer _tmp13_ = NULL;
#line 96 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
		_tmp7_ = zeitgeist_where_clause_get_bind_arguments (where);
#line 96 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
		_tmp8_ = _g_ptr_array_ref0 (_tmp7_);
#line 96 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
		args = _tmp8_;
#line 97 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
		_tmp9_ = g_ptr_array_get_length (args);
#line 97 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
		_tmp10_ = _tmp9_;
#line 97 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
		g_assert_cmpint (_tmp10_, ==, 3);
#line 98 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
		_tmp11_ = g_ptr_array_index (args, (guint) 0);
#line 98 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
		g_assert_cmpstr ((const gchar*) _tmp11_, ==, "arg1");
#line 99 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
		_tmp12_ = g_ptr_array_index (args, (guint) 1);
#line 99 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
		g_assert_cmpstr ((const gchar*) _tmp12_, ==, "arg2");
#line 100 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
		_tmp13_ = g_ptr_array_index (args, (guint) 2);
#line 100 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
		g_assert_cmpstr ((const gchar*) _tmp13_, ==, "arg3");
#line 95 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
		_g_ptr_array_unref0 (args);
#line 439 "where-clause-test.c"
	}
#line 74 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_g_object_unref0 (subwhere);
#line 74 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_g_object_unref0 (where);
#line 445 "where-clause-test.c"
}


void nested_negation_test (void) {
	ZeitgeistWhereClause* _tmp0_;
	ZeitgeistWhereClause* where;
	ZeitgeistWhereClause* _tmp1_;
	ZeitgeistWhereClause* subwhere;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_;
#line 106 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp0_ = zeitgeist_where_clause_new (ZEITGEIST_WHERE_CLAUSE_TYPE_OR, FALSE);
#line 106 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	where = _tmp0_;
#line 107 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	zeitgeist_where_clause_add (where, "cond1", "arg1");
#line 109 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp1_ = zeitgeist_where_clause_new (ZEITGEIST_WHERE_CLAUSE_TYPE_OR, TRUE);
#line 109 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	subwhere = _tmp1_;
#line 110 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	zeitgeist_where_clause_add (subwhere, "cond2", NULL);
#line 112 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	zeitgeist_where_clause_extend (where, subwhere);
#line 113 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	zeitgeist_where_clause_add (where, "cond3", NULL);
#line 115 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp2_ = zeitgeist_where_clause_get_sql_conditions (where);
#line 115 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp3_ = _tmp2_;
#line 115 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	g_assert_cmpstr (_tmp3_, ==, "(cond1 OR NOT cond2 OR cond3)");
#line 115 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_g_free0 (_tmp3_);
#line 104 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_g_object_unref0 (subwhere);
#line 104 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_g_object_unref0 (where);
#line 484 "where-clause-test.c"
}


void match_condition_test (void) {
	ZeitgeistWhereClause* where = NULL;
	ZeitgeistWhereClause* _tmp0_;
	ZeitgeistWhereClause* _tmp1_;
	ZeitgeistWhereClause* _tmp2_;
	gchar* _tmp3_ = NULL;
	gchar* _tmp4_;
	ZeitgeistWhereClause* _tmp5_;
	GPtrArray* _tmp6_ = NULL;
	gint _tmp7_;
	gint _tmp8_;
	ZeitgeistWhereClause* _tmp9_;
	ZeitgeistWhereClause* _tmp10_;
	ZeitgeistWhereClause* _tmp11_;
	gchar* _tmp12_ = NULL;
	gchar* _tmp13_;
#line 124 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp0_ = zeitgeist_where_clause_new (ZEITGEIST_WHERE_CLAUSE_TYPE_AND, FALSE);
#line 124 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_g_object_unref0 (where);
#line 124 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	where = _tmp0_;
#line 125 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp1_ = where;
#line 125 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	zeitgeist_where_clause_add_match_condition (_tmp1_, "field1", 5, FALSE);
#line 126 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp2_ = where;
#line 126 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp3_ = zeitgeist_where_clause_get_sql_conditions (_tmp2_);
#line 126 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp4_ = _tmp3_;
#line 126 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	g_assert_cmpstr (_tmp4_, ==, "field1 = 5");
#line 126 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_g_free0 (_tmp4_);
#line 128 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp5_ = where;
#line 128 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp6_ = zeitgeist_where_clause_get_bind_arguments (_tmp5_);
#line 128 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp7_ = g_ptr_array_get_length (_tmp6_);
#line 128 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp8_ = _tmp7_;
#line 128 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	g_assert_cmpint (_tmp8_, ==, 0);
#line 131 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp9_ = zeitgeist_where_clause_new (ZEITGEIST_WHERE_CLAUSE_TYPE_AND, FALSE);
#line 131 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_g_object_unref0 (where);
#line 131 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	where = _tmp9_;
#line 132 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp10_ = where;
#line 132 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	zeitgeist_where_clause_add_match_condition (_tmp10_, "f2", 3, TRUE);
#line 133 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp11_ = where;
#line 133 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp12_ = zeitgeist_where_clause_get_sql_conditions (_tmp11_);
#line 133 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp13_ = _tmp12_;
#line 133 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	g_assert_cmpstr (_tmp13_, ==, "f2 != 3");
#line 133 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_g_free0 (_tmp13_);
#line 119 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_g_object_unref0 (where);
#line 556 "where-clause-test.c"
}


void right_boundary_test (void) {
	PublicWhereClause* _tmp0_;
	PublicWhereClause* clause;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_;
	gchar* _tmp3_ = NULL;
	gchar* _tmp4_;
	gchar* _tmp5_ = NULL;
	gchar* _tmp6_;
#line 140 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp0_ = public_where_clause_new (ZEITGEIST_WHERE_CLAUSE_TYPE_AND, FALSE);
#line 140 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	clause = _tmp0_;
#line 141 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp1_ = public_where_clause_get_right_boundary ("a");
#line 141 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp2_ = _tmp1_;
#line 141 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	g_assert_cmpstr (_tmp2_, ==, "b");
#line 141 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_g_free0 (_tmp2_);
#line 142 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp3_ = public_where_clause_get_right_boundary ("hello");
#line 142 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp4_ = _tmp3_;
#line 142 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	g_assert_cmpstr (_tmp4_, ==, "hellp");
#line 142 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_g_free0 (_tmp4_);
#line 143 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp5_ = public_where_clause_get_right_boundary ("a b");
#line 143 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_tmp6_ = _tmp5_;
#line 143 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	g_assert_cmpstr (_tmp6_, ==, "a c");
#line 143 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_g_free0 (_tmp6_);
#line 138 "/home/manish/code/zeitgeist/test/direct/where-clause-test.vala"
	_g_object_unref0 (clause);
#line 599 "where-clause-test.c"
}



