Update Changelog
[profile/ivi/libgee.git] / tests / testdata.c
1 /* testdata.c generated by valac 0.18.0, the Vala compiler
2  * generated from testdata.vala, do not modify */
3
4 /* testcollection.vala
5  *
6  * Copyright (C) 2012  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 <gobject/gvaluecollector.h>
31
32
33 #define TYPE_TEST_DATA (test_data_get_type ())
34 #define TEST_DATA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TEST_DATA, TestData))
35 #define TEST_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TEST_DATA, TestDataClass))
36 #define IS_TEST_DATA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TEST_DATA))
37 #define IS_TEST_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TEST_DATA))
38 #define TEST_DATA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TEST_DATA, TestDataClass))
39
40 typedef struct _TestData TestData;
41 typedef struct _TestDataClass TestDataClass;
42 typedef struct _TestDataPrivate TestDataPrivate;
43 #define _g_type_class_unref0(var) ((var == NULL) ? NULL : (var = (g_type_class_unref (var), NULL)))
44 #define _g_free0(var) (var = (g_free (var), NULL))
45 typedef struct _ParamSpecTestData ParamSpecTestData;
46
47 struct _TestData {
48         GTypeInstance parent_instance;
49         volatile int ref_count;
50         TestDataPrivate * priv;
51 };
52
53 struct _TestDataClass {
54         GTypeClass parent_class;
55         void (*finalize) (TestData *self);
56 };
57
58 struct _ParamSpecTestData {
59         GParamSpec parent_instance;
60 };
61
62
63 static gpointer test_data_parent_class = NULL;
64 static gchar** test_data_ones;
65 static gint test_data_ones_length1;
66 static gchar** test_data_ones = NULL;
67 static gint test_data_ones_length1 = 0;
68 static gint _test_data_ones_size_ = 0;
69 static gchar** test_data_tens;
70 static gint test_data_tens_length1;
71 static gchar** test_data_tens = NULL;
72 static gint test_data_tens_length1 = 0;
73 static gint _test_data_tens_size_ = 0;
74 static gchar* test_data_hundred;
75 static gchar* test_data_hundred = NULL;
76 static gchar** test_data_thousands;
77 static gint test_data_thousands_length1;
78 static gchar** test_data_thousands = NULL;
79 static gint test_data_thousands_length1 = 0;
80 static gint _test_data_thousands_size_ = 0;
81 static guint test_data_DATA_SIZE;
82 static guint test_data_DATA_SIZE = 0U;
83 static gchar** test_data_data;
84 static gint test_data_data_length1;
85 static gchar** test_data_data = NULL;
86 static gint test_data_data_length1 = 0;
87 static gint _test_data_data_size_ = 0;
88 static gchar** test_data_sorted_data;
89 static gint test_data_sorted_data_length1;
90 static gchar** test_data_sorted_data = NULL;
91 static gint test_data_sorted_data_length1 = 0;
92 static gint _test_data_sorted_data_size_ = 0;
93 static guint* test_data_random_idx;
94 static gint test_data_random_idx_length1;
95 static guint* test_data_random_idx = NULL;
96 static gint test_data_random_idx_length1 = 0;
97 static gint _test_data_random_idx_size_ = 0;
98
99 gpointer test_data_ref (gpointer instance);
100 void test_data_unref (gpointer instance);
101 GParamSpec* param_spec_test_data (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
102 void value_set_test_data (GValue* value, gpointer v_object);
103 void value_take_test_data (GValue* value, gpointer v_object);
104 gpointer value_get_test_data (const GValue* value);
105 GType test_data_get_type (void) G_GNUC_CONST;
106 enum  {
107         TEST_DATA_DUMMY_PROPERTY
108 };
109 static guint test_data_data_size (void);
110 static gchar** test_data_create_data (guint count, int* result_length1);
111 static gchar** test_data_sort_array (gchar** array, int array_length1, int* result_length1);
112 static gchar** _vala_array_dup1 (gchar** self, int length);
113 static guint* test_data_draw_numbers (guint n, guint k, int* result_length1);
114 #define TEST_DATA_RND_IDX_SIZE ((guint) 8)
115 gchar** test_data_get_data (int* result_length1);
116 gchar** test_data_get_sorted_data (int* result_length1);
117 guint* test_data_get_drawn_numbers (int* result_length1);
118 static gchar* test_data_print3digit (guint n);
119 static gint __lambda2_ (const gchar* a, const gchar* b);
120 static gint ___lambda2__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self);
121 TestData* test_data_new (void);
122 TestData* test_data_construct (GType object_type);
123 static void test_data_finalize (TestData* obj);
124 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
125 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
126
127
128 static gchar** _vala_array_dup1 (gchar** self, int length) {
129         gchar** result;
130         int i;
131         result = g_new0 (gchar*, length + 1);
132         for (i = 0; i < length; i++) {
133                 gchar* _tmp0_;
134                 _tmp0_ = g_strdup (self[i]);
135                 result[i] = _tmp0_;
136         }
137         return result;
138 }
139
140
141 static guint test_data_data_size (void) {
142         guint result = 0U;
143         gint _tmp0_ = 0;
144         gboolean _tmp1_ = FALSE;
145         gint _tmp2_;
146         _tmp1_ = g_test_quick ();
147         if (_tmp1_) {
148                 _tmp0_ = 128;
149         } else {
150                 _tmp0_ = 1024;
151         }
152         _tmp2_ = _tmp0_;
153         result = (guint) _tmp2_;
154         return result;
155 }
156
157
158 gchar** test_data_get_data (int* result_length1) {
159         gchar** result = NULL;
160         GTypeClass* _tmp0_ = NULL;
161         GTypeClass* klass;
162         gchar** _tmp1_;
163         gint _tmp1__length1;
164         gchar** _tmp2_;
165         gint _tmp2__length1;
166         _tmp0_ = g_type_class_ref (TYPE_TEST_DATA);
167         klass = _tmp0_;
168         G_TYPE_FROM_CLASS (klass);
169         _tmp1_ = test_data_data;
170         _tmp1__length1 = test_data_data_length1;
171         _tmp2_ = _tmp1_;
172         _tmp2__length1 = _tmp1__length1;
173         if (result_length1) {
174                 *result_length1 = _tmp2__length1;
175         }
176         result = _tmp2_;
177         _g_type_class_unref0 (klass);
178         return result;
179 }
180
181
182 gchar** test_data_get_sorted_data (int* result_length1) {
183         gchar** result = NULL;
184         GTypeClass* _tmp0_ = NULL;
185         GTypeClass* klass;
186         gchar** _tmp1_;
187         gint _tmp1__length1;
188         gchar** _tmp2_;
189         gint _tmp2__length1;
190         _tmp0_ = g_type_class_ref (TYPE_TEST_DATA);
191         klass = _tmp0_;
192         G_TYPE_FROM_CLASS (klass);
193         _tmp1_ = test_data_sorted_data;
194         _tmp1__length1 = test_data_sorted_data_length1;
195         _tmp2_ = _tmp1_;
196         _tmp2__length1 = _tmp1__length1;
197         if (result_length1) {
198                 *result_length1 = _tmp2__length1;
199         }
200         result = _tmp2_;
201         _g_type_class_unref0 (klass);
202         return result;
203 }
204
205
206 guint* test_data_get_drawn_numbers (int* result_length1) {
207         guint* result = NULL;
208         GTypeClass* _tmp0_ = NULL;
209         GTypeClass* klass;
210         guint* _tmp1_;
211         gint _tmp1__length1;
212         guint* _tmp2_;
213         gint _tmp2__length1;
214         _tmp0_ = g_type_class_ref (TYPE_TEST_DATA);
215         klass = _tmp0_;
216         G_TYPE_FROM_CLASS (klass);
217         _tmp1_ = test_data_random_idx;
218         _tmp1__length1 = test_data_random_idx_length1;
219         _tmp2_ = _tmp1_;
220         _tmp2__length1 = _tmp1__length1;
221         if (result_length1) {
222                 *result_length1 = _tmp2__length1;
223         }
224         result = _tmp2_;
225         _g_type_class_unref0 (klass);
226         return result;
227 }
228
229
230 static guint* test_data_draw_numbers (guint n, guint k, int* result_length1) {
231         guint* result = NULL;
232         guint _tmp0_;
233         guint* _tmp1_ = NULL;
234         guint* _result_;
235         gint _result__length1;
236         gint __result__size_;
237         guint _tmp31_;
238         gint _tmp32_ = 0;
239         guint* _tmp33_;
240         gint _tmp33__length1;
241         guint* _tmp34_;
242         gint _tmp34__length1;
243         _tmp0_ = n;
244         _tmp1_ = g_new0 (guint, _tmp0_);
245         _result_ = _tmp1_;
246         _result__length1 = _tmp0_;
247         __result__size_ = _result__length1;
248         {
249                 guint i;
250                 i = (guint) 0;
251                 {
252                         gboolean _tmp2_;
253                         _tmp2_ = TRUE;
254                         while (TRUE) {
255                                 gboolean _tmp3_;
256                                 guint _tmp5_;
257                                 guint _tmp6_;
258                                 guint* _tmp7_;
259                                 gint _tmp7__length1;
260                                 guint _tmp8_;
261                                 guint _tmp9_;
262                                 guint _tmp10_;
263                                 _tmp3_ = _tmp2_;
264                                 if (!_tmp3_) {
265                                         guint _tmp4_;
266                                         _tmp4_ = i;
267                                         i = _tmp4_ + 1;
268                                 }
269                                 _tmp2_ = FALSE;
270                                 _tmp5_ = i;
271                                 _tmp6_ = n;
272                                 if (!(_tmp5_ < _tmp6_)) {
273                                         break;
274                                 }
275                                 _tmp7_ = _result_;
276                                 _tmp7__length1 = _result__length1;
277                                 _tmp8_ = i;
278                                 _tmp9_ = i;
279                                 _tmp7_[_tmp8_] = _tmp9_;
280                                 _tmp10_ = _tmp7_[_tmp8_];
281                         }
282                 }
283         }
284         {
285                 guint _tmp11_;
286                 guint i;
287                 _tmp11_ = n;
288                 i = _tmp11_ - 1;
289                 {
290                         gboolean _tmp12_;
291                         _tmp12_ = TRUE;
292                         while (TRUE) {
293                                 gboolean _tmp13_;
294                                 guint _tmp15_;
295                                 guint _tmp16_;
296                                 gint32 _tmp17_ = 0;
297                                 gint j;
298                                 guint* _tmp18_;
299                                 gint _tmp18__length1;
300                                 guint _tmp19_;
301                                 guint _tmp20_;
302                                 guint tmp;
303                                 guint* _tmp21_;
304                                 gint _tmp21__length1;
305                                 guint _tmp22_;
306                                 guint* _tmp23_;
307                                 gint _tmp23__length1;
308                                 gint _tmp24_;
309                                 guint _tmp25_;
310                                 guint _tmp26_;
311                                 guint* _tmp27_;
312                                 gint _tmp27__length1;
313                                 gint _tmp28_;
314                                 guint _tmp29_;
315                                 guint _tmp30_;
316                                 _tmp13_ = _tmp12_;
317                                 if (!_tmp13_) {
318                                         guint _tmp14_;
319                                         _tmp14_ = i;
320                                         i = _tmp14_ - 1;
321                                 }
322                                 _tmp12_ = FALSE;
323                                 _tmp15_ = i;
324                                 if (!(_tmp15_ >= ((guint) 1))) {
325                                         break;
326                                 }
327                                 _tmp16_ = i;
328                                 _tmp17_ = g_test_rand_int_range ((gint32) 0, (gint32) (_tmp16_ + 1));
329                                 j = (gint) _tmp17_;
330                                 _tmp18_ = _result_;
331                                 _tmp18__length1 = _result__length1;
332                                 _tmp19_ = i;
333                                 _tmp20_ = _tmp18_[_tmp19_];
334                                 tmp = _tmp20_;
335                                 _tmp21_ = _result_;
336                                 _tmp21__length1 = _result__length1;
337                                 _tmp22_ = i;
338                                 _tmp23_ = _result_;
339                                 _tmp23__length1 = _result__length1;
340                                 _tmp24_ = j;
341                                 _tmp25_ = _tmp23_[_tmp24_];
342                                 _tmp21_[_tmp22_] = _tmp25_;
343                                 _tmp26_ = _tmp21_[_tmp22_];
344                                 _tmp27_ = _result_;
345                                 _tmp27__length1 = _result__length1;
346                                 _tmp28_ = j;
347                                 _tmp29_ = tmp;
348                                 _tmp27_[_tmp28_] = _tmp29_;
349                                 _tmp30_ = _tmp27_[_tmp28_];
350                         }
351                 }
352         }
353         _tmp31_ = k;
354         _tmp32_ = (gint) _tmp31_;
355         _result_ = g_renew (guint, _result_, (gint) _tmp31_);
356         (_tmp32_ > _result__length1) ? memset (_result_ + _result__length1, 0, sizeof (guint) * (_tmp32_ - _result__length1)) : NULL;
357         _result__length1 = _tmp32_;
358         __result__size_ = _tmp32_;
359         _tmp33_ = _result_;
360         _tmp33__length1 = _result__length1;
361         _result_ = NULL;
362         _tmp34_ = _tmp33_;
363         _tmp34__length1 = _tmp33__length1;
364         if (result_length1) {
365                 *result_length1 = _tmp34__length1;
366         }
367         result = _tmp34_;
368         _result_ = (g_free (_result_), NULL);
369         return result;
370 }
371
372
373 static gchar* test_data_print3digit (guint n) {
374         gchar* result = NULL;
375         gchar* _tmp0_ = NULL;
376         guint _tmp1_;
377         const gchar* _tmp12_;
378         gchar* _tmp13_;
379         gchar* h;
380         guint _tmp14_;
381         gchar** _tmp15_;
382         gint _tmp15__length1;
383         guint _tmp16_;
384         const gchar* _tmp17_;
385         const gchar* t;
386         guint _tmp18_ = 0U;
387         guint _tmp19_;
388         gchar** _tmp20_;
389         gint _tmp20__length1;
390         guint _tmp23_;
391         gchar** _tmp24_;
392         gint _tmp24__length1;
393         guint _tmp25_;
394         const gchar* _tmp26_;
395         const gchar* o;
396         const gchar* _tmp27_ = NULL;
397         const gchar* _tmp28_;
398         const gchar* _tmp30_ = NULL;
399         gboolean _tmp31_ = FALSE;
400         const gchar* _tmp32_;
401         gboolean _tmp37_;
402         const gchar* _tmp38_ = NULL;
403         const gchar* _tmp39_;
404         const gchar* _tmp41_ = NULL;
405         gboolean _tmp42_ = FALSE;
406         const gchar* _tmp43_;
407         gboolean _tmp45_;
408         const gchar* _tmp46_ = NULL;
409         const gchar* _tmp47_;
410         const gchar* _tmp49_;
411         const gchar* _tmp50_;
412         const gchar* _tmp51_;
413         const gchar* _tmp52_;
414         const gchar* _tmp53_;
415         gchar* _tmp54_ = NULL;
416         _tmp1_ = n;
417         if (_tmp1_ >= ((guint) 200)) {
418                 gchar** _tmp2_;
419                 gint _tmp2__length1;
420                 guint _tmp3_;
421                 const gchar* _tmp4_;
422                 const gchar* _tmp5_;
423                 gchar* _tmp6_ = NULL;
424                 _tmp2_ = test_data_ones;
425                 _tmp2__length1 = test_data_ones_length1;
426                 _tmp3_ = n;
427                 _tmp4_ = _tmp2_[_tmp3_ / 100];
428                 _tmp5_ = test_data_hundred;
429                 _tmp6_ = g_strdup_printf ("%s %s", _tmp4_, _tmp5_);
430                 _g_free0 (_tmp0_);
431                 _tmp0_ = _tmp6_;
432         } else {
433                 const gchar* _tmp7_ = NULL;
434                 guint _tmp8_;
435                 const gchar* _tmp10_;
436                 gchar* _tmp11_;
437                 _tmp8_ = n;
438                 if (_tmp8_ >= ((guint) 100)) {
439                         const gchar* _tmp9_;
440                         _tmp9_ = test_data_hundred;
441                         _tmp7_ = _tmp9_;
442                 } else {
443                         _tmp7_ = NULL;
444                 }
445                 _tmp10_ = _tmp7_;
446                 _tmp11_ = g_strdup (_tmp10_);
447                 _g_free0 (_tmp0_);
448                 _tmp0_ = _tmp11_;
449         }
450         _tmp12_ = _tmp0_;
451         _tmp13_ = g_strdup (_tmp12_);
452         h = _tmp13_;
453         _tmp14_ = n;
454         n = _tmp14_ % 100;
455         _tmp15_ = test_data_tens;
456         _tmp15__length1 = test_data_tens_length1;
457         _tmp16_ = n;
458         _tmp17_ = _tmp15_[_tmp16_ / 10];
459         t = _tmp17_;
460         _tmp19_ = n;
461         _tmp20_ = test_data_ones;
462         _tmp20__length1 = test_data_ones_length1;
463         if (_tmp19_ >= ((guint) _tmp20__length1)) {
464                 guint _tmp21_;
465                 _tmp21_ = n;
466                 _tmp18_ = _tmp21_ % 10;
467         } else {
468                 guint _tmp22_;
469                 _tmp22_ = n;
470                 _tmp18_ = _tmp22_;
471         }
472         _tmp23_ = _tmp18_;
473         n = _tmp23_;
474         _tmp24_ = test_data_ones;
475         _tmp24__length1 = test_data_ones_length1;
476         _tmp25_ = n;
477         _tmp26_ = _tmp24_[_tmp25_];
478         o = _tmp26_;
479         _tmp28_ = h;
480         if (_tmp28_ != NULL) {
481                 const gchar* _tmp29_;
482                 _tmp29_ = h;
483                 _tmp27_ = _tmp29_;
484         } else {
485                 _tmp27_ = "";
486         }
487         _tmp32_ = h;
488         if (_tmp32_ != NULL) {
489                 gboolean _tmp33_ = FALSE;
490                 const gchar* _tmp34_;
491                 gboolean _tmp36_;
492                 _tmp34_ = t;
493                 if (_tmp34_ != NULL) {
494                         _tmp33_ = TRUE;
495                 } else {
496                         const gchar* _tmp35_;
497                         _tmp35_ = o;
498                         _tmp33_ = _tmp35_ != NULL;
499                 }
500                 _tmp36_ = _tmp33_;
501                 _tmp31_ = _tmp36_;
502         } else {
503                 _tmp31_ = FALSE;
504         }
505         _tmp37_ = _tmp31_;
506         if (_tmp37_) {
507                 _tmp30_ = " ";
508         } else {
509                 _tmp30_ = "";
510         }
511         _tmp39_ = t;
512         if (_tmp39_ != NULL) {
513                 const gchar* _tmp40_;
514                 _tmp40_ = t;
515                 _tmp38_ = _tmp40_;
516         } else {
517                 _tmp38_ = "";
518         }
519         _tmp43_ = t;
520         if (_tmp43_ != NULL) {
521                 const gchar* _tmp44_;
522                 _tmp44_ = o;
523                 _tmp42_ = _tmp44_ != NULL;
524         } else {
525                 _tmp42_ = FALSE;
526         }
527         _tmp45_ = _tmp42_;
528         if (_tmp45_) {
529                 _tmp41_ = "-";
530         } else {
531                 _tmp41_ = "";
532         }
533         _tmp47_ = o;
534         if (_tmp47_ != NULL) {
535                 const gchar* _tmp48_;
536                 _tmp48_ = o;
537                 _tmp46_ = _tmp48_;
538         } else {
539                 _tmp46_ = "";
540         }
541         _tmp49_ = _tmp27_;
542         _tmp50_ = _tmp30_;
543         _tmp51_ = _tmp38_;
544         _tmp52_ = _tmp41_;
545         _tmp53_ = _tmp46_;
546         _tmp54_ = g_strdup_printf ("%s%s%s%s%s", _tmp49_, _tmp50_, _tmp51_, _tmp52_, _tmp53_);
547         result = _tmp54_;
548         _g_free0 (h);
549         _g_free0 (_tmp0_);
550         return result;
551 }
552
553
554 static gchar** test_data_create_data (guint count, int* result_length1) {
555         gchar** result = NULL;
556         guint _tmp0_;
557         gchar** _tmp1_ = NULL;
558         gchar** numbers;
559         gint numbers_length1;
560         gint _numbers_size_;
561         gchar** _tmp40_;
562         gint _tmp40__length1;
563         gchar** _tmp41_;
564         gint _tmp41__length1;
565         _tmp0_ = count;
566         _tmp1_ = g_new0 (gchar*, _tmp0_ + 1);
567         numbers = _tmp1_;
568         numbers_length1 = _tmp0_;
569         _numbers_size_ = numbers_length1;
570         {
571                 guint idx;
572                 idx = (guint) 0;
573                 {
574                         gboolean _tmp2_;
575                         _tmp2_ = TRUE;
576                         while (TRUE) {
577                                 gboolean _tmp3_;
578                                 guint _tmp5_;
579                                 guint _tmp6_;
580                                 guint _tmp7_;
581                                 guint n;
582                                 gchar* num;
583                                 guint th;
584                                 const gchar* _tmp34_;
585                                 gchar** _tmp36_;
586                                 gint _tmp36__length1;
587                                 guint _tmp37_;
588                                 gchar* _tmp38_;
589                                 gchar* _tmp39_;
590                                 _tmp3_ = _tmp2_;
591                                 if (!_tmp3_) {
592                                         guint _tmp4_;
593                                         _tmp4_ = idx;
594                                         idx = _tmp4_ + 1;
595                                 }
596                                 _tmp2_ = FALSE;
597                                 _tmp5_ = idx;
598                                 _tmp6_ = count;
599                                 if (!(_tmp5_ < _tmp6_)) {
600                                         break;
601                                 }
602                                 _tmp7_ = idx;
603                                 n = _tmp7_ + 1;
604                                 num = NULL;
605                                 th = (guint) 0;
606                                 while (TRUE) {
607                                         guint _tmp8_;
608                                         guint _tmp9_;
609                                         guint _tmp32_;
610                                         guint _tmp33_;
611                                         _tmp8_ = n;
612                                         if (!(_tmp8_ != ((guint) 0))) {
613                                                 break;
614                                         }
615                                         _tmp9_ = n;
616                                         if ((_tmp9_ % 1000) != ((guint) 0)) {
617                                                 gchar** _tmp10_;
618                                                 gint _tmp10__length1;
619                                                 guint _tmp11_;
620                                                 const gchar* _tmp12_;
621                                                 gchar* _tmp13_;
622                                                 gchar* t;
623                                                 guint _tmp14_;
624                                                 gchar* _tmp15_ = NULL;
625                                                 gchar* c;
626                                                 const gchar* _tmp16_ = NULL;
627                                                 const gchar* _tmp17_;
628                                                 const gchar* _tmp18_ = NULL;
629                                                 const gchar* _tmp19_;
630                                                 const gchar* _tmp21_ = NULL;
631                                                 const gchar* _tmp22_;
632                                                 const gchar* _tmp23_ = NULL;
633                                                 const gchar* _tmp24_;
634                                                 const gchar* _tmp26_;
635                                                 const gchar* _tmp27_;
636                                                 const gchar* _tmp28_;
637                                                 const gchar* _tmp29_;
638                                                 const gchar* _tmp30_;
639                                                 gchar* _tmp31_ = NULL;
640                                                 _tmp10_ = test_data_thousands;
641                                                 _tmp10__length1 = test_data_thousands_length1;
642                                                 _tmp11_ = th;
643                                                 _tmp12_ = _tmp10_[_tmp11_];
644                                                 _tmp13_ = g_strdup (_tmp12_);
645                                                 t = _tmp13_;
646                                                 _tmp14_ = n;
647                                                 _tmp15_ = test_data_print3digit (_tmp14_ % 1000);
648                                                 c = _tmp15_;
649                                                 _tmp17_ = t;
650                                                 if (_tmp17_ != NULL) {
651                                                         _tmp16_ = " ";
652                                                 } else {
653                                                         _tmp16_ = "";
654                                                 }
655                                                 _tmp19_ = t;
656                                                 if (_tmp19_ != NULL) {
657                                                         const gchar* _tmp20_;
658                                                         _tmp20_ = t;
659                                                         _tmp18_ = _tmp20_;
660                                                 } else {
661                                                         _tmp18_ = "";
662                                                 }
663                                                 _tmp22_ = num;
664                                                 if (_tmp22_ != NULL) {
665                                                         _tmp21_ = " ";
666                                                 } else {
667                                                         _tmp21_ = "";
668                                                 }
669                                                 _tmp24_ = num;
670                                                 if (_tmp24_ != NULL) {
671                                                         const gchar* _tmp25_;
672                                                         _tmp25_ = num;
673                                                         _tmp23_ = _tmp25_;
674                                                 } else {
675                                                         _tmp23_ = "";
676                                                 }
677                                                 _tmp26_ = c;
678                                                 _tmp27_ = _tmp16_;
679                                                 _tmp28_ = _tmp18_;
680                                                 _tmp29_ = _tmp21_;
681                                                 _tmp30_ = _tmp23_;
682                                                 _tmp31_ = g_strdup_printf ("%s%s%s%s%s", _tmp26_, _tmp27_, _tmp28_, _tmp29_, _tmp30_);
683                                                 _g_free0 (num);
684                                                 num = _tmp31_;
685                                                 _g_free0 (c);
686                                                 _g_free0 (t);
687                                         }
688                                         _tmp32_ = n;
689                                         n = _tmp32_ / 1000;
690                                         _tmp33_ = th;
691                                         th = _tmp33_ + 1;
692                                 }
693                                 _tmp34_ = num;
694                                 if (_tmp34_ == NULL) {
695                                         gchar* _tmp35_;
696                                         _tmp35_ = g_strdup ("zero");
697                                         _g_free0 (num);
698                                         num = _tmp35_;
699                                 }
700                                 _tmp36_ = numbers;
701                                 _tmp36__length1 = numbers_length1;
702                                 _tmp37_ = idx;
703                                 _tmp38_ = num;
704                                 num = NULL;
705                                 _g_free0 (_tmp36_[_tmp37_]);
706                                 _tmp36_[_tmp37_] = _tmp38_;
707                                 _tmp39_ = _tmp36_[_tmp37_];
708                                 _g_free0 (num);
709                         }
710                 }
711         }
712         _tmp40_ = numbers;
713         _tmp40__length1 = numbers_length1;
714         numbers = NULL;
715         _tmp41_ = _tmp40_;
716         _tmp41__length1 = _tmp40__length1;
717         if (result_length1) {
718                 *result_length1 = _tmp41__length1;
719         }
720         result = _tmp41_;
721         numbers = (_vala_array_free (numbers, numbers_length1, (GDestroyNotify) g_free), NULL);
722         return result;
723 }
724
725
726 static gint __lambda2_ (const gchar* a, const gchar* b) {
727         gint result = 0;
728         GCompareFunc _tmp0_;
729         const gchar* _tmp1_;
730         const gchar* _tmp2_;
731         gint _tmp3_ = 0;
732         g_return_val_if_fail (a != NULL, 0);
733         g_return_val_if_fail (b != NULL, 0);
734         _tmp0_ = g_strcmp0;
735         _tmp1_ = a;
736         _tmp2_ = b;
737         _tmp3_ = _tmp0_ (*((const gchar**) _tmp1_), *((const gchar**) _tmp2_));
738         result = _tmp3_;
739         return result;
740 }
741
742
743 static gint ___lambda2__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self) {
744         gint result;
745         result = __lambda2_ (a, b);
746         return result;
747 }
748
749
750 static gchar** test_data_sort_array (gchar** array, int array_length1, int* result_length1) {
751         gchar** result = NULL;
752         gchar** _tmp0_;
753         gint _tmp0__length1;
754         gchar** _tmp1_;
755         gint _tmp1__length1;
756         gchar** _tmp2_;
757         gint _tmp2__length1;
758         _tmp0_ = array;
759         _tmp0__length1 = array_length1;
760         g_qsort_with_data (_tmp0_, _tmp0__length1, (gsize) sizeof (gchar*), (GCompareDataFunc) ___lambda2__gcompare_data_func, NULL);
761         _tmp1_ = array;
762         _tmp1__length1 = array_length1;
763         array = NULL;
764         _tmp2_ = _tmp1_;
765         _tmp2__length1 = _tmp1__length1;
766         if (result_length1) {
767                 *result_length1 = _tmp2__length1;
768         }
769         result = _tmp2_;
770         array = (_vala_array_free (array, array_length1, (GDestroyNotify) g_free), NULL);
771         return result;
772 }
773
774
775 TestData* test_data_construct (GType object_type) {
776         TestData* self = NULL;
777         self = (TestData*) g_type_create_instance (object_type);
778         return self;
779 }
780
781
782 TestData* test_data_new (void) {
783         return test_data_construct (TYPE_TEST_DATA);
784 }
785
786
787 static void value_test_data_init (GValue* value) {
788         value->data[0].v_pointer = NULL;
789 }
790
791
792 static void value_test_data_free_value (GValue* value) {
793         if (value->data[0].v_pointer) {
794                 test_data_unref (value->data[0].v_pointer);
795         }
796 }
797
798
799 static void value_test_data_copy_value (const GValue* src_value, GValue* dest_value) {
800         if (src_value->data[0].v_pointer) {
801                 dest_value->data[0].v_pointer = test_data_ref (src_value->data[0].v_pointer);
802         } else {
803                 dest_value->data[0].v_pointer = NULL;
804         }
805 }
806
807
808 static gpointer value_test_data_peek_pointer (const GValue* value) {
809         return value->data[0].v_pointer;
810 }
811
812
813 static gchar* value_test_data_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
814         if (collect_values[0].v_pointer) {
815                 TestData* object;
816                 object = collect_values[0].v_pointer;
817                 if (object->parent_instance.g_class == NULL) {
818                         return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
819                 } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
820                         return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
821                 }
822                 value->data[0].v_pointer = test_data_ref (object);
823         } else {
824                 value->data[0].v_pointer = NULL;
825         }
826         return NULL;
827 }
828
829
830 static gchar* value_test_data_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
831         TestData** object_p;
832         object_p = collect_values[0].v_pointer;
833         if (!object_p) {
834                 return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
835         }
836         if (!value->data[0].v_pointer) {
837                 *object_p = NULL;
838         } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
839                 *object_p = value->data[0].v_pointer;
840         } else {
841                 *object_p = test_data_ref (value->data[0].v_pointer);
842         }
843         return NULL;
844 }
845
846
847 GParamSpec* param_spec_test_data (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
848         ParamSpecTestData* spec;
849         g_return_val_if_fail (g_type_is_a (object_type, TYPE_TEST_DATA), NULL);
850         spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
851         G_PARAM_SPEC (spec)->value_type = object_type;
852         return G_PARAM_SPEC (spec);
853 }
854
855
856 gpointer value_get_test_data (const GValue* value) {
857         g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_TEST_DATA), NULL);
858         return value->data[0].v_pointer;
859 }
860
861
862 void value_set_test_data (GValue* value, gpointer v_object) {
863         TestData* old;
864         g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_TEST_DATA));
865         old = value->data[0].v_pointer;
866         if (v_object) {
867                 g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_TEST_DATA));
868                 g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
869                 value->data[0].v_pointer = v_object;
870                 test_data_ref (value->data[0].v_pointer);
871         } else {
872                 value->data[0].v_pointer = NULL;
873         }
874         if (old) {
875                 test_data_unref (old);
876         }
877 }
878
879
880 void value_take_test_data (GValue* value, gpointer v_object) {
881         TestData* old;
882         g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_TEST_DATA));
883         old = value->data[0].v_pointer;
884         if (v_object) {
885                 g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_TEST_DATA));
886                 g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
887                 value->data[0].v_pointer = v_object;
888         } else {
889                 value->data[0].v_pointer = NULL;
890         }
891         if (old) {
892                 test_data_unref (old);
893         }
894 }
895
896
897 static void test_data_class_init (TestDataClass * klass) {
898         gchar* _tmp0_;
899         gchar* _tmp1_;
900         gchar* _tmp2_;
901         gchar* _tmp3_;
902         gchar* _tmp4_;
903         gchar* _tmp5_;
904         gchar* _tmp6_;
905         gchar* _tmp7_;
906         gchar* _tmp8_;
907         gchar* _tmp9_;
908         gchar* _tmp10_;
909         gchar* _tmp11_;
910         gchar* _tmp12_;
911         gchar* _tmp13_;
912         gchar* _tmp14_;
913         gchar* _tmp15_;
914         gchar* _tmp16_;
915         gchar* _tmp17_;
916         gchar* _tmp18_;
917         gchar** _tmp19_ = NULL;
918         gchar* _tmp20_;
919         gchar* _tmp21_;
920         gchar* _tmp22_;
921         gchar* _tmp23_;
922         gchar* _tmp24_;
923         gchar* _tmp25_;
924         gchar* _tmp26_;
925         gchar* _tmp27_;
926         gchar** _tmp28_ = NULL;
927         gchar* _tmp29_;
928         gchar* _tmp30_;
929         gchar* _tmp31_;
930         gchar* _tmp32_;
931         gchar* _tmp33_;
932         gchar** _tmp34_ = NULL;
933         guint _tmp35_ = 0U;
934         guint _tmp36_;
935         gint _tmp37_ = 0;
936         gchar** _tmp38_ = NULL;
937         gchar** _tmp39_;
938         gint _tmp39__length1;
939         gchar** _tmp40_;
940         gint _tmp40__length1;
941         gint _tmp41_ = 0;
942         gchar** _tmp42_ = NULL;
943         guint _tmp43_;
944         gint _tmp44_ = 0;
945         guint* _tmp45_ = NULL;
946         test_data_parent_class = g_type_class_peek_parent (klass);
947         TEST_DATA_CLASS (klass)->finalize = test_data_finalize;
948         _tmp0_ = g_strdup ("one");
949         _tmp1_ = g_strdup ("two");
950         _tmp2_ = g_strdup ("three");
951         _tmp3_ = g_strdup ("four");
952         _tmp4_ = g_strdup ("five");
953         _tmp5_ = g_strdup ("six");
954         _tmp6_ = g_strdup ("seven");
955         _tmp7_ = g_strdup ("eight");
956         _tmp8_ = g_strdup ("nine");
957         _tmp9_ = g_strdup ("ten");
958         _tmp10_ = g_strdup ("eleven");
959         _tmp11_ = g_strdup ("twelve");
960         _tmp12_ = g_strdup ("thirteen");
961         _tmp13_ = g_strdup ("fourteen");
962         _tmp14_ = g_strdup ("fifteen");
963         _tmp15_ = g_strdup ("sixteen");
964         _tmp16_ = g_strdup ("seventeen");
965         _tmp17_ = g_strdup ("eighteen");
966         _tmp18_ = g_strdup ("nineteen");
967         _tmp19_ = g_new0 (gchar*, 20 + 1);
968         _tmp19_[0] = NULL;
969         _tmp19_[1] = _tmp0_;
970         _tmp19_[2] = _tmp1_;
971         _tmp19_[3] = _tmp2_;
972         _tmp19_[4] = _tmp3_;
973         _tmp19_[5] = _tmp4_;
974         _tmp19_[6] = _tmp5_;
975         _tmp19_[7] = _tmp6_;
976         _tmp19_[8] = _tmp7_;
977         _tmp19_[9] = _tmp8_;
978         _tmp19_[10] = _tmp9_;
979         _tmp19_[11] = _tmp10_;
980         _tmp19_[12] = _tmp11_;
981         _tmp19_[13] = _tmp12_;
982         _tmp19_[14] = _tmp13_;
983         _tmp19_[15] = _tmp14_;
984         _tmp19_[16] = _tmp15_;
985         _tmp19_[17] = _tmp16_;
986         _tmp19_[18] = _tmp17_;
987         _tmp19_[19] = _tmp18_;
988         test_data_ones = _tmp19_;
989         test_data_ones_length1 = 20;
990         _tmp20_ = g_strdup ("twenty");
991         _tmp21_ = g_strdup ("thirty");
992         _tmp22_ = g_strdup ("forty");
993         _tmp23_ = g_strdup ("fifty");
994         _tmp24_ = g_strdup ("sixty");
995         _tmp25_ = g_strdup ("seventy");
996         _tmp26_ = g_strdup ("eighty");
997         _tmp27_ = g_strdup ("ninety");
998         _tmp28_ = g_new0 (gchar*, 10 + 1);
999         _tmp28_[0] = NULL;
1000         _tmp28_[1] = NULL;
1001         _tmp28_[2] = _tmp20_;
1002         _tmp28_[3] = _tmp21_;
1003         _tmp28_[4] = _tmp22_;
1004         _tmp28_[5] = _tmp23_;
1005         _tmp28_[6] = _tmp24_;
1006         _tmp28_[7] = _tmp25_;
1007         _tmp28_[8] = _tmp26_;
1008         _tmp28_[9] = _tmp27_;
1009         test_data_tens = _tmp28_;
1010         test_data_tens_length1 = 10;
1011         _tmp29_ = g_strdup ("hundred");
1012         test_data_hundred = _tmp29_;
1013         _tmp30_ = g_strdup ("thousand");
1014         _tmp31_ = g_strdup ("million");
1015         _tmp32_ = g_strdup ("billion");
1016         _tmp33_ = g_strdup ("trillion");
1017         _tmp34_ = g_new0 (gchar*, 5 + 1);
1018         _tmp34_[0] = NULL;
1019         _tmp34_[1] = _tmp30_;
1020         _tmp34_[2] = _tmp31_;
1021         _tmp34_[3] = _tmp32_;
1022         _tmp34_[4] = _tmp33_;
1023         test_data_thousands = _tmp34_;
1024         test_data_thousands_length1 = 5;
1025         _tmp35_ = test_data_data_size ();
1026         test_data_DATA_SIZE = _tmp35_;
1027         _tmp36_ = test_data_DATA_SIZE;
1028         _tmp38_ = test_data_create_data (_tmp36_, &_tmp37_);
1029         test_data_data = _tmp38_;
1030         _tmp39_ = test_data_data;
1031         _tmp39__length1 = test_data_data_length1;
1032         _tmp40_ = (_tmp39_ != NULL) ? _vala_array_dup1 (_tmp39_, _tmp39__length1) : ((gpointer) _tmp39_);
1033         _tmp40__length1 = _tmp39__length1;
1034         _tmp42_ = test_data_sort_array (_tmp40_, _tmp40__length1, &_tmp41_);
1035         test_data_sorted_data = _tmp42_;
1036         _tmp43_ = test_data_DATA_SIZE;
1037         _tmp45_ = test_data_draw_numbers (_tmp43_, TEST_DATA_RND_IDX_SIZE, &_tmp44_);
1038         test_data_random_idx = _tmp45_;
1039 }
1040
1041
1042 static void test_data_instance_init (TestData * self) {
1043         self->ref_count = 1;
1044 }
1045
1046
1047 static void test_data_finalize (TestData* obj) {
1048         TestData * self;
1049         self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_TEST_DATA, TestData);
1050 }
1051
1052
1053 GType test_data_get_type (void) {
1054         static volatile gsize test_data_type_id__volatile = 0;
1055         if (g_once_init_enter (&test_data_type_id__volatile)) {
1056                 static const GTypeValueTable g_define_type_value_table = { value_test_data_init, value_test_data_free_value, value_test_data_copy_value, value_test_data_peek_pointer, "p", value_test_data_collect_value, "p", value_test_data_lcopy_value };
1057                 static const GTypeInfo g_define_type_info = { sizeof (TestDataClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) test_data_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TestData), 0, (GInstanceInitFunc) test_data_instance_init, &g_define_type_value_table };
1058                 static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
1059                 GType test_data_type_id;
1060                 test_data_type_id = g_type_register_fundamental (g_type_fundamental_next (), "TestData", &g_define_type_info, &g_define_type_fundamental_info, 0);
1061                 g_once_init_leave (&test_data_type_id__volatile, test_data_type_id);
1062         }
1063         return test_data_type_id__volatile;
1064 }
1065
1066
1067 gpointer test_data_ref (gpointer instance) {
1068         TestData* self;
1069         self = instance;
1070         g_atomic_int_inc (&self->ref_count);
1071         return instance;
1072 }
1073
1074
1075 void test_data_unref (gpointer instance) {
1076         TestData* self;
1077         self = instance;
1078         if (g_atomic_int_dec_and_test (&self->ref_count)) {
1079                 TEST_DATA_GET_CLASS (self)->finalize (self);
1080                 g_type_free_instance ((GTypeInstance *) self);
1081         }
1082 }
1083
1084
1085 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
1086         if ((array != NULL) && (destroy_func != NULL)) {
1087                 int i;
1088                 for (i = 0; i < array_length; i = i + 1) {
1089                         if (((gpointer*) array)[i] != NULL) {
1090                                 destroy_func (((gpointer*) array)[i]);
1091                         }
1092                 }
1093         }
1094 }
1095
1096
1097 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
1098         _vala_array_destroy (array, array_length, destroy_func);
1099         g_free (array);
1100 }
1101
1102
1103