Update Changelog
[profile/ivi/libgee.git] / tests / testfunctions.c
1 /* testfunctions.c generated by valac 0.18.0, the Vala compiler
2  * generated from testfunctions.vala, do not modify */
3
4 /* testfunctions.vala
5  *
6  * Copyright (C) 2010  Maciej Piechotka
7  *
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.
12
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.
17
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
21  *
22  * Author:
23  *      Maciej Piechotka <uzytkownik2@gmail.com>
24  */
25
26 #include <glib.h>
27 #include <glib-object.h>
28 #include <stdlib.h>
29 #include <string.h>
30 #include <gee.h>
31
32
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))
39
40 typedef struct _GeeTestCase GeeTestCase;
41 typedef struct _GeeTestCaseClass GeeTestCaseClass;
42 typedef struct _GeeTestCasePrivate GeeTestCasePrivate;
43
44 #define TYPE_FUNCTIONS_TESTS (functions_tests_get_type ())
45 #define FUNCTIONS_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FUNCTIONS_TESTS, FunctionsTests))
46 #define FUNCTIONS_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FUNCTIONS_TESTS, FunctionsTestsClass))
47 #define IS_FUNCTIONS_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FUNCTIONS_TESTS))
48 #define IS_FUNCTIONS_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FUNCTIONS_TESTS))
49 #define FUNCTIONS_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FUNCTIONS_TESTS, FunctionsTestsClass))
50
51 typedef struct _FunctionsTests FunctionsTests;
52 typedef struct _FunctionsTestsClass FunctionsTestsClass;
53 typedef struct _FunctionsTestsPrivate FunctionsTestsPrivate;
54 #define _g_free0(var) (var = (g_free (var), NULL))
55
56 #define FUNCTIONS_TESTS_TYPE_MY_COMPARABLE (functions_tests_my_comparable_get_type ())
57 #define FUNCTIONS_TESTS_MY_COMPARABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FUNCTIONS_TESTS_TYPE_MY_COMPARABLE, FunctionsTestsMyComparable))
58 #define FUNCTIONS_TESTS_MY_COMPARABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FUNCTIONS_TESTS_TYPE_MY_COMPARABLE, FunctionsTestsMyComparableClass))
59 #define FUNCTIONS_TESTS_IS_MY_COMPARABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FUNCTIONS_TESTS_TYPE_MY_COMPARABLE))
60 #define FUNCTIONS_TESTS_IS_MY_COMPARABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FUNCTIONS_TESTS_TYPE_MY_COMPARABLE))
61 #define FUNCTIONS_TESTS_MY_COMPARABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FUNCTIONS_TESTS_TYPE_MY_COMPARABLE, FunctionsTestsMyComparableClass))
62
63 typedef struct _FunctionsTestsMyComparable FunctionsTestsMyComparable;
64 typedef struct _FunctionsTestsMyComparableClass FunctionsTestsMyComparableClass;
65 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
66
67 #define FUNCTIONS_TESTS_TYPE_MY_HASHABLE (functions_tests_my_hashable_get_type ())
68 #define FUNCTIONS_TESTS_MY_HASHABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FUNCTIONS_TESTS_TYPE_MY_HASHABLE, FunctionsTestsMyHashable))
69 #define FUNCTIONS_TESTS_MY_HASHABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FUNCTIONS_TESTS_TYPE_MY_HASHABLE, FunctionsTestsMyHashableClass))
70 #define FUNCTIONS_TESTS_IS_MY_HASHABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FUNCTIONS_TESTS_TYPE_MY_HASHABLE))
71 #define FUNCTIONS_TESTS_IS_MY_HASHABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FUNCTIONS_TESTS_TYPE_MY_HASHABLE))
72 #define FUNCTIONS_TESTS_MY_HASHABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FUNCTIONS_TESTS_TYPE_MY_HASHABLE, FunctionsTestsMyHashableClass))
73
74 typedef struct _FunctionsTestsMyHashable FunctionsTestsMyHashable;
75 typedef struct _FunctionsTestsMyHashableClass FunctionsTestsMyHashableClass;
76 typedef struct _Block5Data Block5Data;
77 typedef struct _Block6Data Block6Data;
78 typedef struct _Block7Data Block7Data;
79 typedef struct _Block8Data Block8Data;
80 typedef struct _FunctionsTestsMyComparablePrivate FunctionsTestsMyComparablePrivate;
81 typedef struct _FunctionsTestsMyHashablePrivate FunctionsTestsMyHashablePrivate;
82 #define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
83
84 struct _GeeTestCase {
85         GObject parent_instance;
86         GeeTestCasePrivate * priv;
87 };
88
89 struct _GeeTestCaseClass {
90         GObjectClass parent_class;
91         void (*set_up) (GeeTestCase* self);
92         void (*tear_down) (GeeTestCase* self);
93 };
94
95 struct _FunctionsTests {
96         GeeTestCase parent_instance;
97         FunctionsTestsPrivate * priv;
98 };
99
100 struct _FunctionsTestsClass {
101         GeeTestCaseClass parent_class;
102 };
103
104 typedef void (*GeeTestCaseTestMethod) (void* user_data);
105 struct _Block5Data {
106         int _ref_count_;
107         FunctionsTests * self;
108         gint i;
109         gint j;
110 };
111
112 struct _Block6Data {
113         int _ref_count_;
114         Block5Data * _data5_;
115         gint k;
116 };
117
118 struct _Block7Data {
119         int _ref_count_;
120         FunctionsTests * self;
121         gint i;
122 };
123
124 struct _Block8Data {
125         int _ref_count_;
126         Block7Data * _data7_;
127         gint j;
128         gint start;
129 };
130
131 struct _FunctionsTestsMyComparable {
132         GObject parent_instance;
133         FunctionsTestsMyComparablePrivate * priv;
134 };
135
136 struct _FunctionsTestsMyComparableClass {
137         GObjectClass parent_class;
138 };
139
140 struct _FunctionsTestsMyComparablePrivate {
141         gint i;
142 };
143
144 struct _FunctionsTestsMyHashable {
145         GObject parent_instance;
146         FunctionsTestsMyHashablePrivate * priv;
147 };
148
149 struct _FunctionsTestsMyHashableClass {
150         GObjectClass parent_class;
151 };
152
153 struct _FunctionsTestsMyHashablePrivate {
154         gint i;
155 };
156
157
158 static gpointer functions_tests_parent_class = NULL;
159 static gpointer functions_tests_my_comparable_parent_class = NULL;
160 static GeeComparableIface* functions_tests_my_comparable_gee_comparable_parent_iface = NULL;
161 static gpointer functions_tests_my_hashable_parent_class = NULL;
162 static GeeComparableIface* functions_tests_my_hashable_gee_comparable_parent_iface = NULL;
163 static GeeHashableIface* functions_tests_my_hashable_gee_hashable_parent_iface = NULL;
164
165 GType gee_test_case_get_type (void) G_GNUC_CONST;
166 GType functions_tests_get_type (void) G_GNUC_CONST;
167 enum  {
168         FUNCTIONS_TESTS_DUMMY_PROPERTY
169 };
170 FunctionsTests* functions_tests_new (void);
171 FunctionsTests* functions_tests_construct (GType object_type);
172 GeeTestCase* gee_test_case_construct (GType object_type, const gchar* name);
173 void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify);
174 void functions_tests_test_string_func (FunctionsTests* self);
175 static void _functions_tests_test_string_func_gee_test_case_test_method (gpointer self);
176 void functions_tests_test_int_func (FunctionsTests* self);
177 static void _functions_tests_test_int_func_gee_test_case_test_method (gpointer self);
178 void functions_tests_test_compare_func (FunctionsTests* self);
179 static void _functions_tests_test_compare_func_gee_test_case_test_method (gpointer self);
180 void functions_tests_test_hash_func (FunctionsTests* self);
181 static void _functions_tests_test_hash_func_gee_test_case_test_method (gpointer self);
182 void functions_tests_test_unfold (FunctionsTests* self);
183 static void _functions_tests_test_unfold_gee_test_case_test_method (gpointer self);
184 void functions_tests_test_concat (FunctionsTests* self);
185 static void _functions_tests_test_concat_gee_test_case_test_method (gpointer self);
186 static FunctionsTestsMyComparable* functions_tests_my_comparable_new (gint i);
187 static FunctionsTestsMyComparable* functions_tests_my_comparable_construct (GType object_type, gint i);
188 static GType functions_tests_my_comparable_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
189 static FunctionsTestsMyHashable* functions_tests_my_hashable_new (gint i);
190 static FunctionsTestsMyHashable* functions_tests_my_hashable_construct (GType object_type, gint i);
191 static GType functions_tests_my_hashable_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
192 static Block5Data* block5_data_ref (Block5Data* _data5_);
193 static void block5_data_unref (void * _userdata_);
194 static GeeLazy* __lambda19_ (Block5Data* _data5_);
195 static Block6Data* block6_data_ref (Block6Data* _data6_);
196 static void block6_data_unref (void * _userdata_);
197 static gint __lambda20_ (Block6Data* _data6_);
198 static gpointer ___lambda20__gee_lazy_func (gpointer self);
199 static GeeLazy* ___lambda19__gee_unfold_func (gpointer self);
200 static Block7Data* block7_data_ref (Block7Data* _data7_);
201 static void block7_data_unref (void * _userdata_);
202 static GeeLazy* __lambda21_ (Block7Data* _data7_);
203 static Block8Data* block8_data_ref (Block8Data* _data8_);
204 static void block8_data_unref (void * _userdata_);
205 static GeeLazy* __lambda22_ (Block8Data* _data8_);
206 static GeeLazy* ___lambda22__gee_unfold_func (gpointer self);
207 static GeeLazy* ___lambda21__gee_unfold_func (gpointer self);
208 #define FUNCTIONS_TESTS_MY_COMPARABLE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), FUNCTIONS_TESTS_TYPE_MY_COMPARABLE, FunctionsTestsMyComparablePrivate))
209 enum  {
210         FUNCTIONS_TESTS_MY_COMPARABLE_DUMMY_PROPERTY
211 };
212 static gint functions_tests_my_comparable_real_compare_to (GeeComparable* base, FunctionsTestsMyComparable* cmp);
213 static void functions_tests_my_comparable_finalize (GObject* obj);
214 #define FUNCTIONS_TESTS_MY_HASHABLE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), FUNCTIONS_TESTS_TYPE_MY_HASHABLE, FunctionsTestsMyHashablePrivate))
215 enum  {
216         FUNCTIONS_TESTS_MY_HASHABLE_DUMMY_PROPERTY
217 };
218 static gint functions_tests_my_hashable_real_compare_to (GeeComparable* base, FunctionsTestsMyHashable* cmp);
219 static guint functions_tests_my_hashable_real_hash (GeeHashable* base);
220 static gboolean functions_tests_my_hashable_real_equal_to (GeeHashable* base, FunctionsTestsMyHashable* hash);
221 static void functions_tests_my_hashable_finalize (GObject* obj);
222
223
224 static void _functions_tests_test_string_func_gee_test_case_test_method (gpointer self) {
225         functions_tests_test_string_func (self);
226 }
227
228
229 static void _functions_tests_test_int_func_gee_test_case_test_method (gpointer self) {
230         functions_tests_test_int_func (self);
231 }
232
233
234 static void _functions_tests_test_compare_func_gee_test_case_test_method (gpointer self) {
235         functions_tests_test_compare_func (self);
236 }
237
238
239 static void _functions_tests_test_hash_func_gee_test_case_test_method (gpointer self) {
240         functions_tests_test_hash_func (self);
241 }
242
243
244 static void _functions_tests_test_unfold_gee_test_case_test_method (gpointer self) {
245         functions_tests_test_unfold (self);
246 }
247
248
249 static void _functions_tests_test_concat_gee_test_case_test_method (gpointer self) {
250         functions_tests_test_concat (self);
251 }
252
253
254 FunctionsTests* functions_tests_construct (GType object_type) {
255         FunctionsTests * self = NULL;
256         self = (FunctionsTests*) gee_test_case_construct (object_type, "Functions");
257         gee_test_case_add_test ((GeeTestCase*) self, "[Functions] comparing and hashing strings", _functions_tests_test_string_func_gee_test_case_test_method, g_object_ref (self), g_object_unref);
258         gee_test_case_add_test ((GeeTestCase*) self, "[Functions] comparing and hashing int", _functions_tests_test_int_func_gee_test_case_test_method, g_object_ref (self), g_object_unref);
259         gee_test_case_add_test ((GeeTestCase*) self, "[Functions] comparing instances of Comparable", _functions_tests_test_compare_func_gee_test_case_test_method, g_object_ref (self), g_object_unref);
260         gee_test_case_add_test ((GeeTestCase*) self, "[Functions] comparing and hashing instances of Hashable", _functions_tests_test_hash_func_gee_test_case_test_method, g_object_ref (self), g_object_unref);
261         gee_test_case_add_test ((GeeTestCase*) self, "[Iterator] unfold", _functions_tests_test_unfold_gee_test_case_test_method, g_object_ref (self), g_object_unref);
262         gee_test_case_add_test ((GeeTestCase*) self, "[Iterator] concat", _functions_tests_test_concat_gee_test_case_test_method, g_object_ref (self), g_object_unref);
263         return self;
264 }
265
266
267 FunctionsTests* functions_tests_new (void) {
268         return functions_tests_construct (TYPE_FUNCTIONS_TESTS);
269 }
270
271
272 void functions_tests_test_string_func (FunctionsTests* self) {
273         gchar* _tmp0_;
274         gchar* one;
275         gchar* _tmp1_;
276         gchar* two;
277         gchar* _tmp2_ = NULL;
278         gchar* two_copy;
279         void* _tmp3_ = NULL;
280         GDestroyNotify _tmp4_ = NULL;
281         GeeEqualDataFunc _tmp5_ = NULL;
282         GeeEqualDataFunc eq;
283         void* eq_target;
284         GDestroyNotify eq_target_destroy_notify;
285         void* _tmp6_ = NULL;
286         GDestroyNotify _tmp7_ = NULL;
287         GCompareDataFunc _tmp8_ = NULL;
288         GCompareDataFunc cmp;
289         void* cmp_target;
290         GDestroyNotify cmp_target_destroy_notify;
291         void* _tmp9_ = NULL;
292         GDestroyNotify _tmp10_ = NULL;
293         GeeHashDataFunc _tmp11_ = NULL;
294         GeeHashDataFunc hash;
295         void* hash_target;
296         GDestroyNotify hash_target_destroy_notify;
297         gboolean _tmp12_ = FALSE;
298         gint _tmp13_ = 0;
299         guint _tmp14_ = 0U;
300         guint _tmp15_ = 0U;
301         gboolean _tmp16_ = FALSE;
302         gint _tmp17_ = 0;
303         guint _tmp18_ = 0U;
304         guint _tmp19_ = 0U;
305         gboolean _tmp20_ = FALSE;
306         gint _tmp21_ = 0;
307         gboolean _tmp22_ = FALSE;
308         gint _tmp23_ = 0;
309         g_return_if_fail (self != NULL);
310         _tmp0_ = g_strdup ("one");
311         one = _tmp0_;
312         _tmp1_ = g_strdup ("two");
313         two = _tmp1_;
314         _tmp2_ = g_strdup (two);
315         two_copy = _tmp2_;
316         _tmp5_ = gee_functions_get_equal_func_for (G_TYPE_STRING, &_tmp3_, &_tmp4_);
317         eq = _tmp5_;
318         eq_target = _tmp3_;
319         eq_target_destroy_notify = _tmp4_;
320         _tmp8_ = gee_functions_get_compare_func_for (G_TYPE_STRING, &_tmp6_, &_tmp7_);
321         cmp = _tmp8_;
322         cmp_target = _tmp6_;
323         cmp_target_destroy_notify = _tmp7_;
324         _tmp11_ = gee_functions_get_hash_func_for (G_TYPE_STRING, &_tmp9_, &_tmp10_);
325         hash = _tmp11_;
326         hash_target = _tmp9_;
327         hash_target_destroy_notify = _tmp10_;
328         _vala_assert (eq != NULL, "eq != null");
329         _vala_assert (cmp != NULL, "cmp != null");
330         _vala_assert (hash != NULL, "hash != null");
331         _tmp12_ = eq (two, two, eq_target);
332         _vala_assert (_tmp12_, "eq (two, two)");
333         _tmp13_ = cmp (two, two, cmp_target);
334         _vala_assert (_tmp13_ == 0, "cmp (two, two) == 0");
335         _tmp14_ = hash (two, hash_target);
336         _tmp15_ = hash (two, hash_target);
337         _vala_assert (_tmp14_ == _tmp15_, "hash (two) == hash (two)");
338         _tmp16_ = eq (two, two_copy, eq_target);
339         _vala_assert (_tmp16_, "eq (two, two_copy)");
340         _tmp17_ = cmp (two, two_copy, cmp_target);
341         _vala_assert (_tmp17_ == 0, "cmp (two, two_copy) == 0");
342         _tmp18_ = hash (two, hash_target);
343         _tmp19_ = hash (two_copy, hash_target);
344         _vala_assert (_tmp18_ == _tmp19_, "hash (two) == hash (two_copy)");
345         _tmp20_ = eq (one, two, eq_target);
346         _vala_assert (!_tmp20_, "!eq (one, two)");
347         _tmp21_ = cmp (one, two, cmp_target);
348         _vala_assert (_tmp21_ < 0, "cmp (one, two) < 0");
349         _tmp22_ = eq (two, one, eq_target);
350         _vala_assert (!_tmp22_, "!eq (two, one)");
351         _tmp23_ = cmp (two, one, cmp_target);
352         _vala_assert (_tmp23_ > 0, "cmp (two, one) > 0");
353         (hash_target_destroy_notify == NULL) ? NULL : (hash_target_destroy_notify (hash_target), NULL);
354         hash = NULL;
355         hash_target = NULL;
356         hash_target_destroy_notify = NULL;
357         (cmp_target_destroy_notify == NULL) ? NULL : (cmp_target_destroy_notify (cmp_target), NULL);
358         cmp = NULL;
359         cmp_target = NULL;
360         cmp_target_destroy_notify = NULL;
361         (eq_target_destroy_notify == NULL) ? NULL : (eq_target_destroy_notify (eq_target), NULL);
362         eq = NULL;
363         eq_target = NULL;
364         eq_target_destroy_notify = NULL;
365         _g_free0 (two_copy);
366         _g_free0 (two);
367         _g_free0 (one);
368 }
369
370
371 void functions_tests_test_int_func (FunctionsTests* self) {
372         void* one;
373         void* two;
374         void* _tmp0_ = NULL;
375         GDestroyNotify _tmp1_ = NULL;
376         GeeEqualDataFunc _tmp2_ = NULL;
377         GeeEqualDataFunc eq;
378         void* eq_target;
379         GDestroyNotify eq_target_destroy_notify;
380         void* _tmp3_ = NULL;
381         GDestroyNotify _tmp4_ = NULL;
382         GCompareDataFunc _tmp5_ = NULL;
383         GCompareDataFunc cmp;
384         void* cmp_target;
385         GDestroyNotify cmp_target_destroy_notify;
386         void* _tmp6_ = NULL;
387         GDestroyNotify _tmp7_ = NULL;
388         GeeHashDataFunc _tmp8_ = NULL;
389         GeeHashDataFunc hash;
390         void* hash_target;
391         GDestroyNotify hash_target_destroy_notify;
392         gboolean _tmp9_ = FALSE;
393         gint _tmp10_ = 0;
394         guint _tmp11_ = 0U;
395         guint _tmp12_ = 0U;
396         gboolean _tmp13_ = FALSE;
397         gint _tmp14_ = 0;
398         gboolean _tmp15_ = FALSE;
399         gint _tmp16_ = 0;
400         g_return_if_fail (self != NULL);
401         one = (void*) 1;
402         two = (void*) 2;
403         _tmp2_ = gee_functions_get_equal_func_for (G_TYPE_INT, &_tmp0_, &_tmp1_);
404         eq = _tmp2_;
405         eq_target = _tmp0_;
406         eq_target_destroy_notify = _tmp1_;
407         _tmp5_ = gee_functions_get_compare_func_for (G_TYPE_INT, &_tmp3_, &_tmp4_);
408         cmp = _tmp5_;
409         cmp_target = _tmp3_;
410         cmp_target_destroy_notify = _tmp4_;
411         _tmp8_ = gee_functions_get_hash_func_for (G_TYPE_INT, &_tmp6_, &_tmp7_);
412         hash = _tmp8_;
413         hash_target = _tmp6_;
414         hash_target_destroy_notify = _tmp7_;
415         _vala_assert (eq != NULL, "eq != null");
416         _vala_assert (cmp != NULL, "cmp != null");
417         _vala_assert (hash != NULL, "hash != null");
418         _tmp9_ = eq (two, two, eq_target);
419         _vala_assert (_tmp9_, "eq (two, two)");
420         _tmp10_ = cmp (two, two, cmp_target);
421         _vala_assert (_tmp10_ == 0, "cmp (two, two) == 0");
422         _tmp11_ = hash (two, hash_target);
423         _tmp12_ = hash (two, hash_target);
424         _vala_assert (_tmp11_ == _tmp12_, "hash (two) == hash (two)");
425         _tmp13_ = eq (one, two, eq_target);
426         _vala_assert (!_tmp13_, "!eq (one, two)");
427         _tmp14_ = cmp (one, two, cmp_target);
428         _vala_assert (_tmp14_ < 0, "cmp (one, two) < 0");
429         _tmp15_ = eq (two, one, eq_target);
430         _vala_assert (!_tmp15_, "!eq (two, one)");
431         _tmp16_ = cmp (two, one, cmp_target);
432         _vala_assert (_tmp16_ > 0, "cmp (two, one) > 0");
433         (hash_target_destroy_notify == NULL) ? NULL : (hash_target_destroy_notify (hash_target), NULL);
434         hash = NULL;
435         hash_target = NULL;
436         hash_target_destroy_notify = NULL;
437         (cmp_target_destroy_notify == NULL) ? NULL : (cmp_target_destroy_notify (cmp_target), NULL);
438         cmp = NULL;
439         cmp_target = NULL;
440         cmp_target_destroy_notify = NULL;
441         (eq_target_destroy_notify == NULL) ? NULL : (eq_target_destroy_notify (eq_target), NULL);
442         eq = NULL;
443         eq_target = NULL;
444         eq_target_destroy_notify = NULL;
445 }
446
447
448 void functions_tests_test_compare_func (FunctionsTests* self) {
449         FunctionsTestsMyComparable* _tmp0_;
450         FunctionsTestsMyComparable* two;
451         FunctionsTestsMyComparable* _tmp1_;
452         FunctionsTestsMyComparable* one;
453         FunctionsTestsMyComparable* _tmp2_;
454         FunctionsTestsMyComparable* two_copy;
455         void* _tmp3_ = NULL;
456         GDestroyNotify _tmp4_ = NULL;
457         GeeEqualDataFunc _tmp5_ = NULL;
458         GeeEqualDataFunc eq;
459         void* eq_target;
460         GDestroyNotify eq_target_destroy_notify;
461         void* _tmp6_ = NULL;
462         GDestroyNotify _tmp7_ = NULL;
463         GCompareDataFunc _tmp8_ = NULL;
464         GCompareDataFunc cmp;
465         void* cmp_target;
466         GDestroyNotify cmp_target_destroy_notify;
467         gboolean _tmp9_ = FALSE;
468         gint _tmp10_ = 0;
469         gboolean _tmp11_ = FALSE;
470         gint _tmp12_ = 0;
471         gboolean _tmp13_ = FALSE;
472         gint _tmp14_ = 0;
473         gboolean _tmp15_ = FALSE;
474         gint _tmp16_ = 0;
475         g_return_if_fail (self != NULL);
476         _tmp0_ = functions_tests_my_comparable_new (2);
477         two = _tmp0_;
478         _tmp1_ = functions_tests_my_comparable_new (1);
479         one = _tmp1_;
480         _tmp2_ = functions_tests_my_comparable_new (2);
481         two_copy = _tmp2_;
482         _tmp5_ = gee_functions_get_equal_func_for (FUNCTIONS_TESTS_TYPE_MY_COMPARABLE, &_tmp3_, &_tmp4_);
483         eq = _tmp5_;
484         eq_target = _tmp3_;
485         eq_target_destroy_notify = _tmp4_;
486         _tmp8_ = gee_functions_get_compare_func_for (FUNCTIONS_TESTS_TYPE_MY_COMPARABLE, &_tmp6_, &_tmp7_);
487         cmp = _tmp8_;
488         cmp_target = _tmp6_;
489         cmp_target_destroy_notify = _tmp7_;
490         _vala_assert (eq != NULL, "eq != null");
491         _vala_assert (cmp != NULL, "cmp != null");
492         _tmp9_ = eq (two, two, eq_target);
493         _vala_assert (_tmp9_, "eq (two, two)");
494         _tmp10_ = cmp (two, two, cmp_target);
495         _vala_assert (_tmp10_ == 0, "cmp (two, two) == 0");
496         _tmp11_ = eq (two, two_copy, eq_target);
497         _vala_assert (_tmp11_, "eq (two, two_copy)");
498         _tmp12_ = cmp (two, two_copy, cmp_target);
499         _vala_assert (_tmp12_ == 0, "cmp (two, two_copy) == 0");
500         _tmp13_ = eq (one, two, eq_target);
501         _vala_assert (!_tmp13_, "!eq (one, two)");
502         _tmp14_ = cmp (one, two, cmp_target);
503         _vala_assert (_tmp14_ < 0, "cmp (one, two) < 0");
504         _tmp15_ = eq (two, one, eq_target);
505         _vala_assert (!_tmp15_, "!eq (two, one)");
506         _tmp16_ = cmp (two, one, cmp_target);
507         _vala_assert (_tmp16_ > 0, "cmp (two, one) > 0");
508         (cmp_target_destroy_notify == NULL) ? NULL : (cmp_target_destroy_notify (cmp_target), NULL);
509         cmp = NULL;
510         cmp_target = NULL;
511         cmp_target_destroy_notify = NULL;
512         (eq_target_destroy_notify == NULL) ? NULL : (eq_target_destroy_notify (eq_target), NULL);
513         eq = NULL;
514         eq_target = NULL;
515         eq_target_destroy_notify = NULL;
516         _g_object_unref0 (two_copy);
517         _g_object_unref0 (one);
518         _g_object_unref0 (two);
519 }
520
521
522 void functions_tests_test_hash_func (FunctionsTests* self) {
523         FunctionsTestsMyHashable* _tmp0_;
524         FunctionsTestsMyHashable* two;
525         FunctionsTestsMyHashable* _tmp1_;
526         FunctionsTestsMyHashable* one;
527         FunctionsTestsMyHashable* _tmp2_;
528         FunctionsTestsMyHashable* two_copy;
529         FunctionsTestsMyHashable* _tmp3_;
530         FunctionsTestsMyHashable* minus_one;
531         FunctionsTestsMyHashable* _tmp4_;
532         FunctionsTestsMyHashable* minus_one2;
533         void* _tmp5_ = NULL;
534         GDestroyNotify _tmp6_ = NULL;
535         GeeEqualDataFunc _tmp7_ = NULL;
536         GeeEqualDataFunc eq;
537         void* eq_target;
538         GDestroyNotify eq_target_destroy_notify;
539         void* _tmp8_ = NULL;
540         GDestroyNotify _tmp9_ = NULL;
541         GCompareDataFunc _tmp10_ = NULL;
542         GCompareDataFunc cmp;
543         void* cmp_target;
544         GDestroyNotify cmp_target_destroy_notify;
545         void* _tmp11_ = NULL;
546         GDestroyNotify _tmp12_ = NULL;
547         GeeHashDataFunc _tmp13_ = NULL;
548         GeeHashDataFunc hash;
549         void* hash_target;
550         GDestroyNotify hash_target_destroy_notify;
551         gboolean _tmp14_ = FALSE;
552         gint _tmp15_ = 0;
553         guint _tmp16_ = 0U;
554         guint _tmp17_ = 0U;
555         gboolean _tmp18_ = FALSE;
556         gint _tmp19_ = 0;
557         guint _tmp20_ = 0U;
558         guint _tmp21_ = 0U;
559         gboolean _tmp22_ = FALSE;
560         gint _tmp23_ = 0;
561         gboolean _tmp24_ = FALSE;
562         gint _tmp25_ = 0;
563         guint _tmp26_ = 0U;
564         gboolean _tmp27_ = FALSE;
565         g_return_if_fail (self != NULL);
566         _tmp0_ = functions_tests_my_hashable_new (2);
567         two = _tmp0_;
568         _tmp1_ = functions_tests_my_hashable_new (1);
569         one = _tmp1_;
570         _tmp2_ = functions_tests_my_hashable_new (2);
571         two_copy = _tmp2_;
572         _tmp3_ = functions_tests_my_hashable_new (-1);
573         minus_one = _tmp3_;
574         _tmp4_ = functions_tests_my_hashable_new (-1);
575         minus_one2 = _tmp4_;
576         _tmp7_ = gee_functions_get_equal_func_for (FUNCTIONS_TESTS_TYPE_MY_HASHABLE, &_tmp5_, &_tmp6_);
577         eq = _tmp7_;
578         eq_target = _tmp5_;
579         eq_target_destroy_notify = _tmp6_;
580         _tmp10_ = gee_functions_get_compare_func_for (FUNCTIONS_TESTS_TYPE_MY_HASHABLE, &_tmp8_, &_tmp9_);
581         cmp = _tmp10_;
582         cmp_target = _tmp8_;
583         cmp_target_destroy_notify = _tmp9_;
584         _tmp13_ = gee_functions_get_hash_func_for (FUNCTIONS_TESTS_TYPE_MY_HASHABLE, &_tmp11_, &_tmp12_);
585         hash = _tmp13_;
586         hash_target = _tmp11_;
587         hash_target_destroy_notify = _tmp12_;
588         _vala_assert (eq != NULL, "eq != null");
589         _vala_assert (cmp != NULL, "cmp != null");
590         _vala_assert (hash != NULL, "hash != null");
591         _tmp14_ = eq (two, two, eq_target);
592         _vala_assert (_tmp14_, "eq (two, two)");
593         _tmp15_ = cmp (two, two, cmp_target);
594         _vala_assert (_tmp15_ == 0, "cmp (two, two) == 0");
595         _tmp16_ = hash (two, hash_target);
596         _tmp17_ = hash (two, hash_target);
597         _vala_assert (_tmp16_ == _tmp17_, "hash (two) == hash (two)");
598         _tmp18_ = eq (two, two_copy, eq_target);
599         _vala_assert (_tmp18_, "eq (two, two_copy)");
600         _tmp19_ = cmp (two, two_copy, cmp_target);
601         _vala_assert (_tmp19_ == 0, "cmp (two, two_copy) == 0");
602         _tmp20_ = hash (two, hash_target);
603         _tmp21_ = hash (two_copy, hash_target);
604         _vala_assert (_tmp20_ == _tmp21_, "hash (two) == hash (two_copy)");
605         _tmp22_ = eq (one, two, eq_target);
606         _vala_assert (!_tmp22_, "!eq (one, two)");
607         _tmp23_ = cmp (one, two, cmp_target);
608         _vala_assert (_tmp23_ < 0, "cmp (one, two) < 0");
609         _tmp24_ = eq (two, one, eq_target);
610         _vala_assert (!_tmp24_, "!eq (two, one)");
611         _tmp25_ = cmp (two, one, cmp_target);
612         _vala_assert (_tmp25_ > 0, "cmp (two, one) > 0");
613         _tmp26_ = hash (one, hash_target);
614         _vala_assert (_tmp26_ == ((guint) 1), "hash (one) == 1");
615         _tmp27_ = eq (minus_one, minus_one2, eq_target);
616         _vala_assert (!_tmp27_, "!eq (minus_one, minus_one2)");
617         (hash_target_destroy_notify == NULL) ? NULL : (hash_target_destroy_notify (hash_target), NULL);
618         hash = NULL;
619         hash_target = NULL;
620         hash_target_destroy_notify = NULL;
621         (cmp_target_destroy_notify == NULL) ? NULL : (cmp_target_destroy_notify (cmp_target), NULL);
622         cmp = NULL;
623         cmp_target = NULL;
624         cmp_target_destroy_notify = NULL;
625         (eq_target_destroy_notify == NULL) ? NULL : (eq_target_destroy_notify (eq_target), NULL);
626         eq = NULL;
627         eq_target = NULL;
628         eq_target_destroy_notify = NULL;
629         _g_object_unref0 (minus_one2);
630         _g_object_unref0 (minus_one);
631         _g_object_unref0 (two_copy);
632         _g_object_unref0 (one);
633         _g_object_unref0 (two);
634 }
635
636
637 static Block5Data* block5_data_ref (Block5Data* _data5_) {
638         g_atomic_int_inc (&_data5_->_ref_count_);
639         return _data5_;
640 }
641
642
643 static void block5_data_unref (void * _userdata_) {
644         Block5Data* _data5_;
645         _data5_ = (Block5Data*) _userdata_;
646         if (g_atomic_int_dec_and_test (&_data5_->_ref_count_)) {
647                 FunctionsTests * self;
648                 self = _data5_->self;
649                 _g_object_unref0 (self);
650                 g_slice_free (Block5Data, _data5_);
651         }
652 }
653
654
655 static Block6Data* block6_data_ref (Block6Data* _data6_) {
656         g_atomic_int_inc (&_data6_->_ref_count_);
657         return _data6_;
658 }
659
660
661 static void block6_data_unref (void * _userdata_) {
662         Block6Data* _data6_;
663         _data6_ = (Block6Data*) _userdata_;
664         if (g_atomic_int_dec_and_test (&_data6_->_ref_count_)) {
665                 FunctionsTests * self;
666                 self = _data6_->_data5_->self;
667                 block5_data_unref (_data6_->_data5_);
668                 _data6_->_data5_ = NULL;
669                 g_slice_free (Block6Data, _data6_);
670         }
671 }
672
673
674 static gint __lambda20_ (Block6Data* _data6_) {
675         Block5Data* _data5_;
676         FunctionsTests * self;
677         gint result = 0;
678         gint _tmp0_;
679         gint _tmp1_;
680         gint _tmp2_;
681         gint _tmp3_;
682         _data5_ = _data6_->_data5_;
683         self = _data5_->self;
684         _tmp0_ = _data6_->k;
685         _tmp1_ = _data5_->i;
686         _vala_assert ((_tmp0_ + 1) == _tmp1_, "k + 1 == i");
687         _tmp2_ = _data6_->k;
688         _data5_->j = _tmp2_;
689         _tmp3_ = _data6_->k;
690         result = _tmp3_;
691         return result;
692 }
693
694
695 static gpointer ___lambda20__gee_lazy_func (gpointer self) {
696         gpointer result;
697         result = __lambda20_ (self);
698         return result;
699 }
700
701
702 static GeeLazy* __lambda19_ (Block5Data* _data5_) {
703         FunctionsTests * self;
704         GeeLazy* result = NULL;
705         Block6Data* _data6_;
706         gint _tmp0_;
707         gint _tmp1_;
708         gint _tmp2_;
709         gint _tmp3_;
710         GeeLazy* _tmp4_;
711         self = _data5_->self;
712         _data6_ = g_slice_new0 (Block6Data);
713         _data6_->_ref_count_ = 1;
714         _data6_->_data5_ = block5_data_ref (_data5_);
715         _tmp0_ = _data5_->j;
716         _tmp1_ = _data5_->i;
717         _vala_assert ((_tmp0_ + 1) == _tmp1_, "j + 1 == i");
718         _tmp2_ = _data5_->i;
719         if (_tmp2_ == 10) {
720                 result = NULL;
721                 block6_data_unref (_data6_);
722                 _data6_ = NULL;
723                 return result;
724         }
725         _tmp3_ = _data5_->i;
726         _data5_->i = _tmp3_ + 1;
727         _data6_->k = _tmp3_;
728         _tmp4_ = gee_lazy_new (G_TYPE_INT, NULL, NULL, ___lambda20__gee_lazy_func, block6_data_ref (_data6_), block6_data_unref);
729         result = _tmp4_;
730         block6_data_unref (_data6_);
731         _data6_ = NULL;
732         return result;
733 }
734
735
736 static GeeLazy* ___lambda19__gee_unfold_func (gpointer self) {
737         GeeLazy* result;
738         result = __lambda19_ (self);
739         return result;
740 }
741
742
743 void functions_tests_test_unfold (FunctionsTests* self) {
744         Block5Data* _data5_;
745         GeeIterator* _tmp0_ = NULL;
746         GeeIterator* iter;
747         gint k;
748         gint _tmp10_;
749         g_return_if_fail (self != NULL);
750         _data5_ = g_slice_new0 (Block5Data);
751         _data5_->_ref_count_ = 1;
752         _data5_->self = g_object_ref (self);
753         _data5_->i = 0;
754         _data5_->j = -1;
755         _tmp0_ = gee_iterator_unfold (G_TYPE_INT, NULL, NULL, ___lambda19__gee_unfold_func, block5_data_ref (_data5_), block5_data_unref, NULL);
756         iter = _tmp0_;
757         k = 0;
758         while (TRUE) {
759                 GeeIterator* _tmp1_;
760                 gboolean _tmp2_ = FALSE;
761                 GeeIterator* _tmp3_;
762                 gpointer _tmp4_ = NULL;
763                 gint _tmp5_;
764                 GeeIterator* _tmp6_;
765                 gpointer _tmp7_ = NULL;
766                 gint _tmp8_;
767                 gint _tmp9_;
768                 _tmp1_ = iter;
769                 _tmp2_ = gee_iterator_next (_tmp1_);
770                 if (!_tmp2_) {
771                         break;
772                 }
773                 _tmp3_ = iter;
774                 _tmp4_ = gee_iterator_get (_tmp3_);
775                 _tmp5_ = k;
776                 _vala_assert (((gint) ((gintptr) _tmp4_)) == _tmp5_, "iter.get () == k");
777                 _tmp6_ = iter;
778                 _tmp7_ = gee_iterator_get (_tmp6_);
779                 _tmp8_ = k;
780                 _vala_assert (((gint) ((gintptr) _tmp7_)) == _tmp8_, "iter.get () == k");
781                 _tmp9_ = k;
782                 k = _tmp9_ + 1;
783         }
784         _tmp10_ = k;
785         _vala_assert (_tmp10_ == 10, "k == 10");
786         _g_object_unref0 (iter);
787         block5_data_unref (_data5_);
788         _data5_ = NULL;
789 }
790
791
792 static Block7Data* block7_data_ref (Block7Data* _data7_) {
793         g_atomic_int_inc (&_data7_->_ref_count_);
794         return _data7_;
795 }
796
797
798 static void block7_data_unref (void * _userdata_) {
799         Block7Data* _data7_;
800         _data7_ = (Block7Data*) _userdata_;
801         if (g_atomic_int_dec_and_test (&_data7_->_ref_count_)) {
802                 FunctionsTests * self;
803                 self = _data7_->self;
804                 _g_object_unref0 (self);
805                 g_slice_free (Block7Data, _data7_);
806         }
807 }
808
809
810 static Block8Data* block8_data_ref (Block8Data* _data8_) {
811         g_atomic_int_inc (&_data8_->_ref_count_);
812         return _data8_;
813 }
814
815
816 static void block8_data_unref (void * _userdata_) {
817         Block8Data* _data8_;
818         _data8_ = (Block8Data*) _userdata_;
819         if (g_atomic_int_dec_and_test (&_data8_->_ref_count_)) {
820                 FunctionsTests * self;
821                 self = _data8_->_data7_->self;
822                 block7_data_unref (_data8_->_data7_);
823                 _data8_->_data7_ = NULL;
824                 g_slice_free (Block8Data, _data8_);
825         }
826 }
827
828
829 static GeeLazy* __lambda22_ (Block8Data* _data8_) {
830         Block7Data* _data7_;
831         FunctionsTests * self;
832         GeeLazy* result = NULL;
833         gint _tmp0_;
834         gint _tmp1_;
835         gint _tmp2_;
836         GeeLazy* _tmp3_;
837         _data7_ = _data8_->_data7_;
838         self = _data7_->self;
839         _tmp0_ = _data8_->j;
840         _tmp1_ = _data8_->start;
841         if (_tmp0_ == (_tmp1_ + 3)) {
842                 result = NULL;
843                 return result;
844         }
845         _tmp2_ = _data8_->j;
846         _data8_->j = _tmp2_ + 1;
847         _tmp3_ = gee_lazy_new_from_value (G_TYPE_INT, NULL, NULL, (gpointer) ((gintptr) _tmp2_));
848         result = _tmp3_;
849         return result;
850 }
851
852
853 static GeeLazy* ___lambda22__gee_unfold_func (gpointer self) {
854         GeeLazy* result;
855         result = __lambda22_ (self);
856         return result;
857 }
858
859
860 static GeeLazy* __lambda21_ (Block7Data* _data7_) {
861         FunctionsTests * self;
862         GeeLazy* result = NULL;
863         Block8Data* _data8_;
864         gint _tmp0_;
865         gint _tmp1_;
866         gint _tmp2_;
867         GeeIterator* _tmp3_ = NULL;
868         GeeIterator* iter;
869         GeeIterator* _tmp4_;
870         GeeLazy* _tmp5_;
871         self = _data7_->self;
872         _data8_ = g_slice_new0 (Block8Data);
873         _data8_->_ref_count_ = 1;
874         _data8_->_data7_ = block7_data_ref (_data7_);
875         _tmp0_ = _data7_->i;
876         if (_tmp0_ >= 3) {
877                 result = NULL;
878                 block8_data_unref (_data8_);
879                 _data8_ = NULL;
880                 return result;
881         }
882         _tmp1_ = _data7_->i;
883         _data7_->i = _tmp1_ + 1;
884         _data8_->j = _tmp1_ * 3;
885         _tmp2_ = _data8_->j;
886         _data8_->start = _tmp2_;
887         _tmp3_ = gee_iterator_unfold (G_TYPE_INT, NULL, NULL, ___lambda22__gee_unfold_func, block8_data_ref (_data8_), block8_data_unref, NULL);
888         iter = _tmp3_;
889         _tmp4_ = iter;
890         _tmp5_ = gee_lazy_new_from_value (GEE_TYPE_ITERATOR, (GBoxedCopyFunc) g_object_ref, g_object_unref, _tmp4_);
891         result = _tmp5_;
892         _g_object_unref0 (iter);
893         block8_data_unref (_data8_);
894         _data8_ = NULL;
895         return result;
896 }
897
898
899 static GeeLazy* ___lambda21__gee_unfold_func (gpointer self) {
900         GeeLazy* result;
901         result = __lambda21_ (self);
902         return result;
903 }
904
905
906 void functions_tests_test_concat (FunctionsTests* self) {
907         Block7Data* _data7_;
908         GeeIterator* _tmp0_ = NULL;
909         GeeIterator* iter_;
910         gint j;
911         GeeIterator* _tmp1_;
912         GeeIterator* _tmp2_ = NULL;
913         GeeIterator* iter;
914         gint _tmp12_;
915         gint _tmp13_;
916         g_return_if_fail (self != NULL);
917         _data7_ = g_slice_new0 (Block7Data);
918         _data7_->_ref_count_ = 1;
919         _data7_->self = g_object_ref (self);
920         _data7_->i = 0;
921         _tmp0_ = gee_iterator_unfold (GEE_TYPE_ITERATOR, (GBoxedCopyFunc) g_object_ref, g_object_unref, ___lambda21__gee_unfold_func, block7_data_ref (_data7_), block7_data_unref, NULL);
922         iter_ = _tmp0_;
923         j = 0;
924         _tmp1_ = iter_;
925         _tmp2_ = gee_iterator_concat (G_TYPE_INT, NULL, NULL, _tmp1_);
926         iter = _tmp2_;
927         while (TRUE) {
928                 GeeIterator* _tmp3_;
929                 gboolean _tmp4_ = FALSE;
930                 gint _tmp5_;
931                 GeeIterator* _tmp6_;
932                 gpointer _tmp7_ = NULL;
933                 gint _tmp8_;
934                 GeeIterator* _tmp9_;
935                 gpointer _tmp10_ = NULL;
936                 gint _tmp11_;
937                 _tmp3_ = iter;
938                 _tmp4_ = gee_iterator_next (_tmp3_);
939                 if (!_tmp4_) {
940                         break;
941                 }
942                 _tmp5_ = j;
943                 _tmp6_ = iter;
944                 _tmp7_ = gee_iterator_get (_tmp6_);
945                 _vala_assert (_tmp5_ == ((gint) ((gintptr) _tmp7_)), "j == iter.get ()");
946                 _tmp8_ = j;
947                 _tmp9_ = iter;
948                 _tmp10_ = gee_iterator_get (_tmp9_);
949                 _vala_assert (_tmp8_ == ((gint) ((gintptr) _tmp10_)), "j == iter.get ()");
950                 _tmp11_ = j;
951                 j = _tmp11_ + 1;
952         }
953         _tmp12_ = _data7_->i;
954         _vala_assert (_tmp12_ == 3, "i == 3");
955         _tmp13_ = j;
956         _vala_assert (_tmp13_ == 9, "j == 9");
957         _g_object_unref0 (iter);
958         _g_object_unref0 (iter_);
959         block7_data_unref (_data7_);
960         _data7_ = NULL;
961 }
962
963
964 static FunctionsTestsMyComparable* functions_tests_my_comparable_construct (GType object_type, gint i) {
965         FunctionsTestsMyComparable * self = NULL;
966         gint _tmp0_;
967         self = (FunctionsTestsMyComparable*) g_object_new (object_type, NULL);
968         _tmp0_ = i;
969         self->priv->i = _tmp0_;
970         return self;
971 }
972
973
974 static FunctionsTestsMyComparable* functions_tests_my_comparable_new (gint i) {
975         return functions_tests_my_comparable_construct (FUNCTIONS_TESTS_TYPE_MY_COMPARABLE, i);
976 }
977
978
979 static gint functions_tests_my_comparable_real_compare_to (GeeComparable* base, FunctionsTestsMyComparable* cmp) {
980         FunctionsTestsMyComparable * self;
981         gint result = 0;
982         gint _tmp0_;
983         FunctionsTestsMyComparable* _tmp1_;
984         gint _tmp2_;
985         self = (FunctionsTestsMyComparable*) base;
986         g_return_val_if_fail (cmp != NULL, 0);
987         _tmp0_ = self->priv->i;
988         _tmp1_ = cmp;
989         _tmp2_ = _tmp1_->priv->i;
990         if (_tmp0_ == _tmp2_) {
991                 result = 0;
992                 return result;
993         } else {
994                 gint _tmp3_;
995                 FunctionsTestsMyComparable* _tmp4_;
996                 gint _tmp5_;
997                 _tmp3_ = self->priv->i;
998                 _tmp4_ = cmp;
999                 _tmp5_ = _tmp4_->priv->i;
1000                 if (_tmp3_ >= _tmp5_) {
1001                         result = 1;
1002                         return result;
1003                 } else {
1004                         result = -1;
1005                         return result;
1006                 }
1007         }
1008 }
1009
1010
1011 static void functions_tests_my_comparable_class_init (FunctionsTestsMyComparableClass * klass) {
1012         functions_tests_my_comparable_parent_class = g_type_class_peek_parent (klass);
1013         g_type_class_add_private (klass, sizeof (FunctionsTestsMyComparablePrivate));
1014         G_OBJECT_CLASS (klass)->finalize = functions_tests_my_comparable_finalize;
1015 }
1016
1017
1018 static void functions_tests_my_comparable_gee_comparable_interface_init (GeeComparableIface * iface) {
1019         functions_tests_my_comparable_gee_comparable_parent_iface = g_type_interface_peek_parent (iface);
1020         iface->compare_to = (gint (*)(GeeComparable*, gconstpointer)) functions_tests_my_comparable_real_compare_to;
1021 }
1022
1023
1024 static void functions_tests_my_comparable_instance_init (FunctionsTestsMyComparable * self) {
1025         self->priv = FUNCTIONS_TESTS_MY_COMPARABLE_GET_PRIVATE (self);
1026 }
1027
1028
1029 static void functions_tests_my_comparable_finalize (GObject* obj) {
1030         FunctionsTestsMyComparable * self;
1031         self = G_TYPE_CHECK_INSTANCE_CAST (obj, FUNCTIONS_TESTS_TYPE_MY_COMPARABLE, FunctionsTestsMyComparable);
1032         G_OBJECT_CLASS (functions_tests_my_comparable_parent_class)->finalize (obj);
1033 }
1034
1035
1036 static GType functions_tests_my_comparable_get_type (void) {
1037         static volatile gsize functions_tests_my_comparable_type_id__volatile = 0;
1038         if (g_once_init_enter (&functions_tests_my_comparable_type_id__volatile)) {
1039                 static const GTypeInfo g_define_type_info = { sizeof (FunctionsTestsMyComparableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) functions_tests_my_comparable_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FunctionsTestsMyComparable), 0, (GInstanceInitFunc) functions_tests_my_comparable_instance_init, NULL };
1040                 static const GInterfaceInfo gee_comparable_info = { (GInterfaceInitFunc) functions_tests_my_comparable_gee_comparable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
1041                 GType functions_tests_my_comparable_type_id;
1042                 functions_tests_my_comparable_type_id = g_type_register_static (G_TYPE_OBJECT, "FunctionsTestsMyComparable", &g_define_type_info, 0);
1043                 g_type_add_interface_static (functions_tests_my_comparable_type_id, GEE_TYPE_COMPARABLE, &gee_comparable_info);
1044                 g_once_init_leave (&functions_tests_my_comparable_type_id__volatile, functions_tests_my_comparable_type_id);
1045         }
1046         return functions_tests_my_comparable_type_id__volatile;
1047 }
1048
1049
1050 static FunctionsTestsMyHashable* functions_tests_my_hashable_construct (GType object_type, gint i) {
1051         FunctionsTestsMyHashable * self = NULL;
1052         gint _tmp0_;
1053         self = (FunctionsTestsMyHashable*) g_object_new (object_type, NULL);
1054         _tmp0_ = i;
1055         self->priv->i = _tmp0_;
1056         return self;
1057 }
1058
1059
1060 static FunctionsTestsMyHashable* functions_tests_my_hashable_new (gint i) {
1061         return functions_tests_my_hashable_construct (FUNCTIONS_TESTS_TYPE_MY_HASHABLE, i);
1062 }
1063
1064
1065 static gint functions_tests_my_hashable_real_compare_to (GeeComparable* base, FunctionsTestsMyHashable* cmp) {
1066         FunctionsTestsMyHashable * self;
1067         gint result = 0;
1068         gint _tmp0_;
1069         FunctionsTestsMyHashable* _tmp1_;
1070         gint _tmp2_;
1071         self = (FunctionsTestsMyHashable*) base;
1072         g_return_val_if_fail (cmp != NULL, 0);
1073         _tmp0_ = self->priv->i;
1074         _tmp1_ = cmp;
1075         _tmp2_ = _tmp1_->priv->i;
1076         if (_tmp0_ == _tmp2_) {
1077                 result = 0;
1078                 return result;
1079         } else {
1080                 gint _tmp3_;
1081                 FunctionsTestsMyHashable* _tmp4_;
1082                 gint _tmp5_;
1083                 _tmp3_ = self->priv->i;
1084                 _tmp4_ = cmp;
1085                 _tmp5_ = _tmp4_->priv->i;
1086                 if (_tmp3_ >= _tmp5_) {
1087                         result = 1;
1088                         return result;
1089                 } else {
1090                         result = -1;
1091                         return result;
1092                 }
1093         }
1094 }
1095
1096
1097 static guint functions_tests_my_hashable_real_hash (GeeHashable* base) {
1098         FunctionsTestsMyHashable * self;
1099         guint result = 0U;
1100         gint _tmp0_;
1101         self = (FunctionsTestsMyHashable*) base;
1102         _tmp0_ = self->priv->i;
1103         result = (guint) _tmp0_;
1104         return result;
1105 }
1106
1107
1108 static gboolean functions_tests_my_hashable_real_equal_to (GeeHashable* base, FunctionsTestsMyHashable* hash) {
1109         FunctionsTestsMyHashable * self;
1110         gboolean result = FALSE;
1111         gboolean _tmp0_ = FALSE;
1112         gint _tmp1_;
1113         FunctionsTestsMyHashable* _tmp2_;
1114         gint _tmp3_;
1115         gboolean _tmp5_;
1116         self = (FunctionsTestsMyHashable*) base;
1117         g_return_val_if_fail (hash != NULL, FALSE);
1118         _tmp1_ = self->priv->i;
1119         _tmp2_ = hash;
1120         _tmp3_ = _tmp2_->priv->i;
1121         if (_tmp1_ == _tmp3_) {
1122                 gint _tmp4_;
1123                 _tmp4_ = self->priv->i;
1124                 _tmp0_ = _tmp4_ != (-1);
1125         } else {
1126                 _tmp0_ = FALSE;
1127         }
1128         _tmp5_ = _tmp0_;
1129         result = _tmp5_;
1130         return result;
1131 }
1132
1133
1134 static void functions_tests_my_hashable_class_init (FunctionsTestsMyHashableClass * klass) {
1135         functions_tests_my_hashable_parent_class = g_type_class_peek_parent (klass);
1136         g_type_class_add_private (klass, sizeof (FunctionsTestsMyHashablePrivate));
1137         G_OBJECT_CLASS (klass)->finalize = functions_tests_my_hashable_finalize;
1138 }
1139
1140
1141 static void functions_tests_my_hashable_gee_comparable_interface_init (GeeComparableIface * iface) {
1142         functions_tests_my_hashable_gee_comparable_parent_iface = g_type_interface_peek_parent (iface);
1143         iface->compare_to = (gint (*)(GeeComparable*, gconstpointer)) functions_tests_my_hashable_real_compare_to;
1144 }
1145
1146
1147 static void functions_tests_my_hashable_gee_hashable_interface_init (GeeHashableIface * iface) {
1148         functions_tests_my_hashable_gee_hashable_parent_iface = g_type_interface_peek_parent (iface);
1149         iface->hash = (guint (*)(GeeHashable*)) functions_tests_my_hashable_real_hash;
1150         iface->equal_to = (gboolean (*)(GeeHashable*, gconstpointer)) functions_tests_my_hashable_real_equal_to;
1151 }
1152
1153
1154 static void functions_tests_my_hashable_instance_init (FunctionsTestsMyHashable * self) {
1155         self->priv = FUNCTIONS_TESTS_MY_HASHABLE_GET_PRIVATE (self);
1156 }
1157
1158
1159 static void functions_tests_my_hashable_finalize (GObject* obj) {
1160         FunctionsTestsMyHashable * self;
1161         self = G_TYPE_CHECK_INSTANCE_CAST (obj, FUNCTIONS_TESTS_TYPE_MY_HASHABLE, FunctionsTestsMyHashable);
1162         G_OBJECT_CLASS (functions_tests_my_hashable_parent_class)->finalize (obj);
1163 }
1164
1165
1166 static GType functions_tests_my_hashable_get_type (void) {
1167         static volatile gsize functions_tests_my_hashable_type_id__volatile = 0;
1168         if (g_once_init_enter (&functions_tests_my_hashable_type_id__volatile)) {
1169                 static const GTypeInfo g_define_type_info = { sizeof (FunctionsTestsMyHashableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) functions_tests_my_hashable_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FunctionsTestsMyHashable), 0, (GInstanceInitFunc) functions_tests_my_hashable_instance_init, NULL };
1170                 static const GInterfaceInfo gee_comparable_info = { (GInterfaceInitFunc) functions_tests_my_hashable_gee_comparable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
1171                 static const GInterfaceInfo gee_hashable_info = { (GInterfaceInitFunc) functions_tests_my_hashable_gee_hashable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
1172                 GType functions_tests_my_hashable_type_id;
1173                 functions_tests_my_hashable_type_id = g_type_register_static (G_TYPE_OBJECT, "FunctionsTestsMyHashable", &g_define_type_info, 0);
1174                 g_type_add_interface_static (functions_tests_my_hashable_type_id, GEE_TYPE_COMPARABLE, &gee_comparable_info);
1175                 g_type_add_interface_static (functions_tests_my_hashable_type_id, GEE_TYPE_HASHABLE, &gee_hashable_info);
1176                 g_once_init_leave (&functions_tests_my_hashable_type_id__volatile, functions_tests_my_hashable_type_id);
1177         }
1178         return functions_tests_my_hashable_type_id__volatile;
1179 }
1180
1181
1182 static void functions_tests_class_init (FunctionsTestsClass * klass) {
1183         functions_tests_parent_class = g_type_class_peek_parent (klass);
1184 }
1185
1186
1187 static void functions_tests_instance_init (FunctionsTests * self) {
1188 }
1189
1190
1191 GType functions_tests_get_type (void) {
1192         static volatile gsize functions_tests_type_id__volatile = 0;
1193         if (g_once_init_enter (&functions_tests_type_id__volatile)) {
1194                 static const GTypeInfo g_define_type_info = { sizeof (FunctionsTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) functions_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FunctionsTests), 0, (GInstanceInitFunc) functions_tests_instance_init, NULL };
1195                 GType functions_tests_type_id;
1196                 functions_tests_type_id = g_type_register_static (GEE_TYPE_TEST_CASE, "FunctionsTests", &g_define_type_info, 0);
1197                 g_once_init_leave (&functions_tests_type_id__volatile, functions_tests_type_id);
1198         }
1199         return functions_tests_type_id__volatile;
1200 }
1201
1202
1203