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

/* testbidirsortedset.vala
 *
 * Copyright (C) 2012  Maciej Piechotka
 *
 * 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:
 * 	Maciej Piechotka <uzytkownik2@gmail.com>
 */

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

#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_COLLECTION_TESTS (collection_tests_get_type ())
#define COLLECTION_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_COLLECTION_TESTS, CollectionTests))
#define COLLECTION_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_COLLECTION_TESTS, CollectionTestsClass))
#define IS_COLLECTION_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_COLLECTION_TESTS))
#define IS_COLLECTION_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_COLLECTION_TESTS))
#define COLLECTION_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_COLLECTION_TESTS, CollectionTestsClass))

typedef struct _CollectionTests CollectionTests;
typedef struct _CollectionTestsClass CollectionTestsClass;
typedef struct _CollectionTestsPrivate CollectionTestsPrivate;

#define TYPE_SET_TESTS (set_tests_get_type ())
#define SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SET_TESTS, SetTests))
#define SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SET_TESTS, SetTestsClass))
#define IS_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SET_TESTS))
#define IS_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SET_TESTS))
#define SET_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SET_TESTS, SetTestsClass))

typedef struct _SetTests SetTests;
typedef struct _SetTestsClass SetTestsClass;
typedef struct _SetTestsPrivate SetTestsPrivate;

#define TYPE_SORTED_SET_TESTS (sorted_set_tests_get_type ())
#define SORTED_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SORTED_SET_TESTS, SortedSetTests))
#define SORTED_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SORTED_SET_TESTS, SortedSetTestsClass))
#define IS_SORTED_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SORTED_SET_TESTS))
#define IS_SORTED_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SORTED_SET_TESTS))
#define SORTED_SET_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SORTED_SET_TESTS, SortedSetTestsClass))

typedef struct _SortedSetTests SortedSetTests;
typedef struct _SortedSetTestsClass SortedSetTestsClass;
typedef struct _SortedSetTestsPrivate SortedSetTestsPrivate;

#define TYPE_BIDIR_SORTED_SET_TESTS (bidir_sorted_set_tests_get_type ())
#define BIDIR_SORTED_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BIDIR_SORTED_SET_TESTS, BidirSortedSetTests))
#define BIDIR_SORTED_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BIDIR_SORTED_SET_TESTS, BidirSortedSetTestsClass))
#define IS_BIDIR_SORTED_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BIDIR_SORTED_SET_TESTS))
#define IS_BIDIR_SORTED_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BIDIR_SORTED_SET_TESTS))
#define BIDIR_SORTED_SET_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BIDIR_SORTED_SET_TESTS, BidirSortedSetTestsClass))

typedef struct _BidirSortedSetTests BidirSortedSetTests;
typedef struct _BidirSortedSetTestsClass BidirSortedSetTestsClass;
typedef struct _BidirSortedSetTestsPrivate BidirSortedSetTestsPrivate;
enum  {
	BIDIR_SORTED_SET_TESTS_0_PROPERTY,
	BIDIR_SORTED_SET_TESTS_NUM_PROPERTIES
};
static GParamSpec* bidir_sorted_set_tests_properties[BIDIR_SORTED_SET_TESTS_NUM_PROPERTIES];
typedef void (*GeeTestCaseTestMethod) (gpointer user_data);
typedef enum  {
	SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD,
	SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TAIL,
	SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_SUB,
	SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY
} SortedSetTestsSubSetTestsType;

#define SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TYPE (sorted_set_tests_sub_set_tests_type_get_type ())

#define BIDIR_SORTED_SET_TESTS_TYPE_BIDIR_SUB_SET_TESTS (bidir_sorted_set_tests_bidir_sub_set_tests_get_type ())
#define BIDIR_SORTED_SET_TESTS_BIDIR_SUB_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BIDIR_SORTED_SET_TESTS_TYPE_BIDIR_SUB_SET_TESTS, BidirSortedSetTestsBidirSubSetTests))
#define BIDIR_SORTED_SET_TESTS_BIDIR_SUB_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BIDIR_SORTED_SET_TESTS_TYPE_BIDIR_SUB_SET_TESTS, BidirSortedSetTestsBidirSubSetTestsClass))
#define BIDIR_SORTED_SET_TESTS_IS_BIDIR_SUB_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BIDIR_SORTED_SET_TESTS_TYPE_BIDIR_SUB_SET_TESTS))
#define BIDIR_SORTED_SET_TESTS_IS_BIDIR_SUB_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BIDIR_SORTED_SET_TESTS_TYPE_BIDIR_SUB_SET_TESTS))
#define BIDIR_SORTED_SET_TESTS_BIDIR_SUB_SET_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BIDIR_SORTED_SET_TESTS_TYPE_BIDIR_SUB_SET_TESTS, BidirSortedSetTestsBidirSubSetTestsClass))

typedef struct _BidirSortedSetTestsBidirSubSetTests BidirSortedSetTestsBidirSubSetTests;
typedef struct _BidirSortedSetTestsBidirSubSetTestsClass BidirSortedSetTestsBidirSubSetTestsClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _BidirSortedSetTestsBidirSubSetTestsPrivate BidirSortedSetTestsBidirSubSetTestsPrivate;
enum  {
	BIDIR_SORTED_SET_TESTS_BIDIR_SUB_SET_TESTS_0_PROPERTY,
	BIDIR_SORTED_SET_TESTS_BIDIR_SUB_SET_TESTS_NUM_PROPERTIES
};
static GParamSpec* bidir_sorted_set_tests_bidir_sub_set_tests_properties[BIDIR_SORTED_SET_TESTS_BIDIR_SUB_SET_TESTS_NUM_PROPERTIES];
#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 _CollectionTests {
	GeeTestCase parent_instance;
	CollectionTestsPrivate * priv;
	GeeCollection* test_collection;
};

struct _CollectionTestsClass {
	GeeTestCaseClass parent_class;
};

struct _SetTests {
	CollectionTests parent_instance;
	SetTestsPrivate * priv;
};

struct _SetTestsClass {
	CollectionTestsClass parent_class;
	void (*test_duplicates_are_ignored) (SetTests* self);
};

struct _SortedSetTests {
	SetTests parent_instance;
	SortedSetTestsPrivate * priv;
};

struct _SortedSetTestsClass {
	SetTestsClass parent_class;
};

struct _BidirSortedSetTests {
	SortedSetTests parent_instance;
	BidirSortedSetTestsPrivate * priv;
};

struct _BidirSortedSetTestsClass {
	SortedSetTestsClass parent_class;
};

struct _BidirSortedSetTestsBidirSubSetTests {
	GeeTestCase parent_instance;
	BidirSortedSetTestsBidirSubSetTestsPrivate * priv;
};

struct _BidirSortedSetTestsBidirSubSetTestsClass {
	GeeTestCaseClass parent_class;
};

struct _BidirSortedSetTestsBidirSubSetTestsPrivate {
	GeeBidirSortedSet* master;
	GeeBidirSortedSet* subset;
	BidirSortedSetTests* test;
	SortedSetTestsSubSetTestsType type;
};

static gpointer bidir_sorted_set_tests_parent_class = NULL;
static gint BidirSortedSetTestsBidirSubSetTests_private_offset;
static gpointer bidir_sorted_set_tests_bidir_sub_set_tests_parent_class = NULL;

GType gee_test_case_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeeTestCase, g_object_unref)
GType collection_tests_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CollectionTests, g_object_unref)
GType set_tests_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SetTests, g_object_unref)
GType sorted_set_tests_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SortedSetTests, g_object_unref)
GType bidir_sorted_set_tests_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BidirSortedSetTests, g_object_unref)
BidirSortedSetTests* bidir_sorted_set_tests_construct (GType object_type,
                                                       const gchar* name);
