Back to index

libunity  5.92.0
test-io.c
Go to the documentation of this file.
00001 /* test-io.c generated by valac 0.17.2, the Vala compiler
00002  * generated from test-io.vala, do not modify */
00003 
00004 /* -*- Mode: vala; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
00005 /*
00006  * Copyright (C) 2010 Canonical Ltd
00007  *
00008  * This program is free software: you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License version 3 as
00010  * published by the Free Software Foundation.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00019  *
00020  * Authored by Mikkel Kamstrup Erlandsen <mikkel.kamstrup@canonical.com>
00021  *
00022  */
00023 
00024 #include <glib.h>
00025 #include <glib-object.h>
00026 #include <stdlib.h>
00027 #include <string.h>
00028 #include <gio/gio.h>
00029 #include <config.h>
00030 #include <unity-internal.h>
00031 #include <gobject/gvaluecollector.h>
00032 
00033 
00034 #define UNITY_TEST_TYPE_IO_SUITE (unity_test_io_suite_get_type ())
00035 #define UNITY_TEST_IO_SUITE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TEST_TYPE_IO_SUITE, UnityTestIOSuite))
00036 #define UNITY_TEST_IO_SUITE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TEST_TYPE_IO_SUITE, UnityTestIOSuiteClass))
00037 #define UNITY_TEST_IS_IO_SUITE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TEST_TYPE_IO_SUITE))
00038 #define UNITY_TEST_IS_IO_SUITE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TEST_TYPE_IO_SUITE))
00039 #define UNITY_TEST_IO_SUITE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TEST_TYPE_IO_SUITE, UnityTestIOSuiteClass))
00040 
00041 typedef struct _UnityTestIOSuite UnityTestIOSuite;
00042 typedef struct _UnityTestIOSuiteClass UnityTestIOSuiteClass;
00043 typedef struct _UnityTestIOSuitePrivate UnityTestIOSuitePrivate;
00044 #define _g_main_loop_unref0(var) ((var == NULL) ? NULL : (var = (g_main_loop_unref (var), NULL)))
00045 #define _g_free0(var) (var = (g_free (var), NULL))
00046 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
00047 #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
00048 typedef struct _UnityTestIoSuiteDoTestAsyncFindAndLoadData UnityTestIoSuiteDoTestAsyncFindAndLoadData;
00049 typedef struct _UnityTestParamSpecIOSuite UnityTestParamSpecIOSuite;
00050 #define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
00051 
00052 struct _UnityTestIOSuite {
00053        GTypeInstance parent_instance;
00054        volatile int ref_count;
00055        UnityTestIOSuitePrivate * priv;
00056 };
00057 
00058 struct _UnityTestIOSuiteClass {
00059        GTypeClass parent_class;
00060        void (*finalize) (UnityTestIOSuite *self);
00061 };
00062 
00063 struct _UnityTestIoSuiteDoTestAsyncFindAndLoadData {
00064        int _state_;
00065        GObject* _source_object_;
00066        GAsyncResult* _res_;
00067        GSimpleAsyncResult* _async_result;
00068        GMainLoop* mainloop;
00069        gchar** _tmp0_;
00070        gchar** dirs;
00071        gint dirs_length1;
00072        gint _dirs_size_;
00073        gchar** _tmp1_;
00074        gint _tmp1__length1;
00075        gchar* _tmp2_;
00076        gchar* _tmp3_;
00077        gchar** _tmp4_;
00078        gint _tmp4__length1;
00079        GFileInputStream* _tmp5_;
00080        GFileInputStream* input;
00081        GFileInputStream* _tmp6_;
00082        guint8* data;
00083        gint data_length1;
00084        gint _data_size_;
00085        gsize data_size;
00086        GFileInputStream* _tmp7_;
00087        guint8* _tmp8_;
00088        gint _tmp9_;
00089        gsize _tmp10_;
00090        gsize _tmp11_;
00091        const gchar* _tmp12_;
00092        gint _tmp13_;
00093        gint _tmp14_;
00094        const gchar* _tmp15_;
00095        gint _tmp16_;
00096        gint _tmp17_;
00097        gchar* _tmp18_;
00098        gchar* _tmp19_;
00099        gsize _tmp20_;
00100        gchar* _tmp21_;
00101        gchar* _tmp22_;
00102        gchar* _tmp23_;
00103        gchar* _tmp24_;
00104        gsize _tmp25_;
00105        const gchar* _tmp26_;
00106        gint _tmp27_;
00107        gint _tmp28_;
00108        guint8* _tmp29_;
00109        gint _tmp29__length1;
00110        gchar* _tmp30_;
00111        gchar* sdata;
00112        const gchar* _tmp31_;
00113        GError* e;
00114        const gchar* _tmp32_;
00115        GMainLoop* _tmp33_;
00116        GError * _inner_error_;
00117 };
00118 
00119 struct _UnityTestParamSpecIOSuite {
00120        GParamSpec parent_instance;
00121 };
00122 
00123 
00124 static gpointer unity_test_io_suite_parent_class = NULL;
00125 static gchar* unity_test_io_suite_TEST_DATA;
00126 static gchar* unity_test_io_suite_TEST_DATA = NULL;
00127 
00128 gpointer unity_test_io_suite_ref (gpointer instance);
00129 void unity_test_io_suite_unref (gpointer instance);
00130 GParamSpec* unity_test_param_spec_io_suite (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
00131 void unity_test_value_set_io_suite (GValue* value, gpointer v_object);
00132 void unity_test_value_take_io_suite (GValue* value, gpointer v_object);
00133 gpointer unity_test_value_get_io_suite (const GValue* value);
00134 GType unity_test_io_suite_get_type (void) G_GNUC_CONST;
00135 enum  {
00136        UNITY_TEST_IO_SUITE_DUMMY_PROPERTY
00137 };
00138 UnityTestIOSuite* unity_test_io_suite_new (void);
00139 UnityTestIOSuite* unity_test_io_suite_construct (GType object_type);
00140 void unity_test_io_suite_test_async_find_and_load (void);
00141 static void _unity_test_io_suite_test_async_find_and_load_gtest_data_func (gpointer self);
00142 void unity_test_io_suite_do_test_async_find_and_load (GMainLoop* mainloop, GAsyncReadyCallback _callback_, gpointer _user_data_);
00143 void unity_test_io_suite_do_test_async_find_and_load_finish (GAsyncResult* _res_);
00144 static void unity_test_io_suite_do_test_async_find_and_load_data_free (gpointer _data);
00145 static gboolean unity_test_io_suite_do_test_async_find_and_load_co (UnityTestIoSuiteDoTestAsyncFindAndLoadData* _data_);
00146 static void unity_test_io_suite_do_test_async_find_and_load_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
00147 static void unity_test_io_suite_finalize (UnityTestIOSuite* obj);
00148 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
00149 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
00150 
00151 
00152 static void _unity_test_io_suite_test_async_find_and_load_gtest_data_func (gpointer self) {
00153        unity_test_io_suite_test_async_find_and_load ();
00154 }
00155 
00156 
00157 UnityTestIOSuite* unity_test_io_suite_construct (GType object_type) {
00158        UnityTestIOSuite* self = NULL;
00159        self = (UnityTestIOSuite*) g_type_create_instance (object_type);
00160        g_test_add_data_func ("/Unit/IO/AsyncDesktopFile", NULL, _unity_test_io_suite_test_async_find_and_load_gtest_data_func);
00161        return self;
00162 }
00163 
00164 
00165 UnityTestIOSuite* unity_test_io_suite_new (void) {
00166        return unity_test_io_suite_construct (UNITY_TEST_TYPE_IO_SUITE);
00167 }
00168 
00169 
00170 void unity_test_io_suite_test_async_find_and_load (void) {
00171        GMainLoop* _tmp0_;
00172        GMainLoop* mainloop;
00173        _tmp0_ = g_main_loop_new (NULL, FALSE);
00174        mainloop = _tmp0_;
00175        unity_test_io_suite_do_test_async_find_and_load (mainloop, NULL, NULL);
00176        g_main_loop_run (mainloop);
00177        _g_main_loop_unref0 (mainloop);
00178 }
00179 
00180 
00181 static void unity_test_io_suite_do_test_async_find_and_load_data_free (gpointer _data) {
00182        UnityTestIoSuiteDoTestAsyncFindAndLoadData* _data_;
00183        _data_ = _data;
00184        _g_main_loop_unref0 (_data_->mainloop);
00185        g_slice_free (UnityTestIoSuiteDoTestAsyncFindAndLoadData, _data_);
00186 }
00187 
00188 
00189 static gpointer _g_main_loop_ref0 (gpointer self) {
00190        return self ? g_main_loop_ref (self) : NULL;
00191 }
00192 
00193 
00194 void unity_test_io_suite_do_test_async_find_and_load (GMainLoop* mainloop, GAsyncReadyCallback _callback_, gpointer _user_data_) {
00195        UnityTestIoSuiteDoTestAsyncFindAndLoadData* _data_;
00196        GMainLoop* _tmp0_;
00197        GMainLoop* _tmp1_;
00198        _data_ = g_slice_new0 (UnityTestIoSuiteDoTestAsyncFindAndLoadData);
00199        _data_->_async_result = g_simple_async_result_new (g_object_newv (G_TYPE_OBJECT, 0, NULL), _callback_, _user_data_, unity_test_io_suite_do_test_async_find_and_load);
00200        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, unity_test_io_suite_do_test_async_find_and_load_data_free);
00201        _tmp0_ = mainloop;
00202        _tmp1_ = _g_main_loop_ref0 (_tmp0_);
00203        _data_->mainloop = _tmp1_;
00204        unity_test_io_suite_do_test_async_find_and_load_co (_data_);
00205 }
00206 
00207 
00208 void unity_test_io_suite_do_test_async_find_and_load_finish (GAsyncResult* _res_) {
00209        UnityTestIoSuiteDoTestAsyncFindAndLoadData* _data_;
00210        _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
00211 }
00212 
00213 
00214 static void unity_test_io_suite_do_test_async_find_and_load_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
00215        UnityTestIoSuiteDoTestAsyncFindAndLoadData* _data_;
00216        _data_ = _user_data_;
00217        _data_->_source_object_ = source_object;
00218        _data_->_res_ = _res_;
00219        unity_test_io_suite_do_test_async_find_and_load_co (_data_);
00220 }
00221 
00222 
00223 static gboolean unity_test_io_suite_do_test_async_find_and_load_co (UnityTestIoSuiteDoTestAsyncFindAndLoadData* _data_) {
00224        switch (_data_->_state_) {
00225               case 0:
00226               goto _state_0;
00227               case 1:
00228               goto _state_1;
00229               case 2:
00230               goto _state_2;
00231               default:
00232               g_assert_not_reached ();
00233        }
00234        _state_0:
00235        _data_->_tmp0_ = NULL;
00236        _data_->_tmp0_ = g_new0 (gchar*, 1 + 1);
00237        _data_->dirs = _data_->_tmp0_;
00238        _data_->dirs_length1 = 1;
00239        _data_->_dirs_size_ = _data_->dirs_length1;
00240        _data_->_tmp1_ = _data_->dirs;
00241        _data_->_tmp1__length1 = _data_->dirs_length1;
00242        _data_->_tmp2_ = NULL;
00243        _data_->_tmp2_ = g_build_filename (TESTDIR, "data", NULL);
00244        _g_free0 (_data_->_tmp1_[0]);
00245        _data_->_tmp1_[0] = _data_->_tmp2_;
00246        _data_->_tmp3_ = _data_->_tmp1_[0];
00247        {
00248               _data_->_tmp4_ = _data_->dirs;
00249               _data_->_tmp4__length1 = _data_->dirs_length1;
00250               _data_->_state_ = 1;
00251               unity_io_open_from_dirs ("test_desktop_file.desktop", _data_->_tmp4_, _data_->_tmp4__length1, unity_test_io_suite_do_test_async_find_and_load_ready, _data_);
00252               return FALSE;
00253               _state_1:
00254               _data_->_tmp5_ = NULL;
00255               _data_->_tmp5_ = unity_io_open_from_dirs_finish (_data_->_res_, &_data_->_inner_error_);
00256               _data_->input = _data_->_tmp5_;
00257               if (_data_->_inner_error_ != NULL) {
00258                      goto __catch2_g_error;
00259               }
00260               _data_->_tmp6_ = _data_->input;
00261               _vala_assert (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp6_, g_file_input_stream_get_type ()), "input is FileInputStream");
00262               _data_->data_length1 = 0;
00263               _data_->_data_size_ = 0;
00264               _data_->_tmp7_ = _data_->input;
00265               _data_->_tmp8_ = NULL;
00266               _data_->_tmp9_ = 0;
00267               _data_->_tmp10_ = 0UL;
00268               _data_->_state_ = 2;
00269               unity_io_read_stream_async ((GInputStream*) _data_->_tmp7_, G_PRIORITY_LOW, NULL, unity_test_io_suite_do_test_async_find_and_load_ready, _data_);
00270               return FALSE;
00271               _state_2:
00272               unity_io_read_stream_finish (_data_->_res_, &_data_->_tmp8_, &_data_->_tmp9_, &_data_->_tmp10_, &_data_->_inner_error_);
00273               _data_->data = (g_free (_data_->data), NULL);
00274               _data_->data = _data_->_tmp8_;
00275               _data_->data_length1 = _data_->_tmp9_;
00276               _data_->_data_size_ = _data_->data_length1;
00277               _data_->data_size = _data_->_tmp10_;
00278               if (_data_->_inner_error_ != NULL) {
00279                      _data_->data = (g_free (_data_->data), NULL);
00280                      _g_object_unref0 (_data_->input);
00281                      goto __catch2_g_error;
00282               }
00283               _data_->_tmp11_ = _data_->data_size;
00284               _data_->_tmp12_ = unity_test_io_suite_TEST_DATA;
00285               _data_->_tmp13_ = strlen (_data_->_tmp12_);
00286               _data_->_tmp14_ = _data_->_tmp13_;
00287               if (_data_->_tmp11_ != ((gsize) _data_->_tmp14_)) {
00288                      _data_->_tmp15_ = unity_test_io_suite_TEST_DATA;
00289                      _data_->_tmp16_ = strlen (_data_->_tmp15_);
00290                      _data_->_tmp17_ = _data_->_tmp16_;
00291                      _data_->_tmp18_ = NULL;
00292                      _data_->_tmp18_ = g_strdup_printf ("%i", _data_->_tmp17_);
00293                      _data_->_tmp19_ = _data_->_tmp18_;
00294                      _data_->_tmp20_ = _data_->data_size;
00295                      _data_->_tmp21_ = NULL;
00296                      _data_->_tmp21_ = g_strdup_printf ("%" G_GSIZE_FORMAT, _data_->_tmp20_);
00297                      _data_->_tmp22_ = _data_->_tmp21_;
00298                      _data_->_tmp23_ = NULL;
00299                      _data_->_tmp23_ = g_strconcat ("Expected file size ", _data_->_tmp19_, ", but found ", _data_->_tmp22_, NULL);
00300                      _data_->_tmp24_ = _data_->_tmp23_;
00301                      g_critical ("test-io.vala:72: %s", _data_->_tmp24_);
00302                      _g_free0 (_data_->_tmp24_);
00303                      _g_free0 (_data_->_tmp22_);
00304                      _g_free0 (_data_->_tmp19_);
00305                      _data_->_tmp25_ = _data_->data_size;
00306                      _data_->_tmp26_ = unity_test_io_suite_TEST_DATA;
00307                      _data_->_tmp27_ = strlen (_data_->_tmp26_);
00308                      _data_->_tmp28_ = _data_->_tmp27_;
00309                      _vala_assert (_data_->_tmp25_ == ((gsize) _data_->_tmp28_), "data_size == TEST_DATA.length");
00310               }
00311               _data_->_tmp29_ = _data_->data;
00312               _data_->_tmp29__length1 = _data_->data_length1;
00313               _data_->_tmp30_ = g_strdup ((const gchar*) _data_->_tmp29_);
00314               _data_->sdata = _data_->_tmp30_;
00315               _data_->_tmp31_ = unity_test_io_suite_TEST_DATA;
00316               _vala_assert (g_strcmp0 (_data_->sdata, _data_->_tmp31_) == 0, "sdata == TEST_DATA");
00317               _g_free0 (_data_->sdata);
00318               _data_->data = (g_free (_data_->data), NULL);
00319               _g_object_unref0 (_data_->input);
00320        }
00321        goto __finally2;
00322        __catch2_g_error:
00323        {
00324               _data_->e = _data_->_inner_error_;
00325               _data_->_inner_error_ = NULL;
00326               _data_->_tmp32_ = _data_->e->message;
00327               g_error ("test-io.vala:82: Failed read test file: %s", _data_->_tmp32_);
00328               _g_error_free0 (_data_->e);
00329        }
00330        __finally2:
00331        if (_data_->_inner_error_ != NULL) {
00332               _data_->dirs = (_vala_array_free (_data_->dirs, _data_->dirs_length1, (GDestroyNotify) g_free), NULL);
00333               g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
00334               g_clear_error (&_data_->_inner_error_);
00335               return FALSE;
00336        }
00337        _data_->_tmp33_ = _data_->mainloop;
00338        g_main_loop_quit (_data_->_tmp33_);
00339        _data_->dirs = (_vala_array_free (_data_->dirs, _data_->dirs_length1, (GDestroyNotify) g_free), NULL);
00340        if (_data_->_state_ == 0) {
00341               g_simple_async_result_complete_in_idle (_data_->_async_result);
00342        } else {
00343               g_simple_async_result_complete (_data_->_async_result);
00344        }
00345        g_object_unref (_data_->_async_result);
00346        return FALSE;
00347 }
00348 
00349 
00350 static void unity_test_value_io_suite_init (GValue* value) {
00351        value->data[0].v_pointer = NULL;
00352 }
00353 
00354 
00355 static void unity_test_value_io_suite_free_value (GValue* value) {
00356        if (value->data[0].v_pointer) {
00357               unity_test_io_suite_unref (value->data[0].v_pointer);
00358        }
00359 }
00360 
00361 
00362 static void unity_test_value_io_suite_copy_value (const GValue* src_value, GValue* dest_value) {
00363        if (src_value->data[0].v_pointer) {
00364               dest_value->data[0].v_pointer = unity_test_io_suite_ref (src_value->data[0].v_pointer);
00365        } else {
00366               dest_value->data[0].v_pointer = NULL;
00367        }
00368 }
00369 
00370 
00371 static gpointer unity_test_value_io_suite_peek_pointer (const GValue* value) {
00372        return value->data[0].v_pointer;
00373 }
00374 
00375 
00376 static gchar* unity_test_value_io_suite_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
00377        if (collect_values[0].v_pointer) {
00378               UnityTestIOSuite* object;
00379               object = collect_values[0].v_pointer;
00380               if (object->parent_instance.g_class == NULL) {
00381                      return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
00382               } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
00383                      return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
00384               }
00385               value->data[0].v_pointer = unity_test_io_suite_ref (object);
00386        } else {
00387               value->data[0].v_pointer = NULL;
00388        }
00389        return NULL;
00390 }
00391 
00392 
00393 static gchar* unity_test_value_io_suite_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
00394        UnityTestIOSuite** object_p;
00395        object_p = collect_values[0].v_pointer;
00396        if (!object_p) {
00397               return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
00398        }
00399        if (!value->data[0].v_pointer) {
00400               *object_p = NULL;
00401        } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
00402               *object_p = value->data[0].v_pointer;
00403        } else {
00404               *object_p = unity_test_io_suite_ref (value->data[0].v_pointer);
00405        }
00406        return NULL;
00407 }
00408 
00409 
00410 GParamSpec* unity_test_param_spec_io_suite (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
00411        UnityTestParamSpecIOSuite* spec;
00412        g_return_val_if_fail (g_type_is_a (object_type, UNITY_TEST_TYPE_IO_SUITE), NULL);
00413        spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
00414        G_PARAM_SPEC (spec)->value_type = object_type;
00415        return G_PARAM_SPEC (spec);
00416 }
00417 
00418 
00419 gpointer unity_test_value_get_io_suite (const GValue* value) {
00420        g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, UNITY_TEST_TYPE_IO_SUITE), NULL);
00421        return value->data[0].v_pointer;
00422 }
00423 
00424 
00425 void unity_test_value_set_io_suite (GValue* value, gpointer v_object) {
00426        UnityTestIOSuite* old;
00427        g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, UNITY_TEST_TYPE_IO_SUITE));
00428        old = value->data[0].v_pointer;
00429        if (v_object) {
00430               g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, UNITY_TEST_TYPE_IO_SUITE));
00431               g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
00432               value->data[0].v_pointer = v_object;
00433               unity_test_io_suite_ref (value->data[0].v_pointer);
00434        } else {
00435               value->data[0].v_pointer = NULL;
00436        }
00437        if (old) {
00438               unity_test_io_suite_unref (old);
00439        }
00440 }
00441 
00442 
00443 void unity_test_value_take_io_suite (GValue* value, gpointer v_object) {
00444        UnityTestIOSuite* old;
00445        g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, UNITY_TEST_TYPE_IO_SUITE));
00446        old = value->data[0].v_pointer;
00447        if (v_object) {
00448               g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, UNITY_TEST_TYPE_IO_SUITE));
00449               g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
00450               value->data[0].v_pointer = v_object;
00451        } else {
00452               value->data[0].v_pointer = NULL;
00453        }
00454        if (old) {
00455               unity_test_io_suite_unref (old);
00456        }
00457 }
00458 
00459 
00460 static void unity_test_io_suite_class_init (UnityTestIOSuiteClass * klass) {
00461        gchar* _tmp0_;
00462        unity_test_io_suite_parent_class = g_type_class_peek_parent (klass);
00463        UNITY_TEST_IO_SUITE_CLASS (klass)->finalize = unity_test_io_suite_finalize;
00464        _tmp0_ = g_strdup ("[Desktop Entry]\n" \
00465 "Name=Test Application\n" \
00466 "Comment=This is a test application desktop file\n" \
00467 "Exec=xclock\n" \
00468 "Terminal=false\n" \
00469 "Type=Application\n" \
00470 "StartupNotify=false\n" \
00471 "Icon=test_desktop_icon.png\n" \
00472 "\n");
00473        unity_test_io_suite_TEST_DATA = _tmp0_;
00474 }
00475 
00476 
00477 static void unity_test_io_suite_instance_init (UnityTestIOSuite * self) {
00478        self->ref_count = 1;
00479 }
00480 
00481 
00482 static void unity_test_io_suite_finalize (UnityTestIOSuite* obj) {
00483        UnityTestIOSuite * self;
00484        self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TEST_TYPE_IO_SUITE, UnityTestIOSuite);
00485 }
00486 
00487 
00488 GType unity_test_io_suite_get_type (void) {
00489        static volatile gsize unity_test_io_suite_type_id__volatile = 0;
00490        if (g_once_init_enter (&unity_test_io_suite_type_id__volatile)) {
00491               static const GTypeValueTable g_define_type_value_table = { unity_test_value_io_suite_init, unity_test_value_io_suite_free_value, unity_test_value_io_suite_copy_value, unity_test_value_io_suite_peek_pointer, "p", unity_test_value_io_suite_collect_value, "p", unity_test_value_io_suite_lcopy_value };
00492               static const GTypeInfo g_define_type_info = { sizeof (UnityTestIOSuiteClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_test_io_suite_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityTestIOSuite), 0, (GInstanceInitFunc) unity_test_io_suite_instance_init, &g_define_type_value_table };
00493               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) };
00494               GType unity_test_io_suite_type_id;
00495               unity_test_io_suite_type_id = g_type_register_fundamental (g_type_fundamental_next (), "UnityTestIOSuite", &g_define_type_info, &g_define_type_fundamental_info, 0);
00496               g_once_init_leave (&unity_test_io_suite_type_id__volatile, unity_test_io_suite_type_id);
00497        }
00498        return unity_test_io_suite_type_id__volatile;
00499 }
00500 
00501 
00502 gpointer unity_test_io_suite_ref (gpointer instance) {
00503        UnityTestIOSuite* self;
00504        self = instance;
00505        g_atomic_int_inc (&self->ref_count);
00506        return instance;
00507 }
00508 
00509 
00510 void unity_test_io_suite_unref (gpointer instance) {
00511        UnityTestIOSuite* self;
00512        self = instance;
00513        if (g_atomic_int_dec_and_test (&self->ref_count)) {
00514               UNITY_TEST_IO_SUITE_GET_CLASS (self)->finalize (self);
00515               g_type_free_instance ((GTypeInstance *) self);
00516        }
00517 }
00518 
00519 
00520 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
00521        if ((array != NULL) && (destroy_func != NULL)) {
00522               int i;
00523               for (i = 0; i < array_length; i = i + 1) {
00524                      if (((gpointer*) array)[i] != NULL) {
00525                             destroy_func (((gpointer*) array)[i]);
00526                      }
00527               }
00528        }
00529 }
00530 
00531 
00532 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
00533        _vala_array_destroy (array, array_length, destroy_func);
00534        g_free (array);
00535 }
00536 
00537 
00538