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

/* testreadonlylist.vala
 *
 * Copyright (C) 2008  Jürg Billeter
 * Copyright (C) 2009  Didier Villevalois
 *
 * 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, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * Author:
 * 	Tomaž Vajngerl <quikee@gmail.com>
 * 	Julien Peeters <contact@julienpeeters.fr>
 * 	Didier 'Ptitjes' Villevalois <ptitjes@free.fr>
 */

#include <glib-object.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>

#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define GEE_TYPE_TEST_CASE (gee_test_case_get_type ())
#define GEE_TEST_CASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TEST_CASE, GeeTestCase))
#define GEE_TEST_CASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TEST_CASE, GeeTestCaseClass))
#define GEE_IS_TEST_CASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TEST_CASE))
#define GEE_IS_TEST_CASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_TEST_CASE))
#define GEE_TEST_CASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_TEST_CASE, GeeTestCaseClass))

typedef struct _GeeTestCase GeeTestCase;
typedef struct _GeeTestCaseClass GeeTestCaseClass;
typedef struct _GeeTestCasePrivate GeeTestCasePrivate;

#define TYPE_READ_ONLY_COLLECTION_TESTS (read_only_collection_tests_get_type ())
#define READ_ONLY_COLLECTION_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_READ_ONLY_COLLECTION_TESTS, ReadOnlyCollectionTests))
#define READ_ONLY_COLLECTION_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_READ_ONLY_COLLECTION_TESTS, ReadOnlyCollectionTestsClass))
#define IS_READ_ONLY_COLLECTION_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_READ_ONLY_COLLECTION_TESTS))
#define IS_READ_ONLY_COLLECTION_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_READ_ONLY_COLLECTION_TESTS))
#define READ_ONLY_COLLECTION_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_READ_ONLY_COLLECTION_TESTS, ReadOnlyCollectionTestsClass))

typedef struct _ReadOnlyCollectionTests ReadOnlyCollectionTests;
typedef struct _ReadOnlyCollectionTestsClass ReadOnlyCollectionTestsClass;
typedef struct _ReadOnlyCollectionTestsPrivate ReadOnlyCollectionTestsPrivate;

#define TYPE_READ_ONLY_LIST_TESTS (read_only_list_tests_get_type ())
#define READ_ONLY_LIST_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_READ_ONLY_LIST_TESTS, ReadOnlyListTests))
#define READ_ONLY_LIST_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_READ_ONLY_LIST_TESTS, ReadOnlyListTestsClass))
#define IS_READ_ONLY_LIST_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_READ_ONLY_LIST_TESTS))
#define IS_READ_ONLY_LIST_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_READ_ONLY_LIST_TESTS))
#define READ_ONLY_LIST_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_READ_ONLY_LIST_TESTS, ReadOnlyListTestsClass))

typedef struct _ReadOnlyListTests ReadOnlyListTests;
typedef struct _ReadOnlyListTestsClass ReadOnlyListTestsClass;
typedef struct _ReadOnlyListTestsPrivate ReadOnlyListTestsPrivate;
enum  {
	READ_ONLY_LIST_TESTS_0_PROPERTY,
	READ_ONLY_LIST_TESTS_NUM_PROPERTIES
};
static GParamSpec* read_only_list_tests_properties[READ_ONLY_LIST_TESTS_NUM_PROPERTIES];
typedef void (*GeeTestCaseTestMethod) (gpointer user_data);
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_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 _GeeTestCase {
	GObject parent_instance;
	GeeTestCasePrivate * priv;
};

struct _GeeTestCaseClass {
	GObjectClass parent_class;
	void (*set_up) (GeeTestCase* self);
	void (*tear_down) (GeeTestCase* self);
};

struct _ReadOnlyCollectionTests {
	GeeTestCase parent_instance;
	ReadOnlyCollectionTestsPrivate * priv;
	GeeCollection* test_collection;
	GeeCollection* ro_collection;
};

struct _ReadOnlyCollectionTestsClass {
	GeeTestCaseClass parent_class;
	GeeCollection* (*get_ro_view) (ReadOnlyCollectionTests* self, GeeCollection* collection);
};

struct _ReadOnlyListTests {
	ReadOnlyCollectionTests parent_instance;
	ReadOnlyListTestsPrivate * priv;
};

struct _ReadOnlyListTestsClass {
	ReadOnlyCollectionTestsClass parent_class;
};

static gpointer read_only_list_tests_parent_class = NULL;

VALA_EXTERN GType gee_test_case_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeeTestCase, g_object_unref)
VALA_EXTERN GType read_only_collection_tests_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ReadOnlyCollectionTests, g_object_unref)
VALA_EXTERN GType read_only_list_tests_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ReadOnlyListTests, g_object_unref)
VALA_EXTERN void gee_test_case_set_up (GeeTestCase* self);
VALA_EXTERN void gee_test_case_tear_down (GeeTestCase* self);
VALA_EXTERN GeeCollection* read_only_collection_tests_get_ro_view (ReadOnlyCollectionTests* self,
                                                       GeeCollection* collection);