SortedSetTests* sorted_set_tests_construct (GType object_type,
                                            const gchar* name,
                                            gboolean strict);
void gee_test_case_add_test (GeeTestCase* self,
                             const gchar* name,
                             GeeTestCaseTestMethod test,
                             gpointer test_target,
                             GDestroyNotify test_target_destroy_notify);
void bidir_sorted_set_tests_test_bidir_iterator_can_go_backward (BidirSortedSetTests* self);
static void _bidir_sorted_set_tests_test_bidir_iterator_can_go_backward_gee_test_case_test_method (gpointer self);
void bidir_sorted_set_tests_test_mutable_bidir_iterator (BidirSortedSetTests* self);
static void _bidir_sorted_set_tests_test_mutable_bidir_iterator_gee_test_case_test_method (gpointer self);
void bidir_sorted_set_tests_test_bidir_iterator_first (BidirSortedSetTests* self);
static void _bidir_sorted_set_tests_test_bidir_iterator_first_gee_test_case_test_method (gpointer self);
void bidir_sorted_set_tests_test_bidir_iterator_last (BidirSortedSetTests* self);
static void _bidir_sorted_set_tests_test_bidir_iterator_last_gee_test_case_test_method (gpointer self);
GTestSuite* gee_test_case_get_suite (GeeTestCase* self);
GType sorted_set_tests_sub_set_tests_type_get_type (void) G_GNUC_CONST ;
BidirSortedSetTestsBidirSubSetTests* bidir_sorted_set_tests_bidir_sub_set_tests_new (BidirSortedSetTests* test,
                                                                                     SortedSetTestsSubSetTestsType type);
BidirSortedSetTestsBidirSubSetTests* bidir_sorted_set_tests_bidir_sub_set_tests_construct (GType object_type,
                                                                                           BidirSortedSetTests* test,
                                                                                           SortedSetTestsSubSetTestsType type);
GType bidir_sorted_set_tests_bidir_sub_set_tests_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BidirSortedSetTestsBidirSubSetTests, g_object_unref)
void gee_test_case_set_up (GeeTestCase* self);
void gee_test_case_tear_down (GeeTestCase* self);
const gchar* sorted_set_tests_sub_set_tests_type_to_string (SortedSetTestsSubSetTestsType self);
GeeTestCase* gee_test_case_construct (GType object_type,
                                      const gchar* name);
void bidir_sorted_set_tests_bidir_sub_set_tests_test_bidir_iterator (BidirSortedSetTestsBidirSubSetTests* self);
static void _bidir_sorted_set_tests_bidir_sub_set_tests_test_bidir_iterator_gee_test_case_test_method (gpointer self);
static void bidir_sorted_set_tests_bidir_sub_set_tests_real_set_up (GeeTestCase* base);
static void bidir_sorted_set_tests_bidir_sub_set_tests_real_tear_down (GeeTestCase* base);
static void bidir_sorted_set_tests_bidir_sub_set_tests_finalize (GObject * obj);
static GType bidir_sorted_set_tests_bidir_sub_set_tests_get_type_once (void);
static GType bidir_sorted_set_tests_get_type_once (void);
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
_bidir_sorted_set_tests_test_bidir_iterator_can_go_backward_gee_test_case_test_method (gpointer self)
{
	bidir_sorted_set_tests_test_bidir_iterator_can_go_backward ((BidirSortedSetTests*) self);
}

static void
_bidir_sorted_set_tests_test_mutable_bidir_iterator_gee_test_case_test_method (gpointer self)
{
	bidir_sorted_set_tests_test_mutable_bidir_iterator ((BidirSortedSetTests*) self);
}

static void
_bidir_sorted_set_tests_test_bidir_iterator_first_gee_test_case_test_method (gpointer self)
{
	bidir_sorted_set_tests_test_bidir_iterator_first ((BidirSortedSetTests*) self);
}

static void
_bidir_sorted_set_tests_test_bidir_iterator_last_gee_test_case_test_method (gpointer self)
{
	bidir_sorted_set_tests_test_bidir_iterator_last ((BidirSortedSetTests*) self);
}

BidirSortedSetTests*
bidir_sorted_set_tests_construct (GType object_type,
                                  const gchar* name)
{
	BidirSortedSetTests * self = NULL;
	GTestSuite* _tmp0_;
	BidirSortedSetTestsBidirSubSetTests* _tmp1_;
	BidirSortedSetTestsBidirSubSetTests* _tmp2_;
	GTestSuite* _tmp3_;
	GTestSuite* _tmp4_;
	BidirSortedSetTestsBidirSubSetTests* _tmp5_;
	BidirSortedSetTestsBidirSubSetTests* _tmp6_;
	GTestSuite* _tmp7_;
	GTestSuite* _tmp8_;
	BidirSortedSetTestsBidirSubSetTests* _tmp9_;
	BidirSortedSetTestsBidirSubSetTests* _tmp10_;
	GTestSuite* _tmp11_;
	GTestSuite* _tmp12_;
	BidirSortedSetTestsBidirSubSetTests* _tmp13_;
	BidirSortedSetTestsBidirSubSetTests* _tmp14_;
	GTestSuite* _tmp15_;
	g_return_val_if_fail (name != NULL, NULL);
	self = (BidirSortedSetTests*) sorted_set_tests_construct (object_type, name, TRUE);
	gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] bi-directional iterators can go backward", _bidir_sorted_set_tests_test_bidir_iterator_can_go_backward_gee_test_case_test_method, g_object_ref (self), g_object_unref);
	gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] bi-directional iterators are mutable", _bidir_sorted_set_tests_test_mutable_bidir_iterator_gee_test_case_test_method, g_object_ref (self), g_object_unref);
	gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] bi-directional iterators can to beginning", _bidir_sorted_set_tests_test_bidir_iterator_first_gee_test_case_test_method, g_object_ref (self), g_object_unref);
	gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] bi-directional iterators can to end", _bidir_sorted_set_tests_test_bidir_iterator_last_gee_test_case_test_method, g_object_ref (self), g_object_unref);
	_tmp0_ = gee_test_case_get_suite ((GeeTestCase*) self);
	_tmp1_ = bidir_sorted_set_tests_bidir_sub_set_tests_new (self, SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD);
	_tmp2_ = _tmp1_;
	_tmp3_ = gee_test_case_get_suite ((GeeTestCase*) _tmp2_);
	g_test_suite_add_suite (_tmp0_, _tmp3_);
	_g_object_unref0 (_tmp2_);
	_tmp4_ = gee_test_case_get_suite ((GeeTestCase*) self);
	_tmp5_ = bidir_sorted_set_tests_bidir_sub_set_tests_new (self, SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TAIL);
	_tmp6_ = _tmp5_;
	_tmp7_ = gee_test_case_get_suite ((GeeTestCase*) _tmp6_);
	g_test_suite_add_suite (_tmp4_, _tmp7_);
	_g_object_unref0 (_tmp6_);
	_tmp8_ = gee_test_case_get_suite ((GeeTestCase*) self);
	_tmp9_ = bidir_sorted_set_tests_bidir_sub_set_tests_new (self, SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_SUB);
	_tmp10_ = _tmp9_;
	_tmp11_ = gee_test_case_get_suite ((GeeTestCase*) _tmp10_);
	g_test_suite_add_suite (_tmp8_, _tmp11_);
	_g_object_unref0 (_tmp10_);
	_tmp12_ = gee_test_case_get_suite ((GeeTestCase*) self);
	_tmp13_ = bidir_sorted_set_tests_bidir_sub_set_tests_new (self, SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY);
	_tmp14_ = _tmp13_;
	_tmp15_ = gee_test_case_get_suite ((GeeTestCase*) _tmp14_);
	g_test_suite_add_suite (_tmp12_, _tmp15_);
	_g_object_unref0 (_tmp14_);
	return self;
}

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

