1 /* testdata.c generated by valac 0.18.0, the Vala compiler
2 * generated from testdata.vala, do not modify */
6 * Copyright (C) 2012 Maciej Piechotka
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 * Maciej Piechotka <uzytkownik2@gmail.com>
27 #include <glib-object.h>
30 #include <gobject/gvaluecollector.h>
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))
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;
48 GTypeInstance parent_instance;
49 volatile int ref_count;
50 TestDataPrivate * priv;
53 struct _TestDataClass {
54 GTypeClass parent_class;
55 void (*finalize) (TestData *self);
58 struct _ParamSpecTestData {
59 GParamSpec parent_instance;
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;
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;
107 TEST_DATA_DUMMY_PROPERTY
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);
128 static gchar** _vala_array_dup1 (gchar** self, int length) {
131 result = g_new0 (gchar*, length + 1);
132 for (i = 0; i < length; i++) {
134 _tmp0_ = g_strdup (self[i]);
141 static guint test_data_data_size (void) {
144 gboolean _tmp1_ = FALSE;
146 _tmp1_ = g_test_quick ();
153 result = (guint) _tmp2_;
158 gchar** test_data_get_data (int* result_length1) {
159 gchar** result = NULL;
160 GTypeClass* _tmp0_ = NULL;
166 _tmp0_ = g_type_class_ref (TYPE_TEST_DATA);
168 G_TYPE_FROM_CLASS (klass);
169 _tmp1_ = test_data_data;
170 _tmp1__length1 = test_data_data_length1;
172 _tmp2__length1 = _tmp1__length1;
173 if (result_length1) {
174 *result_length1 = _tmp2__length1;
177 _g_type_class_unref0 (klass);
182 gchar** test_data_get_sorted_data (int* result_length1) {
183 gchar** result = NULL;
184 GTypeClass* _tmp0_ = NULL;
190 _tmp0_ = g_type_class_ref (TYPE_TEST_DATA);
192 G_TYPE_FROM_CLASS (klass);
193 _tmp1_ = test_data_sorted_data;
194 _tmp1__length1 = test_data_sorted_data_length1;
196 _tmp2__length1 = _tmp1__length1;
197 if (result_length1) {
198 *result_length1 = _tmp2__length1;
201 _g_type_class_unref0 (klass);
206 guint* test_data_get_drawn_numbers (int* result_length1) {
207 guint* result = NULL;
208 GTypeClass* _tmp0_ = NULL;
214 _tmp0_ = g_type_class_ref (TYPE_TEST_DATA);
216 G_TYPE_FROM_CLASS (klass);
217 _tmp1_ = test_data_random_idx;
218 _tmp1__length1 = test_data_random_idx_length1;
220 _tmp2__length1 = _tmp1__length1;
221 if (result_length1) {
222 *result_length1 = _tmp2__length1;
225 _g_type_class_unref0 (klass);
230 static guint* test_data_draw_numbers (guint n, guint k, int* result_length1) {
231 guint* result = NULL;
233 guint* _tmp1_ = NULL;
235 gint _result__length1;
236 gint __result__size_;
240 gint _tmp33__length1;
242 gint _tmp34__length1;
244 _tmp1_ = g_new0 (guint, _tmp0_);
246 _result__length1 = _tmp0_;
247 __result__size_ = _result__length1;
272 if (!(_tmp5_ < _tmp6_)) {
276 _tmp7__length1 = _result__length1;
279 _tmp7_[_tmp8_] = _tmp9_;
280 _tmp10_ = _tmp7_[_tmp8_];
299 gint _tmp18__length1;
304 gint _tmp21__length1;
307 gint _tmp23__length1;
312 gint _tmp27__length1;
324 if (!(_tmp15_ >= ((guint) 1))) {
328 _tmp17_ = g_test_rand_int_range ((gint32) 0, (gint32) (_tmp16_ + 1));
331 _tmp18__length1 = _result__length1;
333 _tmp20_ = _tmp18_[_tmp19_];
336 _tmp21__length1 = _result__length1;
339 _tmp23__length1 = _result__length1;
341 _tmp25_ = _tmp23_[_tmp24_];
342 _tmp21_[_tmp22_] = _tmp25_;
343 _tmp26_ = _tmp21_[_tmp22_];
345 _tmp27__length1 = _result__length1;
348 _tmp27_[_tmp28_] = _tmp29_;
349 _tmp30_ = _tmp27_[_tmp28_];
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_;
360 _tmp33__length1 = _result__length1;
363 _tmp34__length1 = _tmp33__length1;
364 if (result_length1) {
365 *result_length1 = _tmp34__length1;
368 _result_ = (g_free (_result_), NULL);
373 static gchar* test_data_print3digit (guint n) {
374 gchar* result = NULL;
375 gchar* _tmp0_ = NULL;
377 const gchar* _tmp12_;
382 gint _tmp15__length1;
384 const gchar* _tmp17_;
389 gint _tmp20__length1;
392 gint _tmp24__length1;
394 const gchar* _tmp26_;
396 const gchar* _tmp27_ = NULL;
397 const gchar* _tmp28_;
398 const gchar* _tmp30_ = NULL;
399 gboolean _tmp31_ = FALSE;
400 const gchar* _tmp32_;
402 const gchar* _tmp38_ = NULL;
403 const gchar* _tmp39_;
404 const gchar* _tmp41_ = NULL;
405 gboolean _tmp42_ = FALSE;
406 const gchar* _tmp43_;
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;
417 if (_tmp1_ >= ((guint) 200)) {
423 gchar* _tmp6_ = NULL;
424 _tmp2_ = test_data_ones;
425 _tmp2__length1 = test_data_ones_length1;
427 _tmp4_ = _tmp2_[_tmp3_ / 100];
428 _tmp5_ = test_data_hundred;
429 _tmp6_ = g_strdup_printf ("%s %s", _tmp4_, _tmp5_);
433 const gchar* _tmp7_ = NULL;
435 const gchar* _tmp10_;
438 if (_tmp8_ >= ((guint) 100)) {
440 _tmp9_ = test_data_hundred;
446 _tmp11_ = g_strdup (_tmp10_);
451 _tmp13_ = g_strdup (_tmp12_);
455 _tmp15_ = test_data_tens;
456 _tmp15__length1 = test_data_tens_length1;
458 _tmp17_ = _tmp15_[_tmp16_ / 10];
461 _tmp20_ = test_data_ones;
462 _tmp20__length1 = test_data_ones_length1;
463 if (_tmp19_ >= ((guint) _tmp20__length1)) {
466 _tmp18_ = _tmp21_ % 10;
474 _tmp24_ = test_data_ones;
475 _tmp24__length1 = test_data_ones_length1;
477 _tmp26_ = _tmp24_[_tmp25_];
480 if (_tmp28_ != NULL) {
481 const gchar* _tmp29_;
488 if (_tmp32_ != NULL) {
489 gboolean _tmp33_ = FALSE;
490 const gchar* _tmp34_;
493 if (_tmp34_ != NULL) {
496 const gchar* _tmp35_;
498 _tmp33_ = _tmp35_ != NULL;
512 if (_tmp39_ != NULL) {
513 const gchar* _tmp40_;
520 if (_tmp43_ != NULL) {
521 const gchar* _tmp44_;
523 _tmp42_ = _tmp44_ != NULL;
534 if (_tmp47_ != NULL) {
535 const gchar* _tmp48_;
546 _tmp54_ = g_strdup_printf ("%s%s%s%s%s", _tmp49_, _tmp50_, _tmp51_, _tmp52_, _tmp53_);
554 static gchar** test_data_create_data (guint count, int* result_length1) {
555 gchar** result = NULL;
557 gchar** _tmp1_ = NULL;
559 gint numbers_length1;
562 gint _tmp40__length1;
564 gint _tmp41__length1;
566 _tmp1_ = g_new0 (gchar*, _tmp0_ + 1);
568 numbers_length1 = _tmp0_;
569 _numbers_size_ = numbers_length1;
584 const gchar* _tmp34_;
586 gint _tmp36__length1;
599 if (!(_tmp5_ < _tmp6_)) {
612 if (!(_tmp8_ != ((guint) 0))) {
616 if ((_tmp9_ % 1000) != ((guint) 0)) {
618 gint _tmp10__length1;
620 const gchar* _tmp12_;
624 gchar* _tmp15_ = NULL;
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;
643 _tmp12_ = _tmp10_[_tmp11_];
644 _tmp13_ = g_strdup (_tmp12_);
647 _tmp15_ = test_data_print3digit (_tmp14_ % 1000);
650 if (_tmp17_ != NULL) {
656 if (_tmp19_ != NULL) {
657 const gchar* _tmp20_;
664 if (_tmp22_ != NULL) {
670 if (_tmp24_ != NULL) {
671 const gchar* _tmp25_;
682 _tmp31_ = g_strdup_printf ("%s%s%s%s%s", _tmp26_, _tmp27_, _tmp28_, _tmp29_, _tmp30_);
694 if (_tmp34_ == NULL) {
696 _tmp35_ = g_strdup ("zero");
701 _tmp36__length1 = numbers_length1;
705 _g_free0 (_tmp36_[_tmp37_]);
706 _tmp36_[_tmp37_] = _tmp38_;
707 _tmp39_ = _tmp36_[_tmp37_];
713 _tmp40__length1 = numbers_length1;
716 _tmp41__length1 = _tmp40__length1;
717 if (result_length1) {
718 *result_length1 = _tmp41__length1;
721 numbers = (_vala_array_free (numbers, numbers_length1, (GDestroyNotify) g_free), NULL);
726 static gint __lambda2_ (const gchar* a, const gchar* b) {
732 g_return_val_if_fail (a != NULL, 0);
733 g_return_val_if_fail (b != NULL, 0);
737 _tmp3_ = _tmp0_ (*((const gchar**) _tmp1_), *((const gchar**) _tmp2_));
743 static gint ___lambda2__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self) {
745 result = __lambda2_ (a, b);
750 static gchar** test_data_sort_array (gchar** array, int array_length1, int* result_length1) {
751 gchar** result = NULL;
759 _tmp0__length1 = array_length1;
760 g_qsort_with_data (_tmp0_, _tmp0__length1, (gsize) sizeof (gchar*), (GCompareDataFunc) ___lambda2__gcompare_data_func, NULL);
762 _tmp1__length1 = array_length1;
765 _tmp2__length1 = _tmp1__length1;
766 if (result_length1) {
767 *result_length1 = _tmp2__length1;
770 array = (_vala_array_free (array, array_length1, (GDestroyNotify) g_free), NULL);
775 TestData* test_data_construct (GType object_type) {
776 TestData* self = NULL;
777 self = (TestData*) g_type_create_instance (object_type);
782 TestData* test_data_new (void) {
783 return test_data_construct (TYPE_TEST_DATA);
787 static void value_test_data_init (GValue* value) {
788 value->data[0].v_pointer = NULL;
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);
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);
803 dest_value->data[0].v_pointer = NULL;
808 static gpointer value_test_data_peek_pointer (const GValue* value) {
809 return value->data[0].v_pointer;
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) {
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);
822 value->data[0].v_pointer = test_data_ref (object);
824 value->data[0].v_pointer = NULL;
830 static gchar* value_test_data_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
832 object_p = collect_values[0].v_pointer;
834 return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
836 if (!value->data[0].v_pointer) {
838 } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
839 *object_p = value->data[0].v_pointer;
841 *object_p = test_data_ref (value->data[0].v_pointer);
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);
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;
862 void value_set_test_data (GValue* value, gpointer v_object) {
864 g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_TEST_DATA));
865 old = value->data[0].v_pointer;
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);
872 value->data[0].v_pointer = NULL;
875 test_data_unref (old);
880 void value_take_test_data (GValue* value, gpointer v_object) {
882 g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_TEST_DATA));
883 old = value->data[0].v_pointer;
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;
889 value->data[0].v_pointer = NULL;
892 test_data_unref (old);
897 static void test_data_class_init (TestDataClass * klass) {
917 gchar** _tmp19_ = NULL;
926 gchar** _tmp28_ = NULL;
932 gchar** _tmp34_ = NULL;
936 gchar** _tmp38_ = NULL;
938 gint _tmp39__length1;
940 gint _tmp40__length1;
942 gchar** _tmp42_ = NULL;
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);
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);
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);
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_;
1042 static void test_data_instance_init (TestData * self) {
1043 self->ref_count = 1;
1047 static void test_data_finalize (TestData* obj) {
1049 self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_TEST_DATA, TestData);
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);
1063 return test_data_type_id__volatile;
1067 gpointer test_data_ref (gpointer instance) {
1070 g_atomic_int_inc (&self->ref_count);
1075 void test_data_unref (gpointer 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);
1085 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
1086 if ((array != NULL) && (destroy_func != NULL)) {
1088 for (i = 0; i < array_length; i = i + 1) {
1089 if (((gpointer*) array)[i] != NULL) {
1090 destroy_func (((gpointer*) array)[i]);
1097 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
1098 _vala_array_destroy (array, array_length, destroy_func);