VALA_EXTERN ReadOnlyListTests* read_only_list_tests_new (void);
VALA_EXTERN ReadOnlyListTests* read_only_list_tests_construct (GType object_type);
VALA_EXTERN ReadOnlyListTests* read_only_list_tests_new_with_name (const gchar* name);
VALA_EXTERN ReadOnlyListTests* read_only_list_tests_construct_with_name (GType object_type,
                                                             const gchar* name);
VALA_EXTERN ReadOnlyCollectionTests* read_only_collection_tests_new_with_name (const gchar* name);
VALA_EXTERN ReadOnlyCollectionTests* read_only_collection_tests_construct_with_name (GType object_type,
                                                                         const gchar* name);
VALA_EXTERN void gee_test_case_add_test (GeeTestCase* self,
                             const gchar* name,
                             GeeTestCaseTestMethod test,
                             gpointer test_target,
                             GDestroyNotify test_target_destroy_notify);
VALA_EXTERN void read_only_list_tests_test_immutable_iterator (ReadOnlyListTests* self);
static void _read_only_list_tests_test_immutable_iterator_gee_test_case_test_method (gpointer self);
VALA_EXTERN void read_only_list_tests_test_immutable (ReadOnlyListTests* self);
static void _read_only_list_tests_test_immutable_gee_test_case_test_method (gpointer self);
VALA_EXTERN void read_only_list_tests_test_accurate_view (ReadOnlyListTests* self);
static void _read_only_list_tests_test_accurate_view_gee_test_case_test_method (gpointer self);
static void read_only_list_tests_real_set_up (GeeTestCase* base);
static void read_only_list_tests_real_tear_down (GeeTestCase* base);
static GeeCollection* read_only_list_tests_real_get_ro_view (ReadOnlyCollectionTests* base,
                                                      GeeCollection* collection);
static GType read_only_list_tests_get_type_once (void);

ReadOnlyListTests*
read_only_list_tests_construct (GType object_type)
{
	ReadOnlyListTests * self = NULL;
	self = (ReadOnlyListTests*) read_only_list_tests_construct_with_name (object_type, "ReadOnlyList");
	return self;
}

ReadOnlyListTests*
read_only_list_tests_new (void)
{
	return read_only_list_tests_construct (TYPE_READ_ONLY_LIST_TESTS);
}

static void
_read_only_list_tests_test_immutable_iterator_gee_test_case_test_method (gpointer self)
{
	read_only_list_tests_test_immutable_iterator ((ReadOnlyListTests*) self);
}

static void
_read_only_list_tests_test_immutable_gee_test_case_test_method (gpointer self)
{
	read_only_list_tests_test_immutable ((ReadOnlyListTests*) self);
}

static void
_read_only_list_tests_test_accurate_view_gee_test_case_test_method (gpointer self)
{
	read_only_list_tests_test_accurate_view ((ReadOnlyListTests*) self);
}

ReadOnlyListTests*
read_only_list_tests_construct_with_name (GType object_type,
                                          const gchar* name)
{
	ReadOnlyListTests * self = NULL;
	g_return_val_if_fail (name != NULL, NULL);
	self = (ReadOnlyListTests*) read_only_collection_tests_construct_with_name (object_type, name);
	gee_test_case_add_test ((GeeTestCase*) self, "[ReadOnlyList] immutable iterator", _read_only_list_tests_test_immutable_iterator_gee_test_case_test_method, g_object_ref (self), g_object_unref);
	gee_test_case_add_test ((GeeTestCase*) self, "[ReadOnlyList] immutable", _read_only_list_tests_test_immutable_gee_test_case_test_method, g_object_ref (self), g_object_unref);
	gee_test_case_add_test ((GeeTestCase*) self, "[ReadOnlyList] accurate view", _read_only_list_tests_test_accurate_view_gee_test_case_test_method, g_object_ref (self), g_object_unref);
	return self;
}

ReadOnlyListTests*
read_only_list_tests_new_with_name (const gchar* name)
{
	return read_only_list_tests_construct_with_name (TYPE_READ_ONLY_LIST_TESTS, name);
}

static void
read_only_list_tests_real_set_up (GeeTestCase* base)
{
	ReadOnlyListTests * self;
	GeeArrayList* _tmp0_;
	GeeCollection* _tmp1_;
	GeeCollection* _tmp2_;
	self = (ReadOnlyListTests*) base;
	_tmp0_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL);
	_g_object_unref0 (((ReadOnlyCollectionTests*) self)->test_collection);
	((ReadOnlyCollectionTests*) self)->test_collection = (GeeCollection*) _tmp0_;
	_tmp1_ = ((ReadOnlyCollectionTests*) self)->test_collection;
	_tmp2_ = read_only_collection_tests_get_ro_view ((ReadOnlyCollectionTests*) self, _tmp1_);
	_g_object_unref0 (((ReadOnlyCollectionTests*) self)->ro_collection);
	((ReadOnlyCollectionTests*) self)->ro_collection = _tmp2_;
}

