1 /* testbidirsortedset.c generated by valac 0.18.0, the Vala compiler
2 * generated from testbidirsortedset.vala, do not modify */
4 /* testbidirsortedset.vala
6 * Copyright (C) 2012 Maciej Piechotka
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 * Maciej Piechotka <uzytkownik2@gmail.com>
27 #include <glib-object.h>
33 #define GEE_TYPE_TEST_CASE (gee_test_case_get_type ())
34 #define GEE_TEST_CASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TEST_CASE, GeeTestCase))
35 #define GEE_TEST_CASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TEST_CASE, GeeTestCaseClass))
36 #define GEE_IS_TEST_CASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TEST_CASE))
37 #define GEE_IS_TEST_CASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_TEST_CASE))
38 #define GEE_TEST_CASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_TEST_CASE, GeeTestCaseClass))
40 typedef struct _GeeTestCase GeeTestCase;
41 typedef struct _GeeTestCaseClass GeeTestCaseClass;
42 typedef struct _GeeTestCasePrivate GeeTestCasePrivate;
44 #define TYPE_COLLECTION_TESTS (collection_tests_get_type ())
45 #define COLLECTION_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_COLLECTION_TESTS, CollectionTests))
46 #define COLLECTION_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_COLLECTION_TESTS, CollectionTestsClass))
47 #define IS_COLLECTION_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_COLLECTION_TESTS))
48 #define IS_COLLECTION_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_COLLECTION_TESTS))
49 #define COLLECTION_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_COLLECTION_TESTS, CollectionTestsClass))
51 typedef struct _CollectionTests CollectionTests;
52 typedef struct _CollectionTestsClass CollectionTestsClass;
53 typedef struct _CollectionTestsPrivate CollectionTestsPrivate;
55 #define TYPE_SET_TESTS (set_tests_get_type ())
56 #define SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SET_TESTS, SetTests))
57 #define SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SET_TESTS, SetTestsClass))
58 #define IS_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SET_TESTS))
59 #define IS_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SET_TESTS))
60 #define SET_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SET_TESTS, SetTestsClass))
62 typedef struct _SetTests SetTests;
63 typedef struct _SetTestsClass SetTestsClass;
64 typedef struct _SetTestsPrivate SetTestsPrivate;
66 #define TYPE_SORTED_SET_TESTS (sorted_set_tests_get_type ())
67 #define SORTED_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SORTED_SET_TESTS, SortedSetTests))
68 #define SORTED_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SORTED_SET_TESTS, SortedSetTestsClass))
69 #define IS_SORTED_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SORTED_SET_TESTS))
70 #define IS_SORTED_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SORTED_SET_TESTS))
71 #define SORTED_SET_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SORTED_SET_TESTS, SortedSetTestsClass))
73 typedef struct _SortedSetTests SortedSetTests;
74 typedef struct _SortedSetTestsClass SortedSetTestsClass;
75 typedef struct _SortedSetTestsPrivate SortedSetTestsPrivate;
77 #define TYPE_BIDIR_SORTED_SET_TESTS (bidir_sorted_set_tests_get_type ())
78 #define BIDIR_SORTED_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BIDIR_SORTED_SET_TESTS, BidirSortedSetTests))
79 #define BIDIR_SORTED_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BIDIR_SORTED_SET_TESTS, BidirSortedSetTestsClass))
80 #define IS_BIDIR_SORTED_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BIDIR_SORTED_SET_TESTS))
81 #define IS_BIDIR_SORTED_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BIDIR_SORTED_SET_TESTS))
82 #define BIDIR_SORTED_SET_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BIDIR_SORTED_SET_TESTS, BidirSortedSetTestsClass))
84 typedef struct _BidirSortedSetTests BidirSortedSetTests;
85 typedef struct _BidirSortedSetTestsClass BidirSortedSetTestsClass;
86 typedef struct _BidirSortedSetTestsPrivate BidirSortedSetTestsPrivate;
88 #define SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TYPE (sorted_set_tests_sub_set_tests_type_get_type ())
90 #define BIDIR_SORTED_SET_TESTS_TYPE_BIDIR_SUB_SET_TESTS (bidir_sorted_set_tests_bidir_sub_set_tests_get_type ())
91 #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))
92 #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))
93 #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))
94 #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))
95 #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))
97 typedef struct _BidirSortedSetTestsBidirSubSetTests BidirSortedSetTestsBidirSubSetTests;
98 typedef struct _BidirSortedSetTestsBidirSubSetTestsClass BidirSortedSetTestsBidirSubSetTestsClass;
99 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
100 #define _g_free0(var) (var = (g_free (var), NULL))
101 typedef struct _BidirSortedSetTestsBidirSubSetTestsPrivate BidirSortedSetTestsBidirSubSetTestsPrivate;
102 #define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
104 struct _GeeTestCase {
105 GObject parent_instance;
106 GeeTestCasePrivate * priv;
109 struct _GeeTestCaseClass {
110 GObjectClass parent_class;
111 void (*set_up) (GeeTestCase* self);
112 void (*tear_down) (GeeTestCase* self);
115 struct _CollectionTests {
116 GeeTestCase parent_instance;
117 CollectionTestsPrivate * priv;
118 GeeCollection* test_collection;
121 struct _CollectionTestsClass {
122 GeeTestCaseClass parent_class;
126 CollectionTests parent_instance;
127 SetTestsPrivate * priv;
130 struct _SetTestsClass {
131 CollectionTestsClass parent_class;
132 void (*test_duplicates_are_ignored) (SetTests* self);
135 struct _SortedSetTests {
136 SetTests parent_instance;
137 SortedSetTestsPrivate * priv;
140 struct _SortedSetTestsClass {
141 SetTestsClass parent_class;
144 struct _BidirSortedSetTests {
145 SortedSetTests parent_instance;
146 BidirSortedSetTestsPrivate * priv;
149 struct _BidirSortedSetTestsClass {
150 SortedSetTestsClass parent_class;
153 typedef void (*GeeTestCaseTestMethod) (void* user_data);
155 SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD,
156 SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TAIL,
157 SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_SUB,
158 SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY
159 } SortedSetTestsSubSetTestsType;
161 struct _BidirSortedSetTestsBidirSubSetTests {
162 GeeTestCase parent_instance;
163 BidirSortedSetTestsBidirSubSetTestsPrivate * priv;
166 struct _BidirSortedSetTestsBidirSubSetTestsClass {
167 GeeTestCaseClass parent_class;
170 struct _BidirSortedSetTestsBidirSubSetTestsPrivate {
171 GeeBidirSortedSet* master;
172 GeeBidirSortedSet* subset;
173 BidirSortedSetTests* test;
174 SortedSetTestsSubSetTestsType type;
178 static gpointer bidir_sorted_set_tests_parent_class = NULL;
179 static gpointer bidir_sorted_set_tests_bidir_sub_set_tests_parent_class = NULL;
181 GType gee_test_case_get_type (void) G_GNUC_CONST;
182 GType collection_tests_get_type (void) G_GNUC_CONST;
183 GType set_tests_get_type (void) G_GNUC_CONST;
184 GType sorted_set_tests_get_type (void) G_GNUC_CONST;
185 GType bidir_sorted_set_tests_get_type (void) G_GNUC_CONST;
187 BIDIR_SORTED_SET_TESTS_DUMMY_PROPERTY
189 BidirSortedSetTests* bidir_sorted_set_tests_construct (GType object_type, const gchar* name);
190 SortedSetTests* sorted_set_tests_construct (GType object_type, const gchar* name, gboolean strict);
191 void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify);
192 void bidir_sorted_set_tests_test_bidir_iterator_can_go_backward (BidirSortedSetTests* self);
193 static void _bidir_sorted_set_tests_test_bidir_iterator_can_go_backward_gee_test_case_test_method (gpointer self);
194 void bidir_sorted_set_tests_test_mutable_bidir_iterator (BidirSortedSetTests* self);
195 static void _bidir_sorted_set_tests_test_mutable_bidir_iterator_gee_test_case_test_method (gpointer self);
196 void bidir_sorted_set_tests_test_bidir_iterator_first (BidirSortedSetTests* self);
197 static void _bidir_sorted_set_tests_test_bidir_iterator_first_gee_test_case_test_method (gpointer self);
198 void bidir_sorted_set_tests_test_bidir_iterator_last (BidirSortedSetTests* self);
199 static void _bidir_sorted_set_tests_test_bidir_iterator_last_gee_test_case_test_method (gpointer self);
200 GTestSuite* gee_test_case_get_suite (GeeTestCase* self);
201 GType sorted_set_tests_sub_set_tests_type_get_type (void) G_GNUC_CONST;
202 BidirSortedSetTestsBidirSubSetTests* bidir_sorted_set_tests_bidir_sub_set_tests_new (BidirSortedSetTests* test, SortedSetTestsSubSetTestsType type);
203 BidirSortedSetTestsBidirSubSetTests* bidir_sorted_set_tests_bidir_sub_set_tests_construct (GType object_type, BidirSortedSetTests* test, SortedSetTestsSubSetTestsType type);
204 GType bidir_sorted_set_tests_bidir_sub_set_tests_get_type (void) G_GNUC_CONST;
205 #define BIDIR_SORTED_SET_TESTS_BIDIR_SUB_SET_TESTS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BIDIR_SORTED_SET_TESTS_TYPE_BIDIR_SUB_SET_TESTS, BidirSortedSetTestsBidirSubSetTestsPrivate))
207 BIDIR_SORTED_SET_TESTS_BIDIR_SUB_SET_TESTS_DUMMY_PROPERTY
209 const gchar* sorted_set_tests_sub_set_tests_type_to_string (SortedSetTestsSubSetTestsType self);
210 GeeTestCase* gee_test_case_construct (GType object_type, const gchar* name);
211 void bidir_sorted_set_tests_bidir_sub_set_tests_test_bidir_iterator (BidirSortedSetTestsBidirSubSetTests* self);
212 static void _bidir_sorted_set_tests_bidir_sub_set_tests_test_bidir_iterator_gee_test_case_test_method (gpointer self);
213 static void bidir_sorted_set_tests_bidir_sub_set_tests_real_set_up (GeeTestCase* base);
214 void gee_test_case_set_up (GeeTestCase* self);
215 static void bidir_sorted_set_tests_bidir_sub_set_tests_real_tear_down (GeeTestCase* base);
216 void gee_test_case_tear_down (GeeTestCase* self);
217 static void bidir_sorted_set_tests_bidir_sub_set_tests_finalize (GObject* obj);
218 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
219 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
222 static void _bidir_sorted_set_tests_test_bidir_iterator_can_go_backward_gee_test_case_test_method (gpointer self) {
223 bidir_sorted_set_tests_test_bidir_iterator_can_go_backward (self);
227 static void _bidir_sorted_set_tests_test_mutable_bidir_iterator_gee_test_case_test_method (gpointer self) {
228 bidir_sorted_set_tests_test_mutable_bidir_iterator (self);
232 static void _bidir_sorted_set_tests_test_bidir_iterator_first_gee_test_case_test_method (gpointer self) {
233 bidir_sorted_set_tests_test_bidir_iterator_first (self);
237 static void _bidir_sorted_set_tests_test_bidir_iterator_last_gee_test_case_test_method (gpointer self) {
238 bidir_sorted_set_tests_test_bidir_iterator_last (self);
242 BidirSortedSetTests* bidir_sorted_set_tests_construct (GType object_type, const gchar* name) {
243 BidirSortedSetTests * self = NULL;
245 GTestSuite* _tmp1_ = NULL;
246 BidirSortedSetTestsBidirSubSetTests* _tmp2_;
247 BidirSortedSetTestsBidirSubSetTests* _tmp3_;
248 GTestSuite* _tmp4_ = NULL;
249 GTestSuite* _tmp5_ = NULL;
250 BidirSortedSetTestsBidirSubSetTests* _tmp6_;
251 BidirSortedSetTestsBidirSubSetTests* _tmp7_;
252 GTestSuite* _tmp8_ = NULL;
253 GTestSuite* _tmp9_ = NULL;
254 BidirSortedSetTestsBidirSubSetTests* _tmp10_;
255 BidirSortedSetTestsBidirSubSetTests* _tmp11_;
256 GTestSuite* _tmp12_ = NULL;
257 GTestSuite* _tmp13_ = NULL;
258 BidirSortedSetTestsBidirSubSetTests* _tmp14_;
259 BidirSortedSetTestsBidirSubSetTests* _tmp15_;
260 GTestSuite* _tmp16_ = NULL;
261 g_return_val_if_fail (name != NULL, NULL);
263 self = (BidirSortedSetTests*) sorted_set_tests_construct (object_type, _tmp0_, TRUE);
264 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);
265 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);
266 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);
267 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);
268 _tmp1_ = gee_test_case_get_suite ((GeeTestCase*) self);
269 _tmp2_ = bidir_sorted_set_tests_bidir_sub_set_tests_new (self, SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD);
271 _tmp4_ = gee_test_case_get_suite ((GeeTestCase*) _tmp3_);
272 g_test_suite_add_suite (_tmp1_, _tmp4_);
273 _g_object_unref0 (_tmp3_);
274 _tmp5_ = gee_test_case_get_suite ((GeeTestCase*) self);
275 _tmp6_ = bidir_sorted_set_tests_bidir_sub_set_tests_new (self, SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TAIL);
277 _tmp8_ = gee_test_case_get_suite ((GeeTestCase*) _tmp7_);
278 g_test_suite_add_suite (_tmp5_, _tmp8_);
279 _g_object_unref0 (_tmp7_);
280 _tmp9_ = gee_test_case_get_suite ((GeeTestCase*) self);
281 _tmp10_ = bidir_sorted_set_tests_bidir_sub_set_tests_new (self, SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_SUB);
283 _tmp12_ = gee_test_case_get_suite ((GeeTestCase*) _tmp11_);
284 g_test_suite_add_suite (_tmp9_, _tmp12_);
285 _g_object_unref0 (_tmp11_);
286 _tmp13_ = gee_test_case_get_suite ((GeeTestCase*) self);
287 _tmp14_ = bidir_sorted_set_tests_bidir_sub_set_tests_new (self, SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY);
289 _tmp16_ = gee_test_case_get_suite ((GeeTestCase*) _tmp15_);
290 g_test_suite_add_suite (_tmp13_, _tmp16_);
291 _g_object_unref0 (_tmp15_);
296 static gpointer _g_object_ref0 (gpointer self) {
297 return self ? g_object_ref (self) : NULL;
301 void bidir_sorted_set_tests_test_bidir_iterator_can_go_backward (BidirSortedSetTests* self) {
302 GeeCollection* _tmp0_;
303 GeeBidirSortedSet* _tmp1_;
304 GeeBidirSortedSet* test_set;
305 GeeBidirIterator* _tmp2_ = NULL;
306 GeeBidirIterator* iterator;
307 GeeBidirIterator* _tmp3_;
308 gboolean _tmp4_ = FALSE;
309 gboolean _tmp5_ = FALSE;
310 gboolean _tmp6_ = FALSE;
311 gboolean _tmp7_ = FALSE;
312 gboolean _tmp8_ = FALSE;
313 gboolean _tmp9_ = FALSE;
314 gboolean _tmp10_ = FALSE;
315 GeeBidirIterator* _tmp11_ = NULL;
316 GeeBidirIterator* _tmp12_;
317 gboolean _tmp13_ = FALSE;
318 GeeBidirIterator* _tmp14_;
319 gpointer _tmp15_ = NULL;
321 GeeBidirIterator* _tmp17_;
322 gboolean _tmp18_ = FALSE;
323 GeeBidirIterator* _tmp19_;
324 gboolean _tmp20_ = FALSE;
325 GeeBidirIterator* _tmp21_;
326 gpointer _tmp22_ = NULL;
328 GeeBidirIterator* _tmp24_;
329 gboolean _tmp25_ = FALSE;
330 GeeBidirIterator* _tmp26_;
331 gboolean _tmp27_ = FALSE;
332 GeeBidirIterator* _tmp28_;
333 gpointer _tmp29_ = NULL;
335 GeeBidirIterator* _tmp31_;
336 gboolean _tmp32_ = FALSE;
337 GeeBidirIterator* _tmp33_;
338 gboolean _tmp34_ = FALSE;
339 GeeBidirIterator* _tmp35_;
340 gpointer _tmp36_ = NULL;
342 GeeBidirIterator* _tmp38_;
343 gboolean _tmp39_ = FALSE;
344 GeeBidirIterator* _tmp40_;
345 gboolean _tmp41_ = FALSE;
346 GeeBidirIterator* _tmp42_;
347 gpointer _tmp43_ = NULL;
349 GeeBidirIterator* _tmp45_;
350 gboolean _tmp46_ = FALSE;
351 GeeBidirIterator* _tmp47_;
352 gboolean _tmp48_ = FALSE;
353 GeeBidirIterator* _tmp49_;
354 gpointer _tmp50_ = NULL;
356 GeeBidirIterator* _tmp52_;
357 gboolean _tmp53_ = FALSE;
358 GeeBidirIterator* _tmp54_;
359 gboolean _tmp55_ = FALSE;
360 GeeBidirIterator* _tmp56_;
361 gboolean _tmp57_ = FALSE;
362 GeeBidirIterator* _tmp58_;
363 gpointer _tmp59_ = NULL;
365 GeeBidirIterator* _tmp61_;
366 gboolean _tmp62_ = FALSE;
367 GeeBidirIterator* _tmp63_;
368 gpointer _tmp64_ = NULL;
370 GeeBidirIterator* _tmp66_;
371 gboolean _tmp67_ = FALSE;
372 GeeBidirIterator* _tmp68_;
373 gpointer _tmp69_ = NULL;
375 GeeBidirIterator* _tmp71_;
376 gboolean _tmp72_ = FALSE;
377 GeeBidirIterator* _tmp73_;
378 gpointer _tmp74_ = NULL;
380 GeeBidirIterator* _tmp76_;
381 gboolean _tmp77_ = FALSE;
382 GeeBidirIterator* _tmp78_;
383 gpointer _tmp79_ = NULL;
385 GeeBidirIterator* _tmp81_;
386 gboolean _tmp82_ = FALSE;
387 GeeBidirIterator* _tmp83_;
388 gpointer _tmp84_ = NULL;
390 g_return_if_fail (self != NULL);
391 _tmp0_ = ((CollectionTests*) self)->test_collection;
392 _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp0_) : NULL);
394 _tmp2_ = gee_bidir_sorted_set_bidir_iterator (test_set);
397 _tmp4_ = gee_bidir_iterator_has_previous (_tmp3_);
398 _vala_assert (!_tmp4_, "!iterator.has_previous ()");
399 _tmp5_ = gee_collection_add ((GeeCollection*) test_set, "one");
400 _vala_assert (_tmp5_, "test_set.add (\"one\")");
401 _tmp6_ = gee_collection_add ((GeeCollection*) test_set, "two");
402 _vala_assert (_tmp6_, "test_set.add (\"two\")");
403 _tmp7_ = gee_collection_add ((GeeCollection*) test_set, "three");
404 _vala_assert (_tmp7_, "test_set.add (\"three\")");
405 _tmp8_ = gee_collection_add ((GeeCollection*) test_set, "four");
406 _vala_assert (_tmp8_, "test_set.add (\"four\")");
407 _tmp9_ = gee_collection_add ((GeeCollection*) test_set, "five");
408 _vala_assert (_tmp9_, "test_set.add (\"five\")");
409 _tmp10_ = gee_collection_add ((GeeCollection*) test_set, "six");
410 _vala_assert (_tmp10_, "test_set.add (\"six\")");
411 _tmp11_ = gee_bidir_sorted_set_bidir_iterator (test_set);
412 _g_object_unref0 (iterator);
415 _tmp13_ = gee_iterator_next ((GeeIterator*) _tmp12_);
416 _vala_assert (_tmp13_, "iterator.next ()");
418 _tmp15_ = gee_iterator_get ((GeeIterator*) _tmp14_);
419 _tmp16_ = (gchar*) _tmp15_;
420 _vala_assert (g_strcmp0 (_tmp16_, "five") == 0, "iterator.get () == \"five\"");
423 _tmp18_ = gee_bidir_iterator_has_previous (_tmp17_);
424 _vala_assert (!_tmp18_, "!iterator.has_previous ()");
426 _tmp20_ = gee_iterator_next ((GeeIterator*) _tmp19_);
427 _vala_assert (_tmp20_, "iterator.next ()");
429 _tmp22_ = gee_iterator_get ((GeeIterator*) _tmp21_);
430 _tmp23_ = (gchar*) _tmp22_;
431 _vala_assert (g_strcmp0 (_tmp23_, "four") == 0, "iterator.get () == \"four\"");
434 _tmp25_ = gee_bidir_iterator_has_previous (_tmp24_);
435 _vala_assert (_tmp25_, "iterator.has_previous ()");
437 _tmp27_ = gee_iterator_next ((GeeIterator*) _tmp26_);
438 _vala_assert (_tmp27_, "iterator.next ()");
440 _tmp29_ = gee_iterator_get ((GeeIterator*) _tmp28_);
441 _tmp30_ = (gchar*) _tmp29_;
442 _vala_assert (g_strcmp0 (_tmp30_, "one") == 0, "iterator.get () == \"one\"");
445 _tmp32_ = gee_bidir_iterator_has_previous (_tmp31_);
446 _vala_assert (_tmp32_, "iterator.has_previous ()");
448 _tmp34_ = gee_iterator_next ((GeeIterator*) _tmp33_);
449 _vala_assert (_tmp34_, "iterator.next ()");
451 _tmp36_ = gee_iterator_get ((GeeIterator*) _tmp35_);
452 _tmp37_ = (gchar*) _tmp36_;
453 _vala_assert (g_strcmp0 (_tmp37_, "six") == 0, "iterator.get () == \"six\"");
456 _tmp39_ = gee_bidir_iterator_has_previous (_tmp38_);
457 _vala_assert (_tmp39_, "iterator.has_previous ()");
459 _tmp41_ = gee_iterator_next ((GeeIterator*) _tmp40_);
460 _vala_assert (_tmp41_, "iterator.next ()");
462 _tmp43_ = gee_iterator_get ((GeeIterator*) _tmp42_);
463 _tmp44_ = (gchar*) _tmp43_;
464 _vala_assert (g_strcmp0 (_tmp44_, "three") == 0, "iterator.get () == \"three\"");
467 _tmp46_ = gee_bidir_iterator_has_previous (_tmp45_);
468 _vala_assert (_tmp46_, "iterator.has_previous ()");
470 _tmp48_ = gee_iterator_next ((GeeIterator*) _tmp47_);
471 _vala_assert (_tmp48_, "iterator.next ()");
473 _tmp50_ = gee_iterator_get ((GeeIterator*) _tmp49_);
474 _tmp51_ = (gchar*) _tmp50_;
475 _vala_assert (g_strcmp0 (_tmp51_, "two") == 0, "iterator.get () == \"two\"");
478 _tmp53_ = gee_bidir_iterator_has_previous (_tmp52_);
479 _vala_assert (_tmp53_, "iterator.has_previous ()");
481 _tmp55_ = gee_iterator_next ((GeeIterator*) _tmp54_);
482 _vala_assert (!_tmp55_, "!iterator.next ()");
484 _tmp57_ = gee_bidir_iterator_previous (_tmp56_);
485 _vala_assert (_tmp57_, "iterator.previous ()");
487 _tmp59_ = gee_iterator_get ((GeeIterator*) _tmp58_);
488 _tmp60_ = (gchar*) _tmp59_;
489 _vala_assert (g_strcmp0 (_tmp60_, "three") == 0, "iterator.get () == \"three\"");
492 _tmp62_ = gee_bidir_iterator_previous (_tmp61_);
493 _vala_assert (_tmp62_, "iterator.previous ()");
495 _tmp64_ = gee_iterator_get ((GeeIterator*) _tmp63_);
496 _tmp65_ = (gchar*) _tmp64_;
497 _vala_assert (g_strcmp0 (_tmp65_, "six") == 0, "iterator.get () == \"six\"");
500 _tmp67_ = gee_bidir_iterator_previous (_tmp66_);
501 _vala_assert (_tmp67_, "iterator.previous ()");
503 _tmp69_ = gee_iterator_get ((GeeIterator*) _tmp68_);
504 _tmp70_ = (gchar*) _tmp69_;
505 _vala_assert (g_strcmp0 (_tmp70_, "one") == 0, "iterator.get () == \"one\"");
508 _tmp72_ = gee_bidir_iterator_previous (_tmp71_);
509 _vala_assert (_tmp72_, "iterator.previous ()");
511 _tmp74_ = gee_iterator_get ((GeeIterator*) _tmp73_);
512 _tmp75_ = (gchar*) _tmp74_;
513 _vala_assert (g_strcmp0 (_tmp75_, "four") == 0, "iterator.get () == \"four\"");
516 _tmp77_ = gee_bidir_iterator_previous (_tmp76_);
517 _vala_assert (_tmp77_, "iterator.previous ()");
519 _tmp79_ = gee_iterator_get ((GeeIterator*) _tmp78_);
520 _tmp80_ = (gchar*) _tmp79_;
521 _vala_assert (g_strcmp0 (_tmp80_, "five") == 0, "iterator.get () == \"five\"");
524 _tmp82_ = gee_bidir_iterator_previous (_tmp81_);
525 _vala_assert (!_tmp82_, "!iterator.previous ()");
527 _tmp84_ = gee_iterator_get ((GeeIterator*) _tmp83_);
528 _tmp85_ = (gchar*) _tmp84_;
529 _vala_assert (g_strcmp0 (_tmp85_, "five") == 0, "iterator.get () == \"five\"");
531 _g_object_unref0 (iterator);
532 _g_object_unref0 (test_set);
536 void bidir_sorted_set_tests_test_bidir_iterator_first (BidirSortedSetTests* self) {
537 GeeCollection* _tmp0_;
538 GeeBidirSortedSet* _tmp1_;
539 GeeBidirSortedSet* test_set;
540 GeeBidirIterator* _tmp2_ = NULL;
541 GeeBidirIterator* iterator;
542 GeeBidirIterator* _tmp3_;
543 gboolean _tmp4_ = FALSE;
544 gboolean _tmp5_ = FALSE;
545 gboolean _tmp6_ = FALSE;
546 gboolean _tmp7_ = FALSE;
547 gboolean _tmp8_ = FALSE;
548 gboolean _tmp9_ = FALSE;
549 gboolean _tmp10_ = FALSE;
550 GeeBidirIterator* _tmp11_ = NULL;
551 GeeBidirIterator* _tmp12_;
552 gboolean _tmp13_ = FALSE;
553 GeeBidirIterator* _tmp14_;
554 gpointer _tmp15_ = NULL;
556 GeeBidirIterator* _tmp17_;
557 gboolean _tmp18_ = FALSE;
558 GeeBidirIterator* _tmp19_;
559 gpointer _tmp20_ = NULL;
561 g_return_if_fail (self != NULL);
562 _tmp0_ = ((CollectionTests*) self)->test_collection;
563 _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp0_) : NULL);
565 _tmp2_ = gee_bidir_sorted_set_bidir_iterator (test_set);
568 _tmp4_ = gee_bidir_iterator_first (_tmp3_);
569 _vala_assert (!_tmp4_, "!iterator.first ()");
570 _tmp5_ = gee_collection_add ((GeeCollection*) test_set, "one");
571 _vala_assert (_tmp5_, "test_set.add (\"one\")");
572 _tmp6_ = gee_collection_add ((GeeCollection*) test_set, "two");
573 _vala_assert (_tmp6_, "test_set.add (\"two\")");
574 _tmp7_ = gee_collection_add ((GeeCollection*) test_set, "three");
575 _vala_assert (_tmp7_, "test_set.add (\"three\")");
576 _tmp8_ = gee_collection_add ((GeeCollection*) test_set, "four");
577 _vala_assert (_tmp8_, "test_set.add (\"four\")");
578 _tmp9_ = gee_collection_add ((GeeCollection*) test_set, "five");
579 _vala_assert (_tmp9_, "test_set.add (\"five\")");
580 _tmp10_ = gee_collection_add ((GeeCollection*) test_set, "six");
581 _vala_assert (_tmp10_, "test_set.add (\"six\")");
582 _tmp11_ = gee_bidir_sorted_set_bidir_iterator (test_set);
583 _g_object_unref0 (iterator);
586 _tmp13_ = gee_bidir_iterator_last (_tmp12_);
587 _vala_assert (_tmp13_, "iterator.last ()");
589 _tmp15_ = gee_iterator_get ((GeeIterator*) _tmp14_);
590 _tmp16_ = (gchar*) _tmp15_;
591 _vala_assert (g_strcmp0 (_tmp16_, "two") == 0, "iterator.get () == \"two\"");
594 _tmp18_ = gee_bidir_iterator_first (_tmp17_);
595 _vala_assert (_tmp18_, "iterator.first ()");
597 _tmp20_ = gee_iterator_get ((GeeIterator*) _tmp19_);
598 _tmp21_ = (gchar*) _tmp20_;
599 _vala_assert (g_strcmp0 (_tmp21_, "five") == 0, "iterator.get () == \"five\"");
601 _g_object_unref0 (iterator);
602 _g_object_unref0 (test_set);
606 void bidir_sorted_set_tests_test_bidir_iterator_last (BidirSortedSetTests* self) {
607 GeeCollection* _tmp0_;
608 GeeBidirSortedSet* _tmp1_;
609 GeeBidirSortedSet* test_set;
610 GeeBidirIterator* _tmp2_ = NULL;
611 GeeBidirIterator* iterator;
612 GeeBidirIterator* _tmp3_;
613 gboolean _tmp4_ = FALSE;
614 gboolean _tmp5_ = FALSE;
615 gboolean _tmp6_ = FALSE;
616 gboolean _tmp7_ = FALSE;
617 gboolean _tmp8_ = FALSE;
618 gboolean _tmp9_ = FALSE;
619 gboolean _tmp10_ = FALSE;
620 GeeBidirIterator* _tmp11_ = NULL;
621 GeeBidirIterator* _tmp12_;
622 gboolean _tmp13_ = FALSE;
623 GeeBidirIterator* _tmp14_;
624 gpointer _tmp15_ = NULL;
626 g_return_if_fail (self != NULL);
627 _tmp0_ = ((CollectionTests*) self)->test_collection;
628 _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp0_) : NULL);
630 _tmp2_ = gee_bidir_sorted_set_bidir_iterator (test_set);
633 _tmp4_ = gee_bidir_iterator_last (_tmp3_);
634 _vala_assert (!_tmp4_, "!iterator.last ()");
635 _tmp5_ = gee_collection_add ((GeeCollection*) test_set, "one");
636 _vala_assert (_tmp5_, "test_set.add (\"one\")");
637 _tmp6_ = gee_collection_add ((GeeCollection*) test_set, "two");
638 _vala_assert (_tmp6_, "test_set.add (\"two\")");
639 _tmp7_ = gee_collection_add ((GeeCollection*) test_set, "three");
640 _vala_assert (_tmp7_, "test_set.add (\"three\")");
641 _tmp8_ = gee_collection_add ((GeeCollection*) test_set, "four");
642 _vala_assert (_tmp8_, "test_set.add (\"four\")");
643 _tmp9_ = gee_collection_add ((GeeCollection*) test_set, "five");
644 _vala_assert (_tmp9_, "test_set.add (\"five\")");
645 _tmp10_ = gee_collection_add ((GeeCollection*) test_set, "six");
646 _vala_assert (_tmp10_, "test_set.add (\"six\")");
647 _tmp11_ = gee_bidir_sorted_set_bidir_iterator (test_set);
648 _g_object_unref0 (iterator);
651 _tmp13_ = gee_bidir_iterator_last (_tmp12_);
652 _vala_assert (_tmp13_, "iterator.last ()");
654 _tmp15_ = gee_iterator_get ((GeeIterator*) _tmp14_);
655 _tmp16_ = (gchar*) _tmp15_;
656 _vala_assert (g_strcmp0 (_tmp16_, "two") == 0, "iterator.get () == \"two\"");
658 _g_object_unref0 (iterator);
659 _g_object_unref0 (test_set);
663 void bidir_sorted_set_tests_test_mutable_bidir_iterator (BidirSortedSetTests* self) {
664 GeeCollection* _tmp0_;
665 GeeBidirSortedSet* _tmp1_;
666 GeeBidirSortedSet* test_set;
667 GeeBidirSortedSet* _tmp2_;
668 GeeBidirIterator* _tmp3_ = NULL;
669 GeeBidirIterator* iterator;
670 GeeBidirIterator* _tmp4_;
671 gboolean _tmp5_ = FALSE;
672 GeeBidirSortedSet* _tmp6_;
673 gboolean _tmp7_ = FALSE;
674 GeeBidirSortedSet* _tmp8_;
675 gboolean _tmp9_ = FALSE;
676 GeeBidirSortedSet* _tmp10_;
677 gboolean _tmp11_ = FALSE;
678 GeeBidirSortedSet* _tmp12_;
679 gboolean _tmp13_ = FALSE;
680 GeeBidirSortedSet* _tmp14_;
681 gboolean _tmp15_ = FALSE;
682 GeeBidirSortedSet* _tmp16_;
683 gboolean _tmp17_ = FALSE;
684 GeeBidirSortedSet* _tmp18_;
685 GeeBidirIterator* _tmp19_ = NULL;
686 gboolean _tmp20_ = FALSE;
687 GeeBidirIterator* _tmp22_;
688 gboolean _tmp23_ = FALSE;
689 GeeBidirIterator* _tmp24_;
690 gpointer _tmp25_ = NULL;
692 GeeBidirIterator* _tmp27_;
693 GeeBidirSortedSet* _tmp28_;
694 gboolean _tmp29_ = FALSE;
695 GeeBidirIterator* _tmp30_;
696 gboolean _tmp31_ = FALSE;
697 GeeBidirIterator* _tmp32_;
698 gboolean _tmp33_ = FALSE;
699 gboolean _tmp34_ = FALSE;
700 GeeBidirIterator* _tmp38_;
701 gboolean _tmp39_ = FALSE;
702 GeeBidirIterator* _tmp40_;
703 gboolean _tmp41_ = FALSE;
704 GeeBidirIterator* _tmp42_;
705 gpointer _tmp43_ = NULL;
707 GeeBidirIterator* _tmp45_;
708 gboolean _tmp46_ = FALSE;
709 GeeBidirIterator* _tmp47_;
710 gpointer _tmp48_ = NULL;
712 GeeBidirIterator* _tmp50_;
713 GeeBidirSortedSet* _tmp51_;
714 gboolean _tmp52_ = FALSE;
715 GeeBidirIterator* _tmp53_;
716 gboolean _tmp54_ = FALSE;
717 GeeBidirIterator* _tmp55_;
718 gboolean _tmp56_ = FALSE;
719 GeeBidirIterator* _tmp57_;
720 gboolean _tmp58_ = FALSE;
721 GeeBidirIterator* _tmp59_;
722 gpointer _tmp60_ = NULL;
724 g_return_if_fail (self != NULL);
725 _tmp0_ = ((CollectionTests*) self)->test_collection;
726 _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp0_) : NULL);
729 _tmp3_ = gee_bidir_sorted_set_bidir_iterator (_tmp2_);
732 _tmp5_ = gee_bidir_iterator_has_previous (_tmp4_);
733 _vala_assert (!_tmp5_, "!iterator.has_previous ()");
735 _tmp7_ = gee_collection_add ((GeeCollection*) _tmp6_, "one");
736 _vala_assert (_tmp7_, "test_set.add (\"one\")");
738 _tmp9_ = gee_collection_add ((GeeCollection*) _tmp8_, "two");
739 _vala_assert (_tmp9_, "test_set.add (\"two\")");
741 _tmp11_ = gee_collection_add ((GeeCollection*) _tmp10_, "three");
742 _vala_assert (_tmp11_, "test_set.add (\"three\")");
744 _tmp13_ = gee_collection_add ((GeeCollection*) _tmp12_, "four");
745 _vala_assert (_tmp13_, "test_set.add (\"four\")");
747 _tmp15_ = gee_collection_add ((GeeCollection*) _tmp14_, "five");
748 _vala_assert (_tmp15_, "test_set.add (\"five\")");
750 _tmp17_ = gee_collection_add ((GeeCollection*) _tmp16_, "six");
751 _vala_assert (_tmp17_, "test_set.add (\"six\")");
753 _tmp19_ = gee_bidir_sorted_set_bidir_iterator (_tmp18_);
754 _g_object_unref0 (iterator);
756 _tmp20_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR);
758 GeeBidirIterator* _tmp21_;
760 gee_iterator_remove ((GeeIterator*) _tmp21_);
763 g_test_trap_assert_failed ();
765 _tmp23_ = gee_iterator_next ((GeeIterator*) _tmp22_);
766 _vala_assert (_tmp23_, "iterator.next ()");
768 _tmp25_ = gee_iterator_get ((GeeIterator*) _tmp24_);
769 _tmp26_ = (gchar*) _tmp25_;
770 _vala_assert (g_strcmp0 (_tmp26_, "five") == 0, "iterator.get () == \"five\"");
773 gee_iterator_remove ((GeeIterator*) _tmp27_);
775 _tmp29_ = gee_collection_contains ((GeeCollection*) _tmp28_, "five");
776 _vala_assert (!_tmp29_, "!test_set.contains (\"five\")");
778 _tmp31_ = gee_iterator_has_next ((GeeIterator*) _tmp30_);
779 _vala_assert (_tmp31_, "iterator.has_next ()");
781 _tmp33_ = gee_bidir_iterator_has_previous (_tmp32_);
782 _vala_assert (!_tmp33_, "!iterator.has_previous ()");
783 _tmp34_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR);
785 GeeBidirIterator* _tmp35_;
786 gpointer _tmp36_ = NULL;
789 _tmp36_ = gee_iterator_get ((GeeIterator*) _tmp35_);
790 _tmp37_ = (gchar*) _tmp36_;
795 _tmp39_ = gee_bidir_iterator_previous (_tmp38_);
796 _vala_assert (!_tmp39_, "!iterator.previous ()");
798 _tmp41_ = gee_iterator_next ((GeeIterator*) _tmp40_);
799 _vala_assert (_tmp41_, "iterator.next ()");
801 _tmp43_ = gee_iterator_get ((GeeIterator*) _tmp42_);
802 _tmp44_ = (gchar*) _tmp43_;
803 _vala_assert (g_strcmp0 (_tmp44_, "four") == 0, "iterator.get () == \"four\"");
806 _tmp46_ = gee_iterator_next ((GeeIterator*) _tmp45_);
807 _vala_assert (_tmp46_, "iterator.next ()");
809 _tmp48_ = gee_iterator_get ((GeeIterator*) _tmp47_);
810 _tmp49_ = (gchar*) _tmp48_;
811 _vala_assert (g_strcmp0 (_tmp49_, "one") == 0, "iterator.get () == \"one\"");
814 gee_iterator_remove ((GeeIterator*) _tmp50_);
816 _tmp52_ = gee_collection_contains ((GeeCollection*) _tmp51_, "one");
817 _vala_assert (!_tmp52_, "!test_set.contains (\"one\")");
819 _tmp54_ = gee_iterator_has_next ((GeeIterator*) _tmp53_);
820 _vala_assert (_tmp54_, "iterator.has_next ()");
822 _tmp56_ = gee_bidir_iterator_has_previous (_tmp55_);
823 _vala_assert (_tmp56_, "iterator.has_previous ()");
825 _tmp58_ = gee_bidir_iterator_previous (_tmp57_);
826 _vala_assert (_tmp58_, "iterator.previous ()");
828 _tmp60_ = gee_iterator_get ((GeeIterator*) _tmp59_);
829 _tmp61_ = (gchar*) _tmp60_;
830 _vala_assert (g_strcmp0 (_tmp61_, "four") == 0, "iterator.get () == \"four\"");
832 _g_object_unref0 (iterator);
833 _g_object_unref0 (test_set);
837 static void _bidir_sorted_set_tests_bidir_sub_set_tests_test_bidir_iterator_gee_test_case_test_method (gpointer self) {
838 bidir_sorted_set_tests_bidir_sub_set_tests_test_bidir_iterator (self);
842 BidirSortedSetTestsBidirSubSetTests* bidir_sorted_set_tests_bidir_sub_set_tests_construct (GType object_type, BidirSortedSetTests* test, SortedSetTestsSubSetTestsType type) {
843 BidirSortedSetTestsBidirSubSetTests * self = NULL;
844 SortedSetTestsSubSetTestsType _tmp0_;
845 const gchar* _tmp1_ = NULL;
846 gchar* _tmp2_ = NULL;
848 BidirSortedSetTests* _tmp4_;
849 BidirSortedSetTests* _tmp5_;
850 SortedSetTestsSubSetTestsType _tmp6_;
851 g_return_val_if_fail (test != NULL, NULL);
853 _tmp1_ = sorted_set_tests_sub_set_tests_type_to_string (_tmp0_);
854 _tmp2_ = g_strdup_printf ("%s Subset", _tmp1_);
856 self = (BidirSortedSetTestsBidirSubSetTests*) gee_test_case_construct (object_type, _tmp3_);
859 _tmp5_ = _g_object_ref0 (_tmp4_);
860 _g_object_unref0 (self->priv->test);
861 self->priv->test = _tmp5_;
863 self->priv->type = _tmp6_;
864 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);
869 BidirSortedSetTestsBidirSubSetTests* bidir_sorted_set_tests_bidir_sub_set_tests_new (BidirSortedSetTests* test, SortedSetTestsSubSetTestsType type) {
870 return bidir_sorted_set_tests_bidir_sub_set_tests_construct (BIDIR_SORTED_SET_TESTS_TYPE_BIDIR_SUB_SET_TESTS, test, type);
874 static void bidir_sorted_set_tests_bidir_sub_set_tests_real_set_up (GeeTestCase* base) {
875 BidirSortedSetTestsBidirSubSetTests * self;
876 BidirSortedSetTests* _tmp0_;
877 BidirSortedSetTests* _tmp1_;
878 GeeCollection* _tmp2_;
879 GeeBidirSortedSet* _tmp3_;
880 SortedSetTestsSubSetTestsType _tmp4_;
881 self = (BidirSortedSetTestsBidirSubSetTests*) base;
882 _tmp0_ = self->priv->test;
883 gee_test_case_set_up ((GeeTestCase*) _tmp0_);
884 _tmp1_ = self->priv->test;
885 _tmp2_ = ((CollectionTests*) _tmp1_)->test_collection;
886 _tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp2_) : NULL);
887 _g_object_unref0 (self->priv->master);
888 self->priv->master = _tmp3_;
889 _tmp4_ = self->priv->type;
891 case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD:
893 GeeBidirSortedSet* _tmp5_;
894 GeeSortedSet* _tmp6_ = NULL;
895 _tmp5_ = self->priv->master;
896 _tmp6_ = gee_sorted_set_head_set ((GeeSortedSet*) _tmp5_, "one");
897 _g_object_unref0 (self->priv->subset);
898 self->priv->subset = G_TYPE_CHECK_INSTANCE_TYPE (_tmp6_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp6_) : NULL;
901 case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TAIL:
903 GeeBidirSortedSet* _tmp7_;
904 GeeSortedSet* _tmp8_ = NULL;
905 _tmp7_ = self->priv->master;
906 _tmp8_ = gee_sorted_set_tail_set ((GeeSortedSet*) _tmp7_, "six");
907 _g_object_unref0 (self->priv->subset);
908 self->priv->subset = G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp8_) : NULL;
911 case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_SUB:
913 GeeBidirSortedSet* _tmp9_;
914 GeeSortedSet* _tmp10_ = NULL;
915 _tmp9_ = self->priv->master;
916 _tmp10_ = gee_sorted_set_sub_set ((GeeSortedSet*) _tmp9_, "four", "three");
917 _g_object_unref0 (self->priv->subset);
918 self->priv->subset = G_TYPE_CHECK_INSTANCE_TYPE (_tmp10_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp10_) : NULL;
921 case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY:
923 GeeBidirSortedSet* _tmp11_;
924 GeeSortedSet* _tmp12_ = NULL;
925 _tmp11_ = self->priv->master;
926 _tmp12_ = gee_sorted_set_sub_set ((GeeSortedSet*) _tmp11_, "three", "four");
927 _g_object_unref0 (self->priv->subset);
928 self->priv->subset = G_TYPE_CHECK_INSTANCE_TYPE (_tmp12_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp12_) : NULL;
933 g_assert_not_reached ();
939 static void bidir_sorted_set_tests_bidir_sub_set_tests_real_tear_down (GeeTestCase* base) {
940 BidirSortedSetTestsBidirSubSetTests * self;
941 BidirSortedSetTests* _tmp0_;
942 self = (BidirSortedSetTestsBidirSubSetTests*) base;
943 _tmp0_ = self->priv->test;
944 gee_test_case_tear_down ((GeeTestCase*) _tmp0_);
948 void bidir_sorted_set_tests_bidir_sub_set_tests_test_bidir_iterator (BidirSortedSetTestsBidirSubSetTests* self) {
949 GeeBidirSortedSet* _tmp0_;
950 gboolean _tmp1_ = FALSE;
951 GeeBidirSortedSet* _tmp2_;
952 gboolean _tmp3_ = FALSE;
953 GeeBidirSortedSet* _tmp4_;
954 gboolean _tmp5_ = FALSE;
955 GeeBidirSortedSet* _tmp6_;
956 gboolean _tmp7_ = FALSE;
957 GeeBidirSortedSet* _tmp8_;
958 gboolean _tmp9_ = FALSE;
959 GeeBidirSortedSet* _tmp10_;
960 gboolean _tmp11_ = FALSE;
961 GeeBidirSortedSet* _tmp12_;
964 gchar** contains = NULL;
965 gint contains_length1 = 0;
966 gint _contains_size_ = 0;
967 SortedSetTestsSubSetTestsType _tmp15_;
971 gint _tmp39__length1;
972 GeeBidirSortedSet* _tmp40_;
973 GeeBidirIterator* _tmp41_ = NULL;
974 GeeBidirIterator* iter;
975 SortedSetTestsSubSetTestsType _tmp42_;
976 g_return_if_fail (self != NULL);
977 _tmp0_ = self->priv->master;
978 _tmp1_ = gee_collection_add ((GeeCollection*) _tmp0_, "one");
979 _vala_assert (_tmp1_, "master.add (\"one\")");
980 _tmp2_ = self->priv->master;
981 _tmp3_ = gee_collection_add ((GeeCollection*) _tmp2_, "two");
982 _vala_assert (_tmp3_, "master.add (\"two\")");
983 _tmp4_ = self->priv->master;
984 _tmp5_ = gee_collection_add ((GeeCollection*) _tmp4_, "three");
985 _vala_assert (_tmp5_, "master.add (\"three\")");
986 _tmp6_ = self->priv->master;
987 _tmp7_ = gee_collection_add ((GeeCollection*) _tmp6_, "four");
988 _vala_assert (_tmp7_, "master.add (\"four\")");
989 _tmp8_ = self->priv->master;
990 _tmp9_ = gee_collection_add ((GeeCollection*) _tmp8_, "five");
991 _vala_assert (_tmp9_, "master.add (\"five\")");
992 _tmp10_ = self->priv->master;
993 _tmp11_ = gee_collection_add ((GeeCollection*) _tmp10_, "six");
994 _vala_assert (_tmp11_, "master.add (\"six\")");
995 _tmp12_ = self->priv->master;
996 _tmp13_ = gee_collection_get_size ((GeeCollection*) _tmp12_);
998 _vala_assert (_tmp14_ == 6, "master.size == 6");
999 _tmp15_ = self->priv->type;
1001 case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD:
1005 gchar** _tmp18_ = NULL;
1006 _tmp16_ = g_strdup ("five");
1007 _tmp17_ = g_strdup ("four");
1008 _tmp18_ = g_new0 (gchar*, 2 + 1);
1009 _tmp18_[0] = _tmp16_;
1010 _tmp18_[1] = _tmp17_;
1011 contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL);
1013 contains_length1 = 2;
1014 _contains_size_ = contains_length1;
1017 case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TAIL:
1022 gchar** _tmp22_ = NULL;
1023 _tmp19_ = g_strdup ("six");
1024 _tmp20_ = g_strdup ("three");
1025 _tmp21_ = g_strdup ("two");
1026 _tmp22_ = g_new0 (gchar*, 3 + 1);
1027 _tmp22_[0] = _tmp19_;
1028 _tmp22_[1] = _tmp20_;
1029 _tmp22_[2] = _tmp21_;
1030 contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL);
1032 contains_length1 = 3;
1033 _contains_size_ = contains_length1;
1036 case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_SUB:
1041 gchar** _tmp26_ = NULL;
1042 _tmp23_ = g_strdup ("four");
1043 _tmp24_ = g_strdup ("one");
1044 _tmp25_ = g_strdup ("six");
1045 _tmp26_ = g_new0 (gchar*, 3 + 1);
1046 _tmp26_[0] = _tmp23_;
1047 _tmp26_[1] = _tmp24_;
1048 _tmp26_[2] = _tmp25_;
1049 contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL);
1051 contains_length1 = 3;
1052 _contains_size_ = contains_length1;
1055 case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY:
1057 gchar** _tmp27_ = NULL;
1058 _tmp27_ = g_new0 (gchar*, 0 + 1);
1059 contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL);
1061 contains_length1 = 0;
1062 _contains_size_ = contains_length1;
1067 g_assert_not_reached ();
1072 GeeBidirSortedSet* _tmp28_;
1073 GeeIterator* _tmp29_ = NULL;
1075 _tmp28_ = self->priv->subset;
1076 _tmp29_ = gee_iterable_iterator ((GeeIterable*) _tmp28_);
1079 GeeIterator* _tmp30_;
1080 gboolean _tmp31_ = FALSE;
1081 GeeIterator* _tmp32_;
1082 gpointer _tmp33_ = NULL;
1084 const gchar* _tmp34_;
1086 gint _tmp35__length1;
1088 const gchar* _tmp37_;
1090 _tmp31_ = gee_iterator_next (_tmp30_);
1095 _tmp33_ = gee_iterator_get (_tmp32_);
1096 e = (gchar*) _tmp33_;
1099 _tmp35__length1 = contains_length1;
1102 _tmp37_ = _tmp35_[_tmp36_];
1103 _vala_assert (g_strcmp0 (_tmp34_, _tmp37_) == 0, "e == contains[i++]");
1106 _g_object_unref0 (_e_it);
1110 _tmp39__length1 = contains_length1;
1111 _vala_assert (_tmp38_ == ((guint) _tmp39__length1), "i == contains.length");
1112 _tmp40_ = self->priv->subset;
1113 _tmp41_ = gee_bidir_sorted_set_bidir_iterator (_tmp40_);
1115 _tmp42_ = self->priv->type;
1116 if (_tmp42_ != SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY) {
1117 GeeBidirIterator* _tmp43_;
1118 gboolean _tmp44_ = FALSE;
1119 GeeBidirIterator* _tmp45_;
1120 gpointer _tmp46_ = NULL;
1123 gint _tmp48__length1;
1125 gint _tmp49__length1;
1126 const gchar* _tmp50_;
1127 GeeBidirIterator* _tmp51_;
1128 gboolean _tmp52_ = FALSE;
1129 GeeBidirIterator* _tmp53_;
1130 gpointer _tmp54_ = NULL;
1133 gint _tmp56__length1;
1134 const gchar* _tmp57_;
1135 GeeBidirIterator* _tmp58_;
1136 gboolean _tmp59_ = FALSE;
1137 GeeBidirIterator* _tmp60_;
1138 gboolean _tmp61_ = FALSE;
1139 GeeBidirIterator* _tmp62_;
1140 gpointer _tmp63_ = NULL;
1143 gint _tmp65__length1;
1144 const gchar* _tmp66_;
1145 GeeBidirIterator* _tmp67_;
1146 gboolean _tmp68_ = FALSE;
1147 GeeBidirIterator* _tmp69_;
1148 GeeBidirIterator* _tmp70_;
1149 gboolean _tmp71_ = FALSE;
1150 SortedSetTestsSubSetTestsType _tmp72_;
1151 GeeBidirIterator* _tmp77_;
1152 gboolean _tmp78_ = FALSE;
1153 GeeBidirIterator* _tmp79_;
1154 gpointer _tmp80_ = NULL;
1157 gint _tmp82__length1;
1158 const gchar* _tmp83_;
1160 _tmp44_ = gee_bidir_iterator_last (_tmp43_);
1161 _vala_assert (_tmp44_, "iter.last ()");
1163 _tmp46_ = gee_iterator_get ((GeeIterator*) _tmp45_);
1164 _tmp47_ = (gchar*) _tmp46_;
1166 _tmp48__length1 = contains_length1;
1168 _tmp49__length1 = contains_length1;
1169 _tmp50_ = _tmp48_[_tmp49__length1 - 1];
1170 _vala_assert (g_strcmp0 (_tmp47_, _tmp50_) == 0, "iter.get () == contains[contains.length - 1]");
1173 _tmp52_ = gee_bidir_iterator_first (_tmp51_);
1174 _vala_assert (_tmp52_, "iter.first ()");
1176 _tmp54_ = gee_iterator_get ((GeeIterator*) _tmp53_);
1177 _tmp55_ = (gchar*) _tmp54_;
1179 _tmp56__length1 = contains_length1;
1180 _tmp57_ = _tmp56_[0];
1181 _vala_assert (g_strcmp0 (_tmp55_, _tmp57_) == 0, "iter.get () == contains[0]");
1184 _tmp59_ = gee_iterator_has_next ((GeeIterator*) _tmp58_);
1185 _vala_assert (_tmp59_, "iter.has_next ()");
1187 _tmp61_ = gee_iterator_next ((GeeIterator*) _tmp60_);
1188 _vala_assert (_tmp61_, "iter.next ()");
1190 _tmp63_ = gee_iterator_get ((GeeIterator*) _tmp62_);
1191 _tmp64_ = (gchar*) _tmp63_;
1193 _tmp65__length1 = contains_length1;
1194 _tmp66_ = _tmp65_[1];
1195 _vala_assert (g_strcmp0 (_tmp64_, _tmp66_) == 0, "iter.get () == contains[1]");
1198 _tmp68_ = gee_bidir_iterator_has_previous (_tmp67_);
1199 _vala_assert (_tmp68_, "iter.has_previous ()");
1201 gee_iterator_remove ((GeeIterator*) _tmp69_);
1203 _tmp71_ = gee_bidir_iterator_has_previous (_tmp70_);
1204 _vala_assert (_tmp71_, "iter.has_previous ()");
1205 _tmp72_ = self->priv->type;
1206 if (_tmp72_ != SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD) {
1207 GeeBidirIterator* _tmp73_;
1208 gboolean _tmp74_ = FALSE;
1210 _tmp74_ = gee_iterator_has_next ((GeeIterator*) _tmp73_);
1211 _vala_assert (_tmp74_, "iter.has_next ()");
1213 GeeBidirIterator* _tmp75_;
1214 gboolean _tmp76_ = FALSE;
1216 _tmp76_ = gee_iterator_has_next ((GeeIterator*) _tmp75_);
1217 _vala_assert (!_tmp76_, "!iter.has_next ()");
1220 _tmp78_ = gee_bidir_iterator_previous (_tmp77_);
1221 _vala_assert (_tmp78_, "iter.previous ()");
1223 _tmp80_ = gee_iterator_get ((GeeIterator*) _tmp79_);
1224 _tmp81_ = (gchar*) _tmp80_;
1226 _tmp82__length1 = contains_length1;
1227 _tmp83_ = _tmp82_[0];
1228 _vala_assert (g_strcmp0 (_tmp81_, _tmp83_) == 0, "iter.get () == contains[0]");
1231 GeeBidirIterator* _tmp84_;
1232 gboolean _tmp85_ = FALSE;
1233 gboolean _tmp86_ = FALSE;
1235 _tmp85_ = gee_bidir_iterator_first (_tmp84_);
1236 _vala_assert (!_tmp85_, "!iter.first ()");
1237 _tmp86_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR);
1239 GeeBidirIterator* _tmp87_;
1241 gee_iterator_remove ((GeeIterator*) _tmp87_);
1244 g_test_trap_assert_failed ();
1246 _g_object_unref0 (iter);
1247 contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL);
1251 static void bidir_sorted_set_tests_bidir_sub_set_tests_class_init (BidirSortedSetTestsBidirSubSetTestsClass * klass) {
1252 bidir_sorted_set_tests_bidir_sub_set_tests_parent_class = g_type_class_peek_parent (klass);
1253 g_type_class_add_private (klass, sizeof (BidirSortedSetTestsBidirSubSetTestsPrivate));
1254 GEE_TEST_CASE_CLASS (klass)->set_up = bidir_sorted_set_tests_bidir_sub_set_tests_real_set_up;
1255 GEE_TEST_CASE_CLASS (klass)->tear_down = bidir_sorted_set_tests_bidir_sub_set_tests_real_tear_down;
1256 G_OBJECT_CLASS (klass)->finalize = bidir_sorted_set_tests_bidir_sub_set_tests_finalize;
1260 static void bidir_sorted_set_tests_bidir_sub_set_tests_instance_init (BidirSortedSetTestsBidirSubSetTests * self) {
1261 self->priv = BIDIR_SORTED_SET_TESTS_BIDIR_SUB_SET_TESTS_GET_PRIVATE (self);
1265 static void bidir_sorted_set_tests_bidir_sub_set_tests_finalize (GObject* obj) {
1266 BidirSortedSetTestsBidirSubSetTests * self;
1267 self = G_TYPE_CHECK_INSTANCE_CAST (obj, BIDIR_SORTED_SET_TESTS_TYPE_BIDIR_SUB_SET_TESTS, BidirSortedSetTestsBidirSubSetTests);
1268 _g_object_unref0 (self->priv->master);
1269 _g_object_unref0 (self->priv->subset);
1270 _g_object_unref0 (self->priv->test);
1271 G_OBJECT_CLASS (bidir_sorted_set_tests_bidir_sub_set_tests_parent_class)->finalize (obj);
1275 GType bidir_sorted_set_tests_bidir_sub_set_tests_get_type (void) {
1276 static volatile gsize bidir_sorted_set_tests_bidir_sub_set_tests_type_id__volatile = 0;
1277 if (g_once_init_enter (&bidir_sorted_set_tests_bidir_sub_set_tests_type_id__volatile)) {
1278 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 };
1279 GType bidir_sorted_set_tests_bidir_sub_set_tests_type_id;
1280 bidir_sorted_set_tests_bidir_sub_set_tests_type_id = g_type_register_static (GEE_TYPE_TEST_CASE, "BidirSortedSetTestsBidirSubSetTests", &g_define_type_info, 0);
1281 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);
1283 return bidir_sorted_set_tests_bidir_sub_set_tests_type_id__volatile;
1287 static void bidir_sorted_set_tests_class_init (BidirSortedSetTestsClass * klass) {
1288 bidir_sorted_set_tests_parent_class = g_type_class_peek_parent (klass);
1292 static void bidir_sorted_set_tests_instance_init (BidirSortedSetTests * self) {
1296 GType bidir_sorted_set_tests_get_type (void) {
1297 static volatile gsize bidir_sorted_set_tests_type_id__volatile = 0;
1298 if (g_once_init_enter (&bidir_sorted_set_tests_type_id__volatile)) {
1299 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 };
1300 GType bidir_sorted_set_tests_type_id;
1301 bidir_sorted_set_tests_type_id = g_type_register_static (TYPE_SORTED_SET_TESTS, "BidirSortedSetTests", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
1302 g_once_init_leave (&bidir_sorted_set_tests_type_id__volatile, bidir_sorted_set_tests_type_id);
1304 return bidir_sorted_set_tests_type_id__volatile;
1308 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
1309 if ((array != NULL) && (destroy_func != NULL)) {
1311 for (i = 0; i < array_length; i = i + 1) {
1312 if (((gpointer*) array)[i] != NULL) {
1313 destroy_func (((gpointer*) array)[i]);
1320 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
1321 _vala_array_destroy (array, array_length, destroy_func);