void
bidir_sorted_set_tests_test_bidir_iterator_can_go_backward (BidirSortedSetTests* self)
{
	GeeBidirSortedSet* test_set = NULL;
	GeeCollection* _tmp0_;
	GeeBidirSortedSet* _tmp1_;
	GeeBidirIterator* iterator = NULL;
	GeeBidirIterator* _tmp2_;
	GeeBidirIterator* _tmp3_;
	GeeBidirIterator* _tmp4_;
	GeeBidirIterator* _tmp5_;
	GeeBidirIterator* _tmp6_;
	gpointer _tmp7_;
	gchar* _tmp8_;
	GeeBidirIterator* _tmp9_;
	GeeBidirIterator* _tmp10_;
	GeeBidirIterator* _tmp11_;
	gpointer _tmp12_;
	gchar* _tmp13_;
	GeeBidirIterator* _tmp14_;
	GeeBidirIterator* _tmp15_;
	GeeBidirIterator* _tmp16_;
	gpointer _tmp17_;
	gchar* _tmp18_;
	GeeBidirIterator* _tmp19_;
	GeeBidirIterator* _tmp20_;
	GeeBidirIterator* _tmp21_;
	gpointer _tmp22_;
	gchar* _tmp23_;
	GeeBidirIterator* _tmp24_;
	GeeBidirIterator* _tmp25_;
	GeeBidirIterator* _tmp26_;
	gpointer _tmp27_;
	gchar* _tmp28_;
	GeeBidirIterator* _tmp29_;
	GeeBidirIterator* _tmp30_;
	GeeBidirIterator* _tmp31_;
	gpointer _tmp32_;
	gchar* _tmp33_;
	GeeBidirIterator* _tmp34_;
	GeeBidirIterator* _tmp35_;
	GeeBidirIterator* _tmp36_;
	GeeBidirIterator* _tmp37_;
	gpointer _tmp38_;
	gchar* _tmp39_;
	GeeBidirIterator* _tmp40_;
	GeeBidirIterator* _tmp41_;
	gpointer _tmp42_;
	gchar* _tmp43_;
	GeeBidirIterator* _tmp44_;
	GeeBidirIterator* _tmp45_;
	gpointer _tmp46_;
	gchar* _tmp47_;
	GeeBidirIterator* _tmp48_;
	GeeBidirIterator* _tmp49_;
	gpointer _tmp50_;
	gchar* _tmp51_;
	GeeBidirIterator* _tmp52_;
	GeeBidirIterator* _tmp53_;
	gpointer _tmp54_;
	gchar* _tmp55_;
	GeeBidirIterator* _tmp56_;
	GeeBidirIterator* _tmp57_;
	gpointer _tmp58_;
	gchar* _tmp59_;
	g_return_if_fail (self != NULL);
	_tmp0_ = ((CollectionTests*) self)->test_collection;
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp0_) : NULL);
	test_set = _tmp1_;
	_tmp2_ = gee_bidir_sorted_set_bidir_iterator (test_set);
	iterator = _tmp2_;
	_tmp3_ = iterator;
	_vala_assert (!gee_bidir_iterator_has_previous (_tmp3_), "!iterator.has_previous ()");
	_vala_assert (gee_collection_add ((GeeCollection*) test_set, "one"), "test_set.add (\"one\")");
	_vala_assert (gee_collection_add ((GeeCollection*) test_set, "two"), "test_set.add (\"two\")");
	_vala_assert (gee_collection_add ((GeeCollection*) test_set, "three"), "test_set.add (\"three\")");
	_vala_assert (gee_collection_add ((GeeCollection*) test_set, "four"), "test_set.add (\"four\")");
	_vala_assert (gee_collection_add ((GeeCollection*) test_set, "five"), "test_set.add (\"five\")");
	_vala_assert (gee_collection_add ((GeeCollection*) test_set, "six"), "test_set.add (\"six\")");
	_tmp4_ = gee_bidir_sorted_set_bidir_iterator (test_set);
	_g_object_unref0 (iterator);
	iterator = _tmp4_;
	_tmp5_ = iterator;
	_vala_assert (gee_iterator_next ((GeeIterator*) _tmp5_), "iterator.next ()");
	_tmp6_ = iterator;
	_tmp7_ = gee_iterator_get ((GeeIterator*) _tmp6_);
	_tmp8_ = (gchar*) _tmp7_;
	_vala_assert (g_strcmp0 (_tmp8_, "five") == 0, "iterator.get () == \"five\"");
	_g_free0 (_tmp8_);
	_tmp9_ = iterator;
	_vala_assert (!gee_bidir_iterator_has_previous (_tmp9_), "!iterator.has_previous ()");
	_tmp10_ = iterator;
	_vala_assert (gee_iterator_next ((GeeIterator*) _tmp10_), "iterator.next ()");
	_tmp11_ = iterator;
	_tmp12_ = gee_iterator_get ((GeeIterator*) _tmp11_);
	_tmp13_ = (gchar*) _tmp12_;
	_vala_assert (g_strcmp0 (_tmp13_, "four") == 0, "iterator.get () == \"four\"");
	_g_free0 (_tmp13_);
	_tmp14_ = iterator;
	_vala_assert (gee_bidir_iterator_has_previous (_tmp14_), "iterator.has_previous ()");
	_tmp15_ = iterator;
	_vala_assert (gee_iterator_next ((GeeIterator*) _tmp15_), "iterator.next ()");
	_tmp16_ = iterator;
	_tmp17_ = gee_iterator_get ((GeeIterator*) _tmp16_);
	_tmp18_ = (gchar*) _tmp17_;
	_vala_assert (g_strcmp0 (_tmp18_, "one") == 0, "iterator.get () == \"one\"");
	_g_free0 (_tmp18_);
	_tmp19_ = iterator;
	_vala_assert (gee_bidir_iterator_has_previous (_tmp19_), "iterator.has_previous ()");
	_tmp20_ = iterator;
	_vala_assert (gee_iterator_next ((GeeIterator*) _tmp20_), "iterator.next ()");
	_tmp21_ = iterator;
	_tmp22_ = gee_iterator_get ((GeeIterator*) _tmp21_);
	_tmp23_ = (gchar*) _tmp22_;
	_vala_assert (g_strcmp0 (_tmp23_, "six") == 0, "iterator.get () == \"six\"");
	_g_free0 (_tmp23_);
	_tmp24_ = iterator;
	_vala_assert (gee_bidir_iterator_has_previous (_tmp24_), "iterator.has_previous ()");
	_tmp25_ = iterator;
	_vala_assert (gee_iterator_next ((GeeIterator*) _tmp25_), "iterator.next ()");
	_tmp26_ = iterator;
	_tmp27_ = gee_iterator_get ((GeeIterator*) _tmp26_);
	_tmp28_ = (gchar*) _tmp27_;
	_vala_assert (g_strcmp0 (_tmp28_, "three") == 0, "iterator.get () == \"three\"");
	_g_free0 (_tmp28_);
	_tmp29_ = iterator;
	_vala_assert (gee_bidir_iterator_has_previous (_tmp29_), "iterator.has_previous ()");
	_tmp30_ = iterator;
	_vala_assert (gee_iterator_next ((GeeIterator*) _tmp30_), "iterator.next ()");
	_tmp31_ = iterator;
	_tmp32_ = gee_iterator_get ((GeeIterator*) _tmp31_);
	_tmp33_ = (gchar*) _tmp32_;
	_vala_assert (g_strcmp0 (_tmp33_, "two") == 0, "iterator.get () == \"two\"");
	_g_free0 (_tmp33_);
	_tmp34_ = iterator;
	_vala_assert (gee_bidir_iterator_has_previous (_tmp34_), "iterator.has_previous ()");
	_tmp35_ = iterator;
	_vala_assert (!gee_iterator_next ((GeeIterator*) _tmp35_), "!iterator.next ()");
	_tmp36_ = iterator;
	_vala_assert (gee_bidir_iterator_previous (_tmp36_), "iterator.previous ()");
	_tmp37_ = iterator;
	_tmp38_ = gee_iterator_get ((GeeIterator*) _tmp37_);
	_tmp39_ = (gchar*) _tmp38_;
	_vala_assert (g_strcmp0 (_tmp39_, "three") == 0, "iterator.get () == \"three\"");
	_g_free0 (_tmp39_);
	_tmp40_ = iterator;
	_vala_assert (gee_bidir_iterator_previous (_tmp40_), "iterator.previous ()");
	_tmp41_ = iterator;
	_tmp42_ = gee_iterator_get ((GeeIterator*) _tmp41_);
	_tmp43_ = (gchar*) _tmp42_;
	_vala_assert (g_strcmp0 (_tmp43_, "six") == 0, "iterator.get () == \"six\"");
	_g_free0 (_tmp43_);
	_tmp44_ = iterator;
	_vala_assert (gee_bidir_iterator_previous (_tmp44_), "iterator.previous ()");
	_tmp45_ = iterator;
	_tmp46_ = gee_iterator_get ((GeeIterator*) _tmp45_);
	_tmp47_ = (gchar*) _tmp46_;
	_vala_assert (g_strcmp0 (_tmp47_, "one") == 0, "iterator.get () == \"one\"");
	_g_free0 (_tmp47_);
	_tmp48_ = iterator;
	_vala_assert (gee_bidir_iterator_previous (_tmp48_), "iterator.previous ()");
	_tmp49_ = iterator;
	_tmp50_ = gee_iterator_get ((GeeIterator*) _tmp49_);
	_tmp51_ = (gchar*) _tmp50_;
	_vala_assert (g_strcmp0 (_tmp51_, "four") == 0, "iterator.get () == \"four\"");
	_g_free0 (_tmp51_);
	_tmp52_ = iterator;
	_vala_assert (gee_bidir_iterator_previous (_tmp52_), "iterator.previous ()");
	_tmp53_ = iterator;
	_tmp54_ = gee_iterator_get ((GeeIterator*) _tmp53_);
	_tmp55_ = (gchar*) _tmp54_;
	_vala_assert (g_strcmp0 (_tmp55_, "five") == 0, "iterator.get () == \"five\"");
	_g_free0 (_tmp55_);
	_tmp56_ = iterator;
	_vala_assert (!gee_bidir_iterator_previous (_tmp56_), "!iterator.previous ()");
	_tmp57_ = iterator;
	_tmp58_ = gee_iterator_get ((GeeIterator*) _tmp57_);
	_tmp59_ = (gchar*) _tmp58_;
	_vala_assert (g_strcmp0 (_tmp59_, "five") == 0, "iterator.get () == \"five\"");
	_g_free0 (_tmp59_);
	_g_object_unref0 (iterator);
	_g_object_unref0 (test_set);
}

void
bidir_sorted_set_tests_test_bidir_iterator_first (BidirSortedSetTests* self)
{
	GeeBidirSortedSet* test_set = NULL;
	GeeCollection* _tmp0_;
	GeeBidirSortedSet* _tmp1_;
	GeeBidirIterator* iterator = NULL;
	GeeBidirIterator* _tmp2_;
	GeeBidirIterator* _tmp3_;
	GeeBidirIterator* _tmp4_;
	GeeBidirIterator* _tmp5_;
	GeeBidirIterator* _tmp6_;
	gpointer _tmp7_;
	gchar* _tmp8_;
	GeeBidirIterator* _tmp9_;
	GeeBidirIterator* _tmp10_;
	gpointer _tmp11_;
	gchar* _tmp12_;
	g_return_if_fail (self != NULL);
	_tmp0_ = ((CollectionTests*) self)->test_collection;
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp0_) : NULL);
	test_set = _tmp1_;
	_tmp2_ = gee_bidir_sorted_set_bidir_iterator (test_set);
	iterator = _tmp2_;
	_tmp3_ = iterator;
	_vala_assert (!gee_bidir_iterator_first (_tmp3_), "!iterator.first ()");
	_vala_assert (gee_collection_add ((GeeCollection*) test_set, "one"), "test_set.add (\"one\")");
	_vala_assert (gee_collection_add ((GeeCollection*) test_set, "two"), "test_set.add (\"two\")");
	_vala_assert (gee_collection_add ((GeeCollection*) test_set, "three"), "test_set.add (\"three\")");
	_vala_assert (gee_collection_add ((GeeCollection*) test_set, "four"), "test_set.add (\"four\")");
	_vala_assert (gee_collection_add ((GeeCollection*) test_set, "five"), "test_set.add (\"five\")");
	_vala_assert (gee_collection_add ((GeeCollection*) test_set, "six"), "test_set.add (\"six\")");
	_tmp4_ = gee_bidir_sorted_set_bidir_iterator (test_set);
	_g_object_unref0 (iterator);
	iterator = _tmp4_;
	_tmp5_ = iterator;
	_vala_assert (gee_bidir_iterator_last (_tmp5_), "iterator.last ()");
	_tmp6_ = iterator;
	_tmp7_ = gee_iterator_get ((GeeIterator*) _tmp6_);
	_tmp8_ = (gchar*) _tmp7_;
	_vala_assert (g_strcmp0 (_tmp8_, "two") == 0, "iterator.get () == \"two\"");
	_g_free0 (_tmp8_);
	_tmp9_ = iterator;
	_vala_assert (gee_bidir_iterator_first (_tmp9_), "iterator.first ()");
	_tmp10_ = iterator;
	_tmp11_ = gee_iterator_get ((GeeIterator*) _tmp10_);
	_tmp12_ = (gchar*) _tmp11_;
	_vala_assert (g_strcmp0 (_tmp12_, "five") == 0, "iterator.get () == \"five\"");
	_g_free0 (_tmp12_);
	_g_object_unref0 (iterator);
	_g_object_unref0 (test_set);
}

void
bidir_sorted_set_tests_test_bidir_iterator_last (BidirSortedSetTests* self)
{
	GeeBidirSortedSet* test_set = NULL;
	GeeCollection* _tmp0_;
	GeeBidirSortedSet* _tmp1_;
	GeeBidirIterator* iterator = NULL;
	GeeBidirIterator* _tmp2_;
	GeeBidirIterator* _tmp3_;
	GeeBidirIterator* _tmp4_;
	GeeBidirIterator* _tmp5_;
	GeeBidirIterator* _tmp6_;
	gpointer _tmp7_;
	gchar* _tmp8_;
	g_return_if_fail (self != NULL);
	_tmp0_ = ((CollectionTests*) self)->test_collection;
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp0_) : NULL);
	test_set = _tmp1_;
	_tmp2_ = gee_bidir_sorted_set_bidir_iterator (test_set);
	iterator = _tmp2_;
	_tmp3_ = iterator;
	_vala_assert (!gee_bidir_iterator_last (_tmp3_), "!iterator.last ()");
	_vala_assert (gee_collection_add ((GeeCollection*) test_set, "one"), "test_set.add (\"one\")");
	_vala_assert (gee_collection_add ((GeeCollection*) test_set, "two"), "test_set.add (\"two\")");
	_vala_assert (gee_collection_add ((GeeCollection*) test_set, "three"), "test_set.add (\"three\")");
	_vala_assert (gee_collection_add ((GeeCollection*) test_set, "four"), "test_set.add (\"four\")");
	_vala_assert (gee_collection_add ((GeeCollection*) test_set, "five"), "test_set.add (\"five\")");
	_vala_assert (gee_collection_add ((GeeCollection*) test_set, "six"), "test_set.add (\"six\")");
	_tmp4_ = gee_bidir_sorted_set_bidir_iterator (test_set);
	_g_object_unref0 (iterator);
	iterator = _tmp4_;
	_tmp5_ = iterator;
	_vala_assert (gee_bidir_iterator_last (_tmp5_), "iterator.last ()");
	_tmp6_ = iterator;
	_tmp7_ = gee_iterator_get ((GeeIterator*) _tmp6_);
	_tmp8_ = (gchar*) _tmp7_;
	_vala_assert (g_strcmp0 (_tmp8_, "two") == 0, "iterator.get () == \"two\"");
	_g_free0 (_tmp8_);
	_g_object_unref0 (iterator);
	_g_object_unref0 (test_set);
}

void
bidir_sorted_set_tests_test_mutable_bidir_iterator (BidirSortedSetTests* self)
{
	GeeBidirSortedSet* test_set = NULL;
	GeeCollection* _tmp0_;
	GeeBidirSortedSet* _tmp1_;
	GeeBidirIterator* iterator = NULL;
	GeeBidirSortedSet* _tmp2_;
	GeeBidirIterator* _tmp3_;
	GeeBidirIterator* _tmp4_;
	GeeBidirSortedSet* _tmp5_;
	GeeBidirSortedSet* _tmp6_;
	GeeBidirSortedSet* _tmp7_;
	GeeBidirSortedSet* _tmp8_;
	GeeBidirSortedSet* _tmp9_;
	GeeBidirSortedSet* _tmp10_;
	GeeBidirSortedSet* _tmp11_;
	GeeBidirIterator* _tmp12_;
	GeeBidirIterator* _tmp14_;
	GeeBidirIterator* _tmp15_;
	gpointer _tmp16_;
	gchar* _tmp17_;
	GeeBidirIterator* _tmp18_;
	GeeBidirSortedSet* _tmp19_;
	GeeBidirIterator* _tmp20_;
	GeeBidirIterator* _tmp21_;
	GeeBidirIterator* _tmp25_;
	GeeBidirIterator* _tmp26_;
	GeeBidirIterator* _tmp27_;
	gpointer _tmp28_;
	gchar* _tmp29_;
	GeeBidirIterator* _tmp30_;
	GeeBidirIterator* _tmp31_;
	gpointer _tmp32_;
	gchar* _tmp33_;
	GeeBidirIterator* _tmp34_;
	GeeBidirSortedSet* _tmp35_;
	GeeBidirIterator* _tmp36_;
	GeeBidirIterator* _tmp37_;
	GeeBidirIterator* _tmp38_;
	GeeBidirIterator* _tmp39_;
	gpointer _tmp40_;
	gchar* _tmp41_;
	g_return_if_fail (self != NULL);
	_tmp0_ = ((CollectionTests*) self)->test_collection;
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp0_) : NULL);
	test_set = _tmp1_;
	_tmp2_ = test_set;
	_tmp3_ = gee_bidir_sorted_set_bidir_iterator (_tmp2_);
	iterator = _tmp3_;
	_tmp4_ = iterator;
	_vala_assert (!gee_bidir_iterator_has_previous (_tmp4_), "!iterator.has_previous ()");
	_tmp5_ = test_set;
	_vala_assert (gee_collection_add ((GeeCollection*) _tmp5_, "one"), "test_set.add (\"one\")");
	_tmp6_ = test_set;
	_vala_assert (gee_collection_add ((GeeCollection*) _tmp6_, "two"), "test_set.add (\"two\")");
	_tmp7_ = test_set;
	_vala_assert (gee_collection_add ((GeeCollection*) _tmp7_, "three"), "test_set.add (\"three\")");
	_tmp8_ = test_set;
	_vala_assert (gee_collection_add ((GeeCollection*) _tmp8_, "four"), "test_set.add (\"four\")");
	_tmp9_ = test_set;
	_vala_assert (gee_collection_add ((GeeCollection*) _tmp9_, "five"), "test_set.add (\"five\")");
	_tmp10_ = test_set;
	_vala_assert (gee_collection_add ((GeeCollection*) _tmp10_, "six"), "test_set.add (\"six\")");
	_tmp11_ = test_set;
	_tmp12_ = gee_bidir_sorted_set_bidir_iterator (_tmp11_);
	_g_object_unref0 (iterator);
	iterator = _tmp12_;
	if (g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR)) {
		GeeBidirIterator* _tmp13_;
		_tmp13_ = iterator;
		gee_iterator_remove ((GeeIterator*) _tmp13_);
		exit (0);
	}
	g_test_trap_assert_failed ();
	_tmp14_ = iterator;
	_vala_assert (gee_iterator_next ((GeeIterator*) _tmp14_), "iterator.next ()");
	_tmp15_ = iterator;
	_tmp16_ = gee_iterator_get ((GeeIterator*) _tmp15_);
	_tmp17_ = (gchar*) _tmp16_;
	_vala_assert (g_strcmp0 (_tmp17_, "five") == 0, "iterator.get () == \"five\"");
	_g_free0 (_tmp17_);
	_tmp18_ = iterator;
	gee_iterator_remove ((GeeIterator*) _tmp18_);
	_tmp19_ = test_set;
	_vala_assert (!gee_collection_contains ((GeeCollection*) _tmp19_, "five"), "!test_set.contains (\"five\")");
	_tmp20_ = iterator;
	_vala_assert (gee_iterator_has_next ((GeeIterator*) _tmp20_), "iterator.has_next ()");
	_tmp21_ = iterator;
	_vala_assert (!gee_bidir_iterator_has_previous (_tmp21_), "!iterator.has_previous ()");
	if (g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR)) {
		GeeBidirIterator* _tmp22_;
		gpointer _tmp23_;
		gchar* _tmp24_;
		_tmp22_ = iterator;
		_tmp23_ = gee_iterator_get ((GeeIterator*) _tmp22_);
		_tmp24_ = (gchar*) _tmp23_;
		_g_free0 (_tmp24_);
		exit (0);
	}
	_tmp25_ = iterator;
	_vala_assert (!gee_bidir_iterator_previous (_tmp25_), "!iterator.previous ()");
	_tmp26_ = iterator;
	_vala_assert (gee_iterator_next ((GeeIterator*) _tmp26_), "iterator.next ()");
	_tmp27_ = iterator;
	_tmp28_ = gee_iterator_get ((GeeIterator*) _tmp27_);
	_tmp29_ = (gchar*) _tmp28_;
	_vala_assert (g_strcmp0 (_tmp29_, "four") == 0, "iterator.get () == \"four\"");
	_g_free0 (_tmp29_);
	_tmp30_ = iterator;
	_vala_assert (gee_iterator_next ((GeeIterator*) _tmp30_), "iterator.next ()");
	_tmp31_ = iterator;
	_tmp32_ = gee_iterator_get ((GeeIterator*) _tmp31_);
	_tmp33_ = (gchar*) _tmp32_;
	_vala_assert (g_strcmp0 (_tmp33_, "one") == 0, "iterator.get () == \"one\"");
	_g_free0 (_tmp33_);
	_tmp34_ = iterator;
	gee_iterator_remove ((GeeIterator*) _tmp34_);
	_tmp35_ = test_set;
	_vala_assert (!gee_collection_contains ((GeeCollection*) _tmp35_, "one"), "!test_set.contains (\"one\")");
	_tmp36_ = iterator;
	_vala_assert (gee_iterator_has_next ((GeeIterator*) _tmp36_), "iterator.has_next ()");
	_tmp37_ = iterator;
	_vala_assert (gee_bidir_iterator_has_previous (_tmp37_), "iterator.has_previous ()");
	_tmp38_ = iterator;
	_vala_assert (gee_bidir_iterator_previous (_tmp38_), "iterator.previous ()");
	_tmp39_ = iterator;
	_tmp40_ = gee_iterator_get ((GeeIterator*) _tmp39_);
	_tmp41_ = (gchar*) _tmp40_;
	_vala_assert (g_strcmp0 (_tmp41_, "four") == 0, "iterator.get () == \"four\"");
	_g_free0 (_tmp41_);
	_g_object_unref0 (iterator);
	_g_object_unref0 (test_set);
}

static inline gpointer
bidir_sorted_set_tests_bidir_sub_set_tests_get_instance_private (BidirSortedSetTestsBidirSubSetTests* self)
{
	return G_STRUCT_MEMBER_P (self, BidirSortedSetTestsBidirSubSetTests_private_offset);
}

static void
_bidir_sorted_set_tests_bidir_sub_set_tests_test_bidir_iterator_gee_test_case_test_method (gpointer self)
{
	bidir_sorted_set_tests_bidir_sub_set_tests_test_bidir_iterator ((BidirSortedSetTestsBidirSubSetTests*) self);
}

BidirSortedSetTestsBidirSubSetTests*
bidir_sorted_set_tests_bidir_sub_set_tests_construct (GType object_type,
                                                      BidirSortedSetTests* test,
                                                      SortedSetTestsSubSetTestsType type)
{
	BidirSortedSetTestsBidirSubSetTests * self = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	BidirSortedSetTests* _tmp3_;
	g_return_val_if_fail (test != NULL, NULL);
	_tmp0_ = sorted_set_tests_sub_set_tests_type_to_string (type);
	_tmp1_ = g_strdup_printf ("%s Subset", _tmp0_);
	_tmp2_ = _tmp1_;
	self = (BidirSortedSetTestsBidirSubSetTests*) gee_test_case_construct (object_type, _tmp2_);
	_g_free0 (_tmp2_);
	_tmp3_ = _g_object_ref0 (test);
	_g_object_unref0 (self->priv->test);
	self->priv->test = _tmp3_;
	self->priv->type = type;
	gee_test_case_add_test ((GeeTestCase*) self, "[BidirSortedSet] bi-directional iterator", _bidir_sorted_set_tests_bidir_sub_set_tests_test_bidir_iterator_gee_test_case_test_method, g_object_ref (self), g_object_unref);
	return self;
}

BidirSortedSetTestsBidirSubSetTests*
bidir_sorted_set_tests_bidir_sub_set_tests_new (BidirSortedSetTests* test,
                                                SortedSetTestsSubSetTestsType type)
{
	return bidir_sorted_set_tests_bidir_sub_set_tests_construct (BIDIR_SORTED_SET_TESTS_TYPE_BIDIR_SUB_SET_TESTS, test, type);
}

static void
bidir_sorted_set_tests_bidir_sub_set_tests_real_set_up (GeeTestCase* base)
{
	BidirSortedSetTestsBidirSubSetTests * self;
	BidirSortedSetTests* _tmp0_;
	BidirSortedSetTests* _tmp1_;
	GeeCollection* _tmp2_;
	GeeBidirSortedSet* _tmp3_;
	SortedSetTestsSubSetTestsType _tmp4_;
	self = (BidirSortedSetTestsBidirSubSetTests*) base;
	_tmp0_ = self->priv->test;
	gee_test_case_set_up ((GeeTestCase*) _tmp0_);
	_tmp1_ = self->priv->test;
	_tmp2_ = ((CollectionTests*) _tmp1_)->test_collection;
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp2_) : NULL);
	_g_object_unref0 (self->priv->master);
	self->priv->master = _tmp3_;
	_tmp4_ = self->priv->type;
	switch (_tmp4_) {
		case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD:
		{
			GeeBidirSortedSet* _tmp5_;
			GeeSortedSet* _tmp6_;
			GeeBidirSortedSet* _tmp7_;
			_tmp5_ = self->priv->master;
			_tmp6_ = gee_sorted_set_head_set ((GeeSortedSet*) _tmp5_, "one");
			_tmp7_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp6_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp6_) : NULL;
			if (_tmp7_ == NULL) {
				_g_object_unref0 (_tmp6_);
			}
			_g_object_unref0 (self->priv->subset);
			self->priv->subset = _tmp7_;
			break;
		}
		case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TAIL:
		{
			GeeBidirSortedSet* _tmp8_;
			GeeSortedSet* _tmp9_;
			GeeBidirSortedSet* _tmp10_;
			_tmp8_ = self->priv->master;
			_tmp9_ = gee_sorted_set_tail_set ((GeeSortedSet*) _tmp8_, "six");
			_tmp10_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp9_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp9_) : NULL;
			if (_tmp10_ == NULL) {
				_g_object_unref0 (_tmp9_);
			}
			_g_object_unref0 (self->priv->subset);
			self->priv->subset = _tmp10_;
			break;
		}
		case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_SUB:
		{
			GeeBidirSortedSet* _tmp11_;
			GeeSortedSet* _tmp12_;
			GeeBidirSortedSet* _tmp13_;
			_tmp11_ = self->priv->master;
			_tmp12_ = gee_sorted_set_sub_set ((GeeSortedSet*) _tmp11_, "four", "three");
			_tmp13_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp12_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp12_) : NULL;
			if (_tmp13_ == NULL) {
				_g_object_unref0 (_tmp12_);
			}
			_g_object_unref0 (self->priv->subset);
			self->priv->subset = _tmp13_;
			break;
		}
		case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY:
		{
			GeeBidirSortedSet* _tmp14_;
			GeeSortedSet* _tmp15_;
			GeeBidirSortedSet* _tmp16_;
			_tmp14_ = self->priv->master;
			_tmp15_ = gee_sorted_set_sub_set ((GeeSortedSet*) _tmp14_, "three", "four");
			_tmp16_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp15_) : NULL;
			if (_tmp16_ == NULL) {
				_g_object_unref0 (_tmp15_);
			}
			_g_object_unref0 (self->priv->subset);
			self->priv->subset = _tmp16_;
			break;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
}

static void
bidir_sorted_set_tests_bidir_sub_set_tests_real_tear_down (GeeTestCase* base)
{
	BidirSortedSetTestsBidirSubSetTests * self;
	BidirSortedSetTests* _tmp0_;
	self = (BidirSortedSetTestsBidirSubSetTests*) base;
	_tmp0_ = self->priv->test;
	gee_test_case_tear_down ((GeeTestCase*) _tmp0_);
}