static void
read_only_list_tests_real_tear_down (GeeTestCase* base)
{
	ReadOnlyListTests * self;
	self = (ReadOnlyListTests*) base;
	_g_object_unref0 (((ReadOnlyCollectionTests*) self)->test_collection);
	((ReadOnlyCollectionTests*) self)->test_collection = NULL;
	_g_object_unref0 (((ReadOnlyCollectionTests*) self)->ro_collection);
	((ReadOnlyCollectionTests*) self)->ro_collection = NULL;
}

static GeeCollection*
read_only_list_tests_real_get_ro_view (ReadOnlyCollectionTests* base,
                                       GeeCollection* collection)
{
	ReadOnlyListTests * self;
	GeeList* _tmp0_;
	GeeList* _tmp1_;
	GeeCollection* result;
	self = (ReadOnlyListTests*) base;
	g_return_val_if_fail (collection != NULL, NULL);
	_tmp0_ = gee_list_get_read_only_view (G_TYPE_CHECK_INSTANCE_CAST (collection, GEE_TYPE_LIST, GeeList));
	_tmp1_ = _tmp0_;
	result = (GeeCollection*) _tmp1_;
	return result;
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

void
read_only_list_tests_test_immutable_iterator (ReadOnlyListTests* self)
{
	GeeList* test_list = NULL;
	GeeCollection* _tmp0_;
	GeeList* _tmp1_;
	GeeList* ro_list = NULL;
	GeeCollection* _tmp2_;
	GeeList* _tmp3_;
	GeeList* _tmp4_;
	GeeList* _tmp5_;
	GeeList* _tmp6_;
	gint _tmp7_;
	gint _tmp8_;
	GeeList* _tmp9_;
	gpointer _tmp10_;
	gchar* _tmp11_;
	GeeList* _tmp12_;
	gpointer _tmp13_;
	gchar* _tmp14_;
	GeeListIterator* iterator = NULL;
	GeeList* _tmp15_;
	GeeListIterator* _tmp16_;
	GeeListIterator* _tmp17_;
	GeeListIterator* _tmp18_;
	GeeListIterator* _tmp19_;
	gpointer _tmp20_;
	gchar* _tmp21_;
	GeeListIterator* _tmp22_;
	GeeListIterator* _tmp23_;
	GeeListIterator* _tmp24_;
	GeeListIterator* _tmp25_;
	gpointer _tmp26_;
	gchar* _tmp27_;
	GeeListIterator* _tmp28_;
	GeeListIterator* _tmp29_;
	GeeListIterator* _tmp30_;
	GeeList* _tmp31_;
	GeeListIterator* _tmp32_;
	GeeListIterator* _tmp33_;
	GeeList* _tmp35_;
	gint _tmp36_;
	gint _tmp37_;
	GeeList* _tmp38_;
	gpointer _tmp39_;
	gchar* _tmp40_;
	GeeList* _tmp41_;
	gpointer _tmp42_;
	gchar* _tmp43_;
	GeeListIterator* _tmp44_;
	GeeList* _tmp46_;
	gint _tmp47_;
	gint _tmp48_;
	GeeList* _tmp49_;
	gpointer _tmp50_;
	gchar* _tmp51_;
	GeeList* _tmp52_;
	gpointer _tmp53_;
	gchar* _tmp54_;
	GeeListIterator* _tmp55_;
	GeeList* _tmp56_;
	gint _tmp57_;
	gint _tmp58_;
	GeeList* _tmp59_;
	gpointer _tmp60_;
	gchar* _tmp61_;
	GeeList* _tmp62_;
	gpointer _tmp63_;
	gchar* _tmp64_;
	GeeListIterator* _tmp65_;
	GeeList* _tmp67_;
	gint _tmp68_;
	gint _tmp69_;
	GeeList* _tmp70_;
	gpointer _tmp71_;
	gchar* _tmp72_;
	GeeList* _tmp73_;
	gpointer _tmp74_;
	gchar* _tmp75_;
	GeeListIterator* _tmp76_;
	g_return_if_fail (self != NULL);
	_tmp0_ = ((ReadOnlyCollectionTests*) self)->test_collection;
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_LIST) ? ((GeeList*) _tmp0_) : NULL);
	test_list = _tmp1_;
	_tmp2_ = ((ReadOnlyCollectionTests*) self)->ro_collection;
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, GEE_TYPE_LIST) ? ((GeeList*) _tmp2_) : NULL);
	ro_list = _tmp3_;
	_tmp4_ = test_list;
	_vala_assert (gee_collection_add ((GeeCollection*) _tmp4_, "one"), "test_list.add (\"one\")");
	_tmp5_ = test_list;
	_vala_assert (gee_collection_add ((GeeCollection*) _tmp5_, "two"), "test_list.add (\"two\")");
	_tmp6_ = ro_list;
	_tmp7_ = gee_collection_get_size ((GeeCollection*) _tmp6_);
	_tmp8_ = _tmp7_;
	_vala_assert (_tmp8_ == 2, "ro_list.size == 2");
	_tmp9_ = ro_list;
	_tmp10_ = gee_list_get (_tmp9_, 0);
	_tmp11_ = (gchar*) _tmp10_;
	_vala_assert (g_strcmp0 (_tmp11_, "one") == 0, "ro_list.get (0) == \"one\"");
	_g_free0 (_tmp11_);
	_tmp12_ = ro_list;
	_tmp13_ = gee_list_get (_tmp12_, 1);
	_tmp14_ = (gchar*) _tmp13_;
	_vala_assert (g_strcmp0 (_tmp14_, "two") == 0, "ro_list.get (1) == \"two\"");
	_g_free0 (_tmp14_);
	_tmp15_ = ro_list;
	_tmp16_ = gee_list_list_iterator (_tmp15_);
	iterator = _tmp16_;
	_tmp17_ = iterator;
	_vala_assert (gee_iterator_has_next ((GeeIterator*) _tmp17_), "iterator.has_next ()");
	_tmp18_ = iterator;
	_vala_assert (gee_iterator_next ((GeeIterator*) _tmp18_), "iterator.next ()");
	_tmp19_ = iterator;
	_tmp20_ = gee_iterator_get ((GeeIterator*) _tmp19_);
	_tmp21_ = (gchar*) _tmp20_;
	_vala_assert (g_strcmp0 (_tmp21_, "one") == 0, "iterator.get () == \"one\"");
	_g_free0 (_tmp21_);
	_tmp22_ = iterator;
	_vala_assert (gee_list_iterator_index (_tmp22_) == 0, "iterator.index () == 0");
	_tmp23_ = iterator;
	_vala_assert (gee_iterator_has_next ((GeeIterator*) _tmp23_), "iterator.has_next ()");
	_tmp24_ = iterator;
	_vala_assert (gee_iterator_next ((GeeIterator*) _tmp24_), "iterator.next ()");
	_tmp25_ = iterator;
	_tmp26_ = gee_iterator_get ((GeeIterator*) _tmp25_);
	_tmp27_ = (gchar*) _tmp26_;
	_vala_assert (g_strcmp0 (_tmp27_, "two") == 0, "iterator.get () == \"two\"");
	_g_free0 (_tmp27_);
	_tmp28_ = iterator;
	_vala_assert (gee_list_iterator_index (_tmp28_) == 1, "iterator.index () == 1");
	_tmp29_ = iterator;
	_vala_assert (!gee_iterator_has_next ((GeeIterator*) _tmp29_), "! iterator.has_next ()");
	_tmp30_ = iterator;
	_vala_assert (!gee_iterator_next ((GeeIterator*) _tmp30_), "! iterator.next ()");
	_tmp31_ = ro_list;
	_tmp32_ = gee_list_list_iterator (_tmp31_);
	_g_object_unref0 (iterator);
	iterator = _tmp32_;
	_tmp33_ = iterator;
	_vala_assert (gee_iterator_next ((GeeIterator*) _tmp33_), "iterator.next ()");
	if (g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR)) {
		GeeListIterator* _tmp34_;
		_tmp34_ = iterator;
		gee_iterator_remove ((GeeIterator*) _tmp34_);
		exit (0);
	}
	g_test_trap_assert_failed ();
	_tmp35_ = ro_list;
	_tmp36_ = gee_collection_get_size ((GeeCollection*) _tmp35_);
	_tmp37_ = _tmp36_;
	_vala_assert (_tmp37_ == 2, "ro_list.size == 2");
	_tmp38_ = ro_list;
	_tmp39_ = gee_list_get (_tmp38_, 0);
	_tmp40_ = (gchar*) _tmp39_;
	_vala_assert (g_strcmp0 (_tmp40_, "one") == 0, "ro_list.get (0) == \"one\"");
	_g_free0 (_tmp40_);
	_tmp41_ = ro_list;
	_tmp42_ = gee_list_get (_tmp41_, 1);
	_tmp43_ = (gchar*) _tmp42_;
	_vala_assert (g_strcmp0 (_tmp43_, "two") == 0, "ro_list.get (1) == \"two\"");
	_g_free0 (_tmp43_);
	_tmp44_ = iterator;
	_vala_assert (gee_list_iterator_index (_tmp44_) == 0, "iterator.index () == 0");
	if (g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR)) {
		GeeListIterator* _tmp45_;
		_tmp45_ = iterator;
		gee_list_iterator_set (_tmp45_, "three");
		exit (0);
	}
	g_test_trap_assert_failed ();
	_tmp46_ = ro_list;
	_tmp47_ = gee_collection_get_size ((GeeCollection*) _tmp46_);
	_tmp48_ = _tmp47_;
	_vala_assert (_tmp48_ == 2, "ro_list.size == 2");
	_tmp49_ = ro_list;
	_tmp50_ = gee_list_get (_tmp49_, 0);
	_tmp51_ = (gchar*) _tmp50_;
	_vala_assert (g_strcmp0 (_tmp51_, "one") == 0, "ro_list.get (0) == \"one\"");
	_g_free0 (_tmp51_);
	_tmp52_ = ro_list;
	_tmp53_ = gee_list_get (_tmp52_, 1);
	_tmp54_ = (gchar*) _tmp53_;
	_vala_assert (g_strcmp0 (_tmp54_, "two") == 0, "ro_list.get (1) == \"two\"");
	_g_free0 (_tmp54_);
	_tmp55_ = iterator;
	_vala_assert (gee_list_iterator_index (_tmp55_) == 0, "iterator.index () == 0");
	_tmp56_ = ro_list;
	_tmp57_ = gee_collection_get_size ((GeeCollection*) _tmp56_);
	_tmp58_ = _tmp57_;
	_vala_assert (_tmp58_ == 2, "ro_list.size == 2");
	_tmp59_ = ro_list;
	_tmp60_ = gee_list_get (_tmp59_, 0);
	_tmp61_ = (gchar*) _tmp60_;
	_vala_assert (g_strcmp0 (_tmp61_, "one") == 0, "ro_list.get (0) == \"one\"");
	_g_free0 (_tmp61_);
	_tmp62_ = ro_list;
	_tmp63_ = gee_list_get (_tmp62_, 1);
	_tmp64_ = (gchar*) _tmp63_;
	_vala_assert (g_strcmp0 (_tmp64_, "two") == 0, "ro_list.get (1) == \"two\"");
	_g_free0 (_tmp64_);
	_tmp65_ = iterator;
	_vala_assert (gee_list_iterator_index (_tmp65_) == 0, "iterator.index () == 0");
	if (g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR)) {
		GeeListIterator* _tmp66_;
		_tmp66_ = iterator;
		gee_list_iterator_add (_tmp66_, "three");
		exit (0);
	}
	g_test_trap_assert_failed ();
	_tmp67_ = ro_list;
	_tmp68_ = gee_collection_get_size ((GeeCollection*) _tmp67_);
	_tmp69_ = _tmp68_;
	_vala_assert (_tmp69_ == 2, "ro_list.size == 2");
	_tmp70_ = ro_list;
	_tmp71_ = gee_list_get (_tmp70_, 0);
	_tmp72_ = (gchar*) _tmp71_;
	_vala_assert (g_strcmp0 (_tmp72_, "one") == 0, "ro_list.get (0) == \"one\"");
	_g_free0 (_tmp72_);
	_tmp73_ = ro_list;
	_tmp74_ = gee_list_get (_tmp73_, 1);
	_tmp75_ = (gchar*) _tmp74_;
	_vala_assert (g_strcmp0 (_tmp75_, "two") == 0, "ro_list.get (1) == \"two\"");
	_g_free0 (_tmp75_);
	_tmp76_ = iterator;
	_vala_assert (gee_list_iterator_index (_tmp76_) == 0, "iterator.index () == 0");
	_g_object_unref0 (iterator);
	_g_object_unref0 (ro_list);
	_g_object_unref0 (test_list);
}