void
bidir_sorted_set_tests_bidir_sub_set_tests_test_bidir_iterator (BidirSortedSetTestsBidirSubSetTests* self)
{
	GeeBidirSortedSet* _tmp0_;
	GeeBidirSortedSet* _tmp1_;
	GeeBidirSortedSet* _tmp2_;
	GeeBidirSortedSet* _tmp3_;
	GeeBidirSortedSet* _tmp4_;
	GeeBidirSortedSet* _tmp5_;
	GeeBidirSortedSet* _tmp6_;
	gint _tmp7_;
	gint _tmp8_;
	gchar** contains = NULL;
	gint contains_length1 = 0;
	gint _contains_size_ = 0;
	SortedSetTestsSubSetTestsType _tmp9_;
	guint i = 0U;
	gchar** _tmp31_;
	gint _tmp31__length1;
	GeeBidirIterator* iter = NULL;
	GeeBidirSortedSet* _tmp32_;
	GeeBidirIterator* _tmp33_;
	SortedSetTestsSubSetTestsType _tmp34_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->master;
	_vala_assert (gee_collection_add ((GeeCollection*) _tmp0_, "one"), "master.add (\"one\")");
	_tmp1_ = self->priv->master;
	_vala_assert (gee_collection_add ((GeeCollection*) _tmp1_, "two"), "master.add (\"two\")");
	_tmp2_ = self->priv->master;
	_vala_assert (gee_collection_add ((GeeCollection*) _tmp2_, "three"), "master.add (\"three\")");
	_tmp3_ = self->priv->master;
	_vala_assert (gee_collection_add ((GeeCollection*) _tmp3_, "four"), "master.add (\"four\")");
	_tmp4_ = self->priv->master;
	_vala_assert (gee_collection_add ((GeeCollection*) _tmp4_, "five"), "master.add (\"five\")");
	_tmp5_ = self->priv->master;
	_vala_assert (gee_collection_add ((GeeCollection*) _tmp5_, "six"), "master.add (\"six\")");
	_tmp6_ = self->priv->master;
	_tmp7_ = gee_collection_get_size ((GeeCollection*) _tmp6_);
	_tmp8_ = _tmp7_;
	_vala_assert (_tmp8_ == 6, "master.size == 6");
	_tmp9_ = self->priv->type;
	switch (_tmp9_) {
		case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD:
		{
			gchar* _tmp10_;
			gchar* _tmp11_;
			gchar** _tmp12_;
			_tmp10_ = g_strdup ("five");
			_tmp11_ = g_strdup ("four");
			_tmp12_ = g_new0 (gchar*, 2 + 1);
			_tmp12_[0] = _tmp10_;
			_tmp12_[1] = _tmp11_;
			contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL);
			contains = _tmp12_;
			contains_length1 = 2;
			_contains_size_ = contains_length1;
			break;
		}
		case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TAIL:
		{
			gchar* _tmp13_;
			gchar* _tmp14_;
			gchar* _tmp15_;
			gchar** _tmp16_;
			_tmp13_ = g_strdup ("six");
			_tmp14_ = g_strdup ("three");
			_tmp15_ = g_strdup ("two");
			_tmp16_ = g_new0 (gchar*, 3 + 1);
			_tmp16_[0] = _tmp13_;
			_tmp16_[1] = _tmp14_;
			_tmp16_[2] = _tmp15_;
			contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL);
			contains = _tmp16_;
			contains_length1 = 3;
			_contains_size_ = contains_length1;
			break;
		}
		case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_SUB:
		{
			gchar* _tmp17_;
			gchar* _tmp18_;
			gchar* _tmp19_;
			gchar** _tmp20_;
			_tmp17_ = g_strdup ("four");
			_tmp18_ = g_strdup ("one");
			_tmp19_ = g_strdup ("six");
			_tmp20_ = g_new0 (gchar*, 3 + 1);
			_tmp20_[0] = _tmp17_;
			_tmp20_[1] = _tmp18_;
			_tmp20_[2] = _tmp19_;
			contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL);
			contains = _tmp20_;
			contains_length1 = 3;
			_contains_size_ = contains_length1;
			break;
		}
		case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY:
		{
			gchar** _tmp21_;
			_tmp21_ = g_new0 (gchar*, 0 + 1);
			contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL);
			contains = _tmp21_;
			contains_length1 = 0;
			_contains_size_ = contains_length1;
			break;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
	i = (guint) 0;
	{
		GeeIterator* _e_it = NULL;
		GeeBidirSortedSet* _tmp22_;
		GeeIterator* _tmp23_;
		_tmp22_ = self->priv->subset;
		_tmp23_ = gee_iterable_iterator ((GeeIterable*) _tmp22_);
		_e_it = _tmp23_;
		while (TRUE) {
			GeeIterator* _tmp24_;
			gchar* e = NULL;
			GeeIterator* _tmp25_;
			gpointer _tmp26_;
			const gchar* _tmp27_;
			gchar** _tmp28_;
			gint _tmp28__length1;
			guint _tmp29_;
			const gchar* _tmp30_;
			_tmp24_ = _e_it;
			if (!gee_iterator_next (_tmp24_)) {
				break;
			}
			_tmp25_ = _e_it;
			_tmp26_ = gee_iterator_get (_tmp25_);
			e = (gchar*) _tmp26_;
			_tmp27_ = e;
			_tmp28_ = contains;
			_tmp28__length1 = contains_length1;
			_tmp29_ = i;
			i = _tmp29_ + 1;
			_tmp30_ = _tmp28_[_tmp29_];
			_vala_assert (g_strcmp0 (_tmp27_, _tmp30_) == 0, "e == contains[i++]");
			_g_free0 (e);
		}
		_g_object_unref0 (_e_it);
	}
	_tmp31_ = contains;
	_tmp31__length1 = contains_length1;
	_vala_assert (i == ((guint) _tmp31__length1), "i == contains.length");
	_tmp32_ = self->priv->subset;
	_tmp33_ = gee_bidir_sorted_set_bidir_iterator (_tmp32_);
	iter = _tmp33_;
	_tmp34_ = self->priv->type;
	if (_tmp34_ != SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY) {
		GeeBidirIterator* _tmp35_;
		GeeBidirIterator* _tmp36_;
		gpointer _tmp37_;
		gchar* _tmp38_;
		gchar** _tmp39_;
		gint _tmp39__length1;
		gchar** _tmp40_;
		gint _tmp40__length1;
		const gchar* _tmp41_;
		GeeBidirIterator* _tmp42_;
		GeeBidirIterator* _tmp43_;
		gpointer _tmp44_;
		gchar* _tmp45_;
		gchar** _tmp46_;
		gint _tmp46__length1;
		const gchar* _tmp47_;
		GeeBidirIterator* _tmp48_;
		GeeBidirIterator* _tmp49_;
		GeeBidirIterator* _tmp50_;
		gpointer _tmp51_;
		gchar* _tmp52_;
		gchar** _tmp53_;
		gint _tmp53__length1;
		const gchar* _tmp54_;
		GeeBidirIterator* _tmp55_;
		GeeBidirIterator* _tmp56_;
		GeeBidirIterator* _tmp57_;
		SortedSetTestsSubSetTestsType _tmp58_;
		GeeBidirIterator* _tmp61_;
		GeeBidirIterator* _tmp62_;
		gpointer _tmp63_;
		gchar* _tmp64_;
		gchar** _tmp65_;
		gint _tmp65__length1;
		const gchar* _tmp66_;
		_tmp35_ = iter;
		_vala_assert (gee_bidir_iterator_last (_tmp35_), "iter.last ()");
		_tmp36_ = iter;
		_tmp37_ = gee_iterator_get ((GeeIterator*) _tmp36_);
		_tmp38_ = (gchar*) _tmp37_;
		_tmp39_ = contains;
		_tmp39__length1 = contains_length1;
		_tmp40_ = contains;
		_tmp40__length1 = contains_length1;
		_tmp41_ = _tmp39_[_tmp40__length1 - 1];
		_vala_assert (g_strcmp0 (_tmp38_, _tmp41_) == 0, "iter.get () == contains[contains.length - 1]");
		_g_free0 (_tmp38_);
		_tmp42_ = iter;
		_vala_assert (gee_bidir_iterator_first (_tmp42_), "iter.first ()");
		_tmp43_ = iter;
		_tmp44_ = gee_iterator_get ((GeeIterator*) _tmp43_);
		_tmp45_ = (gchar*) _tmp44_;
		_tmp46_ = contains;
		_tmp46__length1 = contains_length1;
		_tmp47_ = _tmp46_[0];
		_vala_assert (g_strcmp0 (_tmp45_, _tmp47_) == 0, "iter.get () == contains[0]");
		_g_free0 (_tmp45_);
		_tmp48_ = iter;
		_vala_assert (gee_iterator_has_next ((GeeIterator*) _tmp48_), "iter.has_next ()");
		_tmp49_ = iter;
		_vala_assert (gee_iterator_next ((GeeIterator*) _tmp49_), "iter.next ()");
		_tmp50_ = iter;
		_tmp51_ = gee_iterator_get ((GeeIterator*) _tmp50_);
		_tmp52_ = (gchar*) _tmp51_;
		_tmp53_ = contains;
		_tmp53__length1 = contains_length1;
		_tmp54_ = _tmp53_[1];
		_vala_assert (g_strcmp0 (_tmp52_, _tmp54_) == 0, "iter.get () == contains[1]");
		_g_free0 (_tmp52_);
		_tmp55_ = iter;
		_vala_assert (gee_bidir_iterator_has_previous (_tmp55_), "iter.has_previous ()");
		_tmp56_ = iter;
		gee_iterator_remove ((GeeIterator*) _tmp56_);
		_tmp57_ = iter;
		_vala_assert (gee_bidir_iterator_has_previous (_tmp57_), "iter.has_previous ()");
		_tmp58_ = self->priv->type;
		if (_tmp58_ != SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD) {
			GeeBidirIterator* _tmp59_;
			_tmp59_ = iter;
			_vala_assert (gee_iterator_has_next ((GeeIterator*) _tmp59_), "iter.has_next ()");
		} else {
			GeeBidirIterator* _tmp60_;
			_tmp60_ = iter;
			_vala_assert (!gee_iterator_has_next ((GeeIterator*) _tmp60_), "!iter.has_next ()");
		}
		_tmp61_ = iter;
		_vala_assert (gee_bidir_iterator_previous (_tmp61_), "iter.previous ()");
		_tmp62_ = iter;
		_tmp63_ = gee_iterator_get ((GeeIterator*) _tmp62_);
		_tmp64_ = (gchar*) _tmp63_;
		_tmp65_ = contains;
		_tmp65__length1 = contains_length1;
		_tmp66_ = _tmp65_[0];
		_vala_assert (g_strcmp0 (_tmp64_, _tmp66_) == 0, "iter.get () == contains[0]");
		_g_free0 (_tmp64_);
	} else {
		GeeBidirIterator* _tmp67_;
		_tmp67_ = iter;
		_vala_assert (!gee_bidir_iterator_first (_tmp67_), "!iter.first ()");
		if (g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR)) {
			GeeBidirIterator* _tmp68_;
			_tmp68_ = iter;
			gee_iterator_remove ((GeeIterator*) _tmp68_);
			exit (0);
		}
		g_test_trap_assert_failed ();
	}
	_g_object_unref0 (iter);
	contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL);
}