void
read_only_list_tests_test_immutable (ReadOnlyListTests* self)
{
	GeeList* test_list = NULL;
	GeeCollection* _tmp0_;
	GeeList* _tmp1_;
	GeeList* ro_list = NULL;
	GeeCollection* _tmp2_;
	GeeList* _tmp3_;
	GeeList* _tmp4_;
	GeeList* _tmp5_;
	gint _tmp6_;
	gint _tmp7_;
	GeeList* _tmp8_;
	GeeCollection* dummy = NULL;
	GeeArrayList* _tmp9_;
	GeeCollection* _tmp10_;
	GeeCollection* _tmp11_;
	GeeList* _tmp13_;
	gint _tmp14_;
	gint _tmp15_;
	GeeList* _tmp16_;
	GeeList* _tmp18_;
	gint _tmp19_;
	gint _tmp20_;
	GeeList* _tmp21_;
	GeeList* _tmp25_;
	gint _tmp26_;
	gint _tmp27_;
	GeeList* _tmp28_;
	GeeList* _tmp31_;
	gint _tmp32_;
	gint _tmp33_;
	GeeList* _tmp34_;
	GeeList* _tmp36_;
	gint _tmp37_;
	gint _tmp38_;
	GeeList* _tmp39_;
	g_return_if_fail (self != NULL);
	_tmp0_ = ((ReadOnlyCollectionTests*) self)->test_collection;
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_LIST) ? ((GeeList*) _tmp0_) : NULL);
	test_list = _tmp1_;
	_tmp2_ = ((ReadOnlyCollectionTests*) self)->ro_collection;
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, GEE_TYPE_LIST) ? ((GeeList*) _tmp2_) : NULL);
	ro_list = _tmp3_;
	_tmp4_ = test_list;
	_vala_assert (gee_collection_add ((GeeCollection*) _tmp4_, "one"), "test_list.add (\"one\")");
	_tmp5_ = ro_list;
	_tmp6_ = gee_collection_get_size ((GeeCollection*) _tmp5_);
	_tmp7_ = _tmp6_;
	_vala_assert (_tmp7_ == 1, "ro_list.size == 1");
	_tmp8_ = ro_list;
	_vala_assert (gee_collection_contains ((GeeCollection*) _tmp8_, "one"), "ro_list.contains (\"one\")");
	_tmp9_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL);
	dummy = (GeeCollection*) _tmp9_;
	_tmp10_ = dummy;
	_vala_assert (gee_collection_add (_tmp10_, "one"), "dummy.add (\"one\")");
	_tmp11_ = dummy;
	_vala_assert (gee_collection_add (_tmp11_, "two"), "dummy.add (\"two\")");
	if (g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR)) {
		GeeList* _tmp12_;
		_tmp12_ = ro_list;
		gee_list_set (_tmp12_, 0, "two");
		exit (0);
	}
	g_test_trap_assert_failed ();
	_tmp13_ = ro_list;
	_tmp14_ = gee_collection_get_size ((GeeCollection*) _tmp13_);
	_tmp15_ = _tmp14_;
	_vala_assert (_tmp15_ == 1, "ro_list.size == 1");
	_tmp16_ = ro_list;
	_vala_assert (gee_collection_contains ((GeeCollection*) _tmp16_, "one"), "ro_list.contains (\"one\")");
	if (g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR)) {
		GeeList* _tmp17_;
		_tmp17_ = ro_list;
		gee_list_insert (_tmp17_, 1, "two");
		exit (0);
	}
	g_test_trap_assert_failed ();
	_tmp18_ = ro_list;
	_tmp19_ = gee_collection_get_size ((GeeCollection*) _tmp18_);
	_tmp20_ = _tmp19_;
	_vala_assert (_tmp20_ == 1, "ro_list.size == 1");
	_tmp21_ = ro_list;
	_vala_assert (gee_collection_contains ((GeeCollection*) _tmp21_, "one"), "ro_list.contains (\"one\")");
	if (g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR)) {
		GeeList* _tmp22_;
		gpointer _tmp23_;
		gchar* _tmp24_;
		_tmp22_ = ro_list;
		_tmp23_ = gee_list_remove_at (_tmp22_, 1);
		_tmp24_ = (gchar*) _tmp23_;
		_g_free0 (_tmp24_);
		exit (0);
	}
	g_test_trap_assert_failed ();
	_tmp25_ = ro_list;
	_tmp26_ = gee_collection_get_size ((GeeCollection*) _tmp25_);
	_tmp27_ = _tmp26_;
	_vala_assert (_tmp27_ == 1, "ro_list.size == 1");
	_tmp28_ = ro_list;
	_vala_assert (gee_collection_contains ((GeeCollection*) _tmp28_, "one"), "ro_list.contains (\"one\")");
	if (g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR)) {
		GeeList* _tmp29_;
		GeeCollection* _tmp30_;
		_tmp29_ = ro_list;
		_tmp30_ = dummy;
		gee_list_insert_all (_tmp29_, 1, _tmp30_);
		exit (0);
	}
	g_test_trap_assert_failed ();
	_tmp31_ = ro_list;
	_tmp32_ = gee_collection_get_size ((GeeCollection*) _tmp31_);
	_tmp33_ = _tmp32_;
	_vala_assert (_tmp33_ == 1, "ro_list.size == 1");
	_tmp34_ = ro_list;
	_vala_assert (gee_collection_contains ((GeeCollection*) _tmp34_, "one"), "ro_list.contains (\"one\")");
	if (g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR)) {
		GeeList* _tmp35_;
		_tmp35_ = ro_list;
		gee_list_sort (_tmp35_, NULL, NULL, NULL);
		exit (0);
	}
	g_test_trap_assert_failed ();
	_tmp36_ = ro_list;
	_tmp37_ = gee_collection_get_size ((GeeCollection*) _tmp36_);
	_tmp38_ = _tmp37_;
	_vala_assert (_tmp38_ == 1, "ro_list.size == 1");
	_tmp39_ = ro_list;
	_vala_assert (gee_collection_contains ((GeeCollection*) _tmp39_, "one"), "ro_list.contains (\"one\")");
	_g_object_unref0 (dummy);
	_g_object_unref0 (ro_list);
	_g_object_unref0 (test_list);
}

void
read_only_list_tests_test_accurate_view (ReadOnlyListTests* self)
{
	GeeList* test_list = NULL;
	GeeCollection* _tmp0_;
	GeeList* _tmp1_;
	GeeList* ro_list = NULL;
	GeeCollection* _tmp2_;
	GeeList* _tmp3_;
	GeeCollection* dummy = NULL;
	GeeArrayList* _tmp4_;
	GType _tmp5_;
	GType _tmp6_;
	gint _tmp7_;
	gint _tmp8_;
	gboolean _tmp9_;
	gboolean _tmp10_;
	gint _tmp11_;
	gint _tmp12_;
	gboolean _tmp13_;
	gboolean _tmp14_;
	gpointer _tmp15_;
	gchar* _tmp16_;
	gpointer _tmp17_;
	gchar* _tmp18_;
	gpointer _tmp19_;
	gchar* _tmp20_;
	gint _tmp21_;
	gint _tmp22_;
	gboolean _tmp23_;
	gboolean _tmp24_;
	gpointer _tmp25_;
	gchar* _tmp26_;
	gpointer _tmp27_;
	gchar* _tmp28_;
	gpointer _tmp29_;
	gchar* _tmp30_;
	gpointer _tmp31_;
	gchar* _tmp32_;
	gint _tmp33_;
	gint _tmp34_;
	gboolean _tmp35_;
	gboolean _tmp36_;
	gpointer _tmp37_;
	gchar* _tmp38_;
	gpointer _tmp39_;
	gchar* _tmp40_;
	gpointer _tmp41_;
	gchar* _tmp42_;
	gint _tmp43_;
	gint _tmp44_;
	gboolean _tmp45_;
	gboolean _tmp46_;
	g_return_if_fail (self != NULL);
	_tmp0_ = ((ReadOnlyCollectionTests*) self)->test_collection;
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_LIST) ? ((GeeList*) _tmp0_) : NULL);
	test_list = _tmp1_;
	_tmp2_ = ((ReadOnlyCollectionTests*) self)->ro_collection;
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, GEE_TYPE_LIST) ? ((GeeList*) _tmp2_) : NULL);
	ro_list = _tmp3_;
	_tmp4_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL);
	dummy = (GeeCollection*) _tmp4_;
	_vala_assert (gee_collection_add (dummy, "one"), "dummy.add (\"one\")");
	_vala_assert (gee_collection_add (dummy, "two"), "dummy.add (\"two\")");
	_tmp5_ = gee_traversable_get_element_type ((GeeTraversable*) ro_list);
	_tmp6_ = _tmp5_;
	_vala_assert (_tmp6_ == G_TYPE_STRING, "ro_list.element_type == typeof (string)");
	_tmp7_ = gee_collection_get_size ((GeeCollection*) ro_list);
	_tmp8_ = _tmp7_;
	_vala_assert (_tmp8_ == 0, "ro_list.size == 0");
	_tmp9_ = gee_collection_get_is_empty ((GeeCollection*) ro_list);
	_tmp10_ = _tmp9_;
	_vala_assert (_tmp10_, "ro_list.is_empty");
	_vala_assert (!gee_collection_contains ((GeeCollection*) ro_list, "one"), "! ro_list.contains (\"one\")");
	_vala_assert (gee_list_index_of (ro_list, "one") == -1, "ro_list.index_of (\"one\") == -1");
	_vala_assert (gee_collection_add ((GeeCollection*) test_list, "one"), "test_list.add (\"one\")");
	_tmp11_ = gee_collection_get_size ((GeeCollection*) ro_list);
	_tmp12_ = _tmp11_;
	_vala_assert (_tmp12_ == 1, "ro_list.size == 1");
	_tmp13_ = gee_collection_get_is_empty ((GeeCollection*) ro_list);
	_tmp14_ = _tmp13_;
	_vala_assert (!_tmp14_, "! ro_list.is_empty");
	_tmp15_ = gee_list_get (ro_list, 0);
	_tmp16_ = (gchar*) _tmp15_;
	_vala_assert (g_strcmp0 (_tmp16_, "one") == 0, "ro_list.get (0) == \"one\"");
	_g_free0 (_tmp16_);
	_vala_assert (gee_list_index_of (ro_list, "one") == 0, "ro_list.index_of (\"one\") == 0");
	_tmp17_ = gee_list_first (ro_list);
	_tmp18_ = (gchar*) _tmp17_;
	_vala_assert (g_strcmp0 (_tmp18_, "one") == 0, "ro_list.first () == \"one\"");
	_g_free0 (_tmp18_);
	_tmp19_ = gee_list_last (ro_list);
	_tmp20_ = (gchar*) _tmp19_;
	_vala_assert (g_strcmp0 (_tmp20_, "one") == 0, "ro_list.last () == \"one\"");
	_g_free0 (_tmp20_);
	_vala_assert (gee_collection_add ((GeeCollection*) test_list, "two"), "test_list.add (\"two\")");
	_tmp21_ = gee_collection_get_size ((GeeCollection*) ro_list);
	_tmp22_ = _tmp21_;
	_vala_assert (_tmp22_ == 2, "ro_list.size == 2");
	_tmp23_ = gee_collection_get_is_empty ((GeeCollection*) ro_list);
	_tmp24_ = _tmp23_;
	_vala_assert (!_tmp24_, "! ro_list.is_empty");
	_tmp25_ = gee_list_get (ro_list, 0);
	_tmp26_ = (gchar*) _tmp25_;
	_vala_assert (g_strcmp0 (_tmp26_, "one") == 0, "ro_list.get (0) == \"one\"");
	_g_free0 (_tmp26_);
	_vala_assert (gee_list_index_of (ro_list, "one") == 0, "ro_list.index_of (\"one\") == 0");
	_tmp27_ = gee_list_get (ro_list, 1);
	_tmp28_ = (gchar*) _tmp27_;
	_vala_assert (g_strcmp0 (_tmp28_, "two") == 0, "ro_list.get (1) == \"two\"");
	_g_free0 (_tmp28_);
	_vala_assert (gee_list_index_of (ro_list, "two") == 1, "ro_list.index_of (\"two\") == 1");
	_tmp29_ = gee_list_first (ro_list);
	_tmp30_ = (gchar*) _tmp29_;
	_vala_assert (g_strcmp0 (_tmp30_, "one") == 0, "ro_list.first () == \"one\"");
	_g_free0 (_tmp30_);
	_tmp31_ = gee_list_last (ro_list);
	_tmp32_ = (gchar*) _tmp31_;
	_vala_assert (g_strcmp0 (_tmp32_, "two") == 0, "ro_list.last () == \"two\"");
	_g_free0 (_tmp32_);
	_vala_assert (gee_collection_remove ((GeeCollection*) test_list, "one"), "test_list.remove (\"one\")");
	_tmp33_ = gee_collection_get_size ((GeeCollection*) ro_list);
	_tmp34_ = _tmp33_;
	_vala_assert (_tmp34_ == 1, "ro_list.size == 1");
	_tmp35_ = gee_collection_get_is_empty ((GeeCollection*) ro_list);
	_tmp36_ = _tmp35_;
	_vala_assert (!_tmp36_, "! ro_list.is_empty");
	_vala_assert (!gee_collection_contains ((GeeCollection*) ro_list, "one"), "! ro_list.contains (\"one\")");
	_vala_assert (gee_list_index_of (ro_list, "one") == -1, "ro_list.index_of (\"one\") == -1");
	_vala_assert (gee_collection_contains ((GeeCollection*) ro_list, "two"), "ro_list.contains (\"two\")");
	_tmp37_ = gee_list_get (ro_list, 0);
	_tmp38_ = (gchar*) _tmp37_;
	_vala_assert (g_strcmp0 (_tmp38_, "two") == 0, "ro_list.get (0) == \"two\"");
	_g_free0 (_tmp38_);
	_vala_assert (gee_list_index_of (ro_list, "two") == 0, "ro_list.index_of (\"two\") == 0");
	_tmp39_ = gee_list_first (ro_list);
	_tmp40_ = (gchar*) _tmp39_;
	_vala_assert (g_strcmp0 (_tmp40_, "two") == 0, "ro_list.first () == \"two\"");
	_g_free0 (_tmp40_);
	_tmp41_ = gee_list_last (ro_list);
	_tmp42_ = (gchar*) _tmp41_;
	_vala_assert (g_strcmp0 (_tmp42_, "two") == 0, "ro_list.last () == \"two\"");
	_g_free0 (_tmp42_);
	gee_collection_clear ((GeeCollection*) test_list);
	_tmp43_ = gee_collection_get_size ((GeeCollection*) ro_list);
	_tmp44_ = _tmp43_;
	_vala_assert (_tmp44_ == 0, "ro_list.size == 0");
	_tmp45_ = gee_collection_get_is_empty ((GeeCollection*) ro_list);
	_tmp46_ = _tmp45_;
	_vala_assert (_tmp46_, "ro_list.is_empty");
	_vala_assert (gee_list_index_of (ro_list, "one") == -1, "ro_list.index_of (\"one\") == -1");
	_vala_assert (gee_list_index_of (ro_list, "two") == -1, "ro_list.index_of (\"two\") == -1");
	_g_object_unref0 (dummy);
	_g_object_unref0 (ro_list);
	_g_object_unref0 (test_list);
}