static void
bidir_sorted_set_tests_bidir_sub_set_tests_class_init (BidirSortedSetTestsBidirSubSetTestsClass * klass,
                                                       gpointer klass_data)
{
	bidir_sorted_set_tests_bidir_sub_set_tests_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &BidirSortedSetTestsBidirSubSetTests_private_offset);
	((GeeTestCaseClass *) klass)->set_up = (void (*) (GeeTestCase*)) bidir_sorted_set_tests_bidir_sub_set_tests_real_set_up;
	((GeeTestCaseClass *) klass)->tear_down = (void (*) (GeeTestCase*)) bidir_sorted_set_tests_bidir_sub_set_tests_real_tear_down;
	G_OBJECT_CLASS (klass)->finalize = bidir_sorted_set_tests_bidir_sub_set_tests_finalize;
}

static void
bidir_sorted_set_tests_bidir_sub_set_tests_instance_init (BidirSortedSetTestsBidirSubSetTests * self,
                                                          gpointer klass)
{
	self->priv = bidir_sorted_set_tests_bidir_sub_set_tests_get_instance_private (self);
}

static void
bidir_sorted_set_tests_bidir_sub_set_tests_finalize (GObject * obj)
{
	BidirSortedSetTestsBidirSubSetTests * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BIDIR_SORTED_SET_TESTS_TYPE_BIDIR_SUB_SET_TESTS, BidirSortedSetTestsBidirSubSetTests);
	_g_object_unref0 (self->priv->master);
	_g_object_unref0 (self->priv->subset);
	_g_object_unref0 (self->priv->test);
	G_OBJECT_CLASS (bidir_sorted_set_tests_bidir_sub_set_tests_parent_class)->finalize (obj);
}

static GType
bidir_sorted_set_tests_bidir_sub_set_tests_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BidirSortedSetTestsBidirSubSetTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) bidir_sorted_set_tests_bidir_sub_set_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BidirSortedSetTestsBidirSubSetTests), 0, (GInstanceInitFunc) bidir_sorted_set_tests_bidir_sub_set_tests_instance_init, NULL };
	GType bidir_sorted_set_tests_bidir_sub_set_tests_type_id;
	bidir_sorted_set_tests_bidir_sub_set_tests_type_id = g_type_register_static (GEE_TYPE_TEST_CASE, "BidirSortedSetTestsBidirSubSetTests", &g_define_type_info, 0);
	BidirSortedSetTestsBidirSubSetTests_private_offset = g_type_add_instance_private (bidir_sorted_set_tests_bidir_sub_set_tests_type_id, sizeof (BidirSortedSetTestsBidirSubSetTestsPrivate));
	return bidir_sorted_set_tests_bidir_sub_set_tests_type_id;
}

GType
bidir_sorted_set_tests_bidir_sub_set_tests_get_type (void)
{
	static volatile gsize bidir_sorted_set_tests_bidir_sub_set_tests_type_id__volatile = 0;
	if (g_once_init_enter (&bidir_sorted_set_tests_bidir_sub_set_tests_type_id__volatile)) {
		GType bidir_sorted_set_tests_bidir_sub_set_tests_type_id;
		bidir_sorted_set_tests_bidir_sub_set_tests_type_id = bidir_sorted_set_tests_bidir_sub_set_tests_get_type_once ();
		g_once_init_leave (&bidir_sorted_set_tests_bidir_sub_set_tests_type_id__volatile, bidir_sorted_set_tests_bidir_sub_set_tests_type_id);
	}
	return bidir_sorted_set_tests_bidir_sub_set_tests_type_id__volatile;
}

static void
bidir_sorted_set_tests_class_init (BidirSortedSetTestsClass * klass,
                                   gpointer klass_data)
{
	bidir_sorted_set_tests_parent_class = g_type_class_peek_parent (klass);
}

static void
bidir_sorted_set_tests_instance_init (BidirSortedSetTests * self,
                                      gpointer klass)
{
}

static GType
bidir_sorted_set_tests_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BidirSortedSetTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) bidir_sorted_set_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BidirSortedSetTests), 0, (GInstanceInitFunc) bidir_sorted_set_tests_instance_init, NULL };
	GType bidir_sorted_set_tests_type_id;
	bidir_sorted_set_tests_type_id = g_type_register_static (TYPE_SORTED_SET_TESTS, "BidirSortedSetTests", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	return bidir_sorted_set_tests_type_id;
}

GType
bidir_sorted_set_tests_get_type (void)
{
	static volatile gsize bidir_sorted_set_tests_type_id__volatile = 0;
	if (g_once_init_enter (&bidir_sorted_set_tests_type_id__volatile)) {
		GType bidir_sorted_set_tests_type_id;
		bidir_sorted_set_tests_type_id = bidir_sorted_set_tests_get_type_once ();
		g_once_init_leave (&bidir_sorted_set_tests_type_id__volatile, bidir_sorted_set_tests_type_id);
	}
	return bidir_sorted_set_tests_type_id__volatile;
}

static void
_vala_array_destroy (gpointer array,
                     gint array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gint 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);
}