static void
read_only_list_tests_class_init (ReadOnlyListTestsClass * klass,
                                 gpointer klass_data)
{
	read_only_list_tests_parent_class = g_type_class_peek_parent (klass);
	((GeeTestCaseClass *) klass)->set_up = (void (*) (GeeTestCase*)) read_only_list_tests_real_set_up;
	((GeeTestCaseClass *) klass)->tear_down = (void (*) (GeeTestCase*)) read_only_list_tests_real_tear_down;
	((ReadOnlyCollectionTestsClass *) klass)->get_ro_view = (GeeCollection* (*) (ReadOnlyCollectionTests*, GeeCollection*)) read_only_list_tests_real_get_ro_view;
}

static void
read_only_list_tests_instance_init (ReadOnlyListTests * self,
                                    gpointer klass)
{
}

static GType
read_only_list_tests_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ReadOnlyListTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) read_only_list_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ReadOnlyListTests), 0, (GInstanceInitFunc) read_only_list_tests_instance_init, NULL };
	GType read_only_list_tests_type_id;
	read_only_list_tests_type_id = g_type_register_static (TYPE_READ_ONLY_COLLECTION_TESTS, "ReadOnlyListTests", &g_define_type_info, 0);
	return read_only_list_tests_type_id;
}

GType
read_only_list_tests_get_type (void)
{
	static volatile gsize read_only_list_tests_type_id__once = 0;
	if (g_once_init_enter (&read_only_list_tests_type_id__once)) {
		GType read_only_list_tests_type_id;
		read_only_list_tests_type_id = read_only_list_tests_get_type_once ();
		g_once_init_leave (&read_only_list_tests_type_id__once, read_only_list_tests_type_id);
	}
	return read_only_list_tests_type_id__once;
}

