Back to index

libunity  5.92.0
test-filters.c
Go to the documentation of this file.
00001 /* test-filters.c generated by valac 0.17.2, the Vala compiler
00002  * generated from test-filters.vala, do not modify */
00003 
00004 /* -*- Mode: vala; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
00005 /*
00006  * Copyright (C) 2011 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 <unity-internal.h>
00027 #include <stdlib.h>
00028 #include <string.h>
00029 #include <gobject/gvaluecollector.h>
00030 
00031 
00032 #define UNITY_TEST_TYPE_FILTER_SUITE (unity_test_filter_suite_get_type ())
00033 #define UNITY_TEST_FILTER_SUITE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TEST_TYPE_FILTER_SUITE, UnityTestFilterSuite))
00034 #define UNITY_TEST_FILTER_SUITE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TEST_TYPE_FILTER_SUITE, UnityTestFilterSuiteClass))
00035 #define UNITY_TEST_IS_FILTER_SUITE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TEST_TYPE_FILTER_SUITE))
00036 #define UNITY_TEST_IS_FILTER_SUITE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TEST_TYPE_FILTER_SUITE))
00037 #define UNITY_TEST_FILTER_SUITE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TEST_TYPE_FILTER_SUITE, UnityTestFilterSuiteClass))
00038 
00039 typedef struct _UnityTestFilterSuite UnityTestFilterSuite;
00040 typedef struct _UnityTestFilterSuiteClass UnityTestFilterSuiteClass;
00041 typedef struct _UnityTestFilterSuitePrivate UnityTestFilterSuitePrivate;
00042 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
00043 typedef struct _UnityTestParamSpecFilterSuite UnityTestParamSpecFilterSuite;
00044 #define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
00045 
00046 struct _UnityTestFilterSuite {
00047        GTypeInstance parent_instance;
00048        volatile int ref_count;
00049        UnityTestFilterSuitePrivate * priv;
00050 };
00051 
00052 struct _UnityTestFilterSuiteClass {
00053        GTypeClass parent_class;
00054        void (*finalize) (UnityTestFilterSuite *self);
00055 };
00056 
00057 struct _UnityTestParamSpecFilterSuite {
00058        GParamSpec parent_instance;
00059 };
00060 
00061 
00062 static gpointer unity_test_filter_suite_parent_class = NULL;
00063 
00064 gpointer unity_test_filter_suite_ref (gpointer instance);
00065 void unity_test_filter_suite_unref (gpointer instance);
00066 GParamSpec* unity_test_param_spec_filter_suite (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
00067 void unity_test_value_set_filter_suite (GValue* value, gpointer v_object);
00068 void unity_test_value_take_filter_suite (GValue* value, gpointer v_object);
00069 gpointer unity_test_value_get_filter_suite (const GValue* value);
00070 GType unity_test_filter_suite_get_type (void) G_GNUC_CONST;
00071 enum  {
00072        UNITY_TEST_FILTER_SUITE_DUMMY_PROPERTY
00073 };
00074 UnityTestFilterSuite* unity_test_filter_suite_new (void);
00075 UnityTestFilterSuite* unity_test_filter_suite_construct (GType object_type);
00076 void unity_test_filter_suite_test_options_filter_empty (void);
00077 static void _unity_test_filter_suite_test_options_filter_empty_gtest_data_func (gpointer self);
00078 void unity_test_filter_suite_test_options_filter_sort_manual (void);
00079 static void _unity_test_filter_suite_test_options_filter_sort_manual_gtest_data_func (gpointer self);
00080 void unity_test_filter_suite_test_options_filter_sort_display_name (void);
00081 static void _unity_test_filter_suite_test_options_filter_sort_display_name_gtest_data_func (gpointer self);
00082 void unity_test_filter_suite_test_options_filter_sort_id (void);
00083 static void _unity_test_filter_suite_test_options_filter_sort_id_gtest_data_func (gpointer self);
00084 static gint unity_test_filter_suite_find_filter_offset_by_id (UnityOptionsFilter* filter, const gchar* id);
00085 static void unity_test_filter_suite_finalize (UnityTestFilterSuite* obj);
00086 
00087 
00088 static void _unity_test_filter_suite_test_options_filter_empty_gtest_data_func (gpointer self) {
00089        unity_test_filter_suite_test_options_filter_empty ();
00090 }
00091 
00092 
00093 static void _unity_test_filter_suite_test_options_filter_sort_manual_gtest_data_func (gpointer self) {
00094        unity_test_filter_suite_test_options_filter_sort_manual ();
00095 }
00096 
00097 
00098 static void _unity_test_filter_suite_test_options_filter_sort_display_name_gtest_data_func (gpointer self) {
00099        unity_test_filter_suite_test_options_filter_sort_display_name ();
00100 }
00101 
00102 
00103 static void _unity_test_filter_suite_test_options_filter_sort_id_gtest_data_func (gpointer self) {
00104        unity_test_filter_suite_test_options_filter_sort_id ();
00105 }
00106 
00107 
00108 UnityTestFilterSuite* unity_test_filter_suite_construct (GType object_type) {
00109        UnityTestFilterSuite* self = NULL;
00110        self = (UnityTestFilterSuite*) g_type_create_instance (object_type);
00111        g_test_add_data_func ("/Unit/Filters/OptionsFilter/Empty", NULL, _unity_test_filter_suite_test_options_filter_empty_gtest_data_func);
00112        g_test_add_data_func ("/Unit/Filters/OptionsFilter/SortManual", NULL, _unity_test_filter_suite_test_options_filter_sort_manual_gtest_data_func);
00113        g_test_add_data_func ("/Unit/Filters/OptionsFilter/SortDisplayName", NULL, _unity_test_filter_suite_test_options_filter_sort_display_name_gtest_data_func);
00114        g_test_add_data_func ("/Unit/Filters/OptionsFilter/SortId", NULL, _unity_test_filter_suite_test_options_filter_sort_id_gtest_data_func);
00115        return self;
00116 }
00117 
00118 
00119 UnityTestFilterSuite* unity_test_filter_suite_new (void) {
00120        return unity_test_filter_suite_construct (UNITY_TEST_TYPE_FILTER_SUITE);
00121 }
00122 
00123 
00124 void unity_test_filter_suite_test_options_filter_empty (void) {
00125        UnityOptionsFilter* _tmp0_;
00126        UnityOptionsFilter* filter;
00127        GList* _tmp1_;
00128        guint _tmp2_ = 0U;
00129        _tmp0_ = unity_options_filter_new ();
00130        filter = _tmp0_;
00131        _tmp1_ = filter->options;
00132        _tmp2_ = g_list_length (_tmp1_);
00133        _vala_assert (_tmp2_ == ((guint) 0), "filter.options.length () == 0");
00134        _g_object_unref0 (filter);
00135 }
00136 
00137 
00138 static gpointer _g_object_ref0 (gpointer self) {
00139        return self ? g_object_ref (self) : NULL;
00140 }
00141 
00142 
00143 static gint unity_test_filter_suite_find_filter_offset_by_id (UnityOptionsFilter* filter, const gchar* id) {
00144        gint result = 0;
00145        gint i;
00146        UnityOptionsFilter* _tmp0_;
00147        GList* _tmp1_;
00148        g_return_val_if_fail (filter != NULL, 0);
00149        g_return_val_if_fail (id != NULL, 0);
00150        i = 0;
00151        _tmp0_ = filter;
00152        _tmp1_ = _tmp0_->options;
00153        {
00154               GList* f_collection = NULL;
00155               GList* f_it = NULL;
00156               f_collection = _tmp1_;
00157               for (f_it = f_collection; f_it != NULL; f_it = f_it->next) {
00158                      UnityFilterOption* _tmp2_;
00159                      UnityFilterOption* f = NULL;
00160                      _tmp2_ = _g_object_ref0 ((UnityFilterOption*) f_it->data);
00161                      f = _tmp2_;
00162                      {
00163                             UnityFilterOption* _tmp3_;
00164                             const gchar* _tmp4_;
00165                             const gchar* _tmp5_;
00166                             const gchar* _tmp6_;
00167                             gint _tmp7_;
00168                             _tmp3_ = f;
00169                             _tmp4_ = unity_filter_option_get_id (_tmp3_);
00170                             _tmp5_ = _tmp4_;
00171                             _tmp6_ = id;
00172                             if (g_strcmp0 (_tmp5_, _tmp6_) == 0) {
00173                                    result = i;
00174                                    _g_object_unref0 (f);
00175                                    return result;
00176                             }
00177                             _tmp7_ = i;
00178                             i = _tmp7_ + 1;
00179                             _g_object_unref0 (f);
00180                      }
00181               }
00182        }
00183        result = -1;
00184        return result;
00185 }
00186 
00187 
00188 void unity_test_filter_suite_test_options_filter_sort_manual (void) {
00189        UnityOptionsFilter* _tmp0_;
00190        UnityOptionsFilter* filter;
00191        UnityOptionsFilterSortType _tmp1_;
00192        UnityOptionsFilterSortType _tmp2_;
00193        UnityFilterOption* _tmp3_ = NULL;
00194        UnityFilterOption* _tmp4_;
00195        UnityFilterOption* _tmp5_ = NULL;
00196        UnityFilterOption* _tmp6_;
00197        UnityFilterOption* _tmp7_ = NULL;
00198        UnityFilterOption* _tmp8_;
00199        gint _tmp9_ = 0;
00200        gint _tmp10_ = 0;
00201        gint _tmp11_ = 0;
00202        UnityFilterOption* _tmp12_ = NULL;
00203        UnityFilterOption* _tmp13_;
00204        gint _tmp14_ = 0;
00205        gint _tmp15_ = 0;
00206        gint _tmp16_ = 0;
00207        gint _tmp17_ = 0;
00208        _tmp0_ = unity_options_filter_new ();
00209        filter = _tmp0_;
00210        _tmp1_ = unity_options_filter_get_sort_type (filter);
00211        _tmp2_ = _tmp1_;
00212        _vala_assert (_tmp2_ == UNITY_OPTIONS_FILTER_SORT_TYPE_MANUAL, "filter.sort_type == OptionsFilter.SortType.MANUAL");
00213        _tmp3_ = unity_options_filter_add_option (filter, "accessories", "Accessories", NULL);
00214        _tmp4_ = _tmp3_;
00215        _g_object_unref0 (_tmp4_);
00216        _tmp5_ = unity_options_filter_add_option (filter, "bccessories", "Bccessories", NULL);
00217        _tmp6_ = _tmp5_;
00218        _g_object_unref0 (_tmp6_);
00219        _tmp7_ = unity_options_filter_add_option (filter, "xenomorphs", "Xenomorphic Creatures", NULL);
00220        _tmp8_ = _tmp7_;
00221        _g_object_unref0 (_tmp8_);
00222        _tmp9_ = unity_test_filter_suite_find_filter_offset_by_id (filter, "accessories");
00223        _vala_assert (_tmp9_ == 0, "find_filter_offset_by_id (filter, \"accessories\") == 0");
00224        _tmp10_ = unity_test_filter_suite_find_filter_offset_by_id (filter, "bccessories");
00225        _vala_assert (_tmp10_ == 1, "find_filter_offset_by_id (filter, \"bccessories\") == 1");
00226        _tmp11_ = unity_test_filter_suite_find_filter_offset_by_id (filter, "xenomorphs");
00227        _vala_assert (_tmp11_ == 2, "find_filter_offset_by_id (filter, \"xenomorphs\") == 2");
00228        _tmp12_ = unity_options_filter_add_option (filter, "aardvaark", "Weird Animal", NULL);
00229        _tmp13_ = _tmp12_;
00230        _g_object_unref0 (_tmp13_);
00231        _tmp14_ = unity_test_filter_suite_find_filter_offset_by_id (filter, "accessories");
00232        _vala_assert (_tmp14_ == 0, "find_filter_offset_by_id (filter, \"accessories\") == 0");
00233        _tmp15_ = unity_test_filter_suite_find_filter_offset_by_id (filter, "bccessories");
00234        _vala_assert (_tmp15_ == 1, "find_filter_offset_by_id (filter, \"bccessories\") == 1");
00235        _tmp16_ = unity_test_filter_suite_find_filter_offset_by_id (filter, "xenomorphs");
00236        _vala_assert (_tmp16_ == 2, "find_filter_offset_by_id (filter, \"xenomorphs\") == 2");
00237        _tmp17_ = unity_test_filter_suite_find_filter_offset_by_id (filter, "aardvaark");
00238        _vala_assert (_tmp17_ == 3, "find_filter_offset_by_id (filter, \"aardvaark\") == 3");
00239        _g_object_unref0 (filter);
00240 }
00241 
00242 
00243 void unity_test_filter_suite_test_options_filter_sort_display_name (void) {
00244        UnityOptionsFilter* _tmp0_;
00245        UnityOptionsFilter* filter;
00246        UnityOptionsFilterSortType _tmp1_;
00247        UnityOptionsFilterSortType _tmp2_;
00248        UnityFilterOption* _tmp3_ = NULL;
00249        UnityFilterOption* _tmp4_;
00250        UnityFilterOption* _tmp5_ = NULL;
00251        UnityFilterOption* _tmp6_;
00252        UnityFilterOption* _tmp7_ = NULL;
00253        UnityFilterOption* _tmp8_;
00254        gint _tmp9_ = 0;
00255        gint _tmp10_ = 0;
00256        gint _tmp11_ = 0;
00257        UnityFilterOption* _tmp12_ = NULL;
00258        UnityFilterOption* _tmp13_;
00259        gint _tmp14_ = 0;
00260        gint _tmp15_ = 0;
00261        gint _tmp16_ = 0;
00262        gint _tmp17_ = 0;
00263        UnityFilterOption* _tmp18_ = NULL;
00264        UnityFilterOption* _tmp19_;
00265        gint _tmp20_ = 0;
00266        gint _tmp21_ = 0;
00267        gint _tmp22_ = 0;
00268        gint _tmp23_ = 0;
00269        gint _tmp24_ = 0;
00270        _tmp0_ = unity_options_filter_new ();
00271        filter = _tmp0_;
00272        unity_options_filter_set_sort_type (filter, UNITY_OPTIONS_FILTER_SORT_TYPE_DISPLAY_NAME);
00273        _tmp1_ = unity_options_filter_get_sort_type (filter);
00274        _tmp2_ = _tmp1_;
00275        _vala_assert (_tmp2_ == UNITY_OPTIONS_FILTER_SORT_TYPE_DISPLAY_NAME, "filter.sort_type == OptionsFilter.SortType.DISPLAY_NAME");
00276        _tmp3_ = unity_options_filter_add_option (filter, "accessories", "Accessories", NULL);
00277        _tmp4_ = _tmp3_;
00278        _g_object_unref0 (_tmp4_);
00279        _tmp5_ = unity_options_filter_add_option (filter, "bccessories", "Bccessories", NULL);
00280        _tmp6_ = _tmp5_;
00281        _g_object_unref0 (_tmp6_);
00282        _tmp7_ = unity_options_filter_add_option (filter, "xenomorphs", "Xenomorphic Creatures", NULL);
00283        _tmp8_ = _tmp7_;
00284        _g_object_unref0 (_tmp8_);
00285        _tmp9_ = unity_test_filter_suite_find_filter_offset_by_id (filter, "accessories");
00286        _vala_assert (_tmp9_ == 0, "find_filter_offset_by_id (filter, \"accessories\") == 0");
00287        _tmp10_ = unity_test_filter_suite_find_filter_offset_by_id (filter, "bccessories");
00288        _vala_assert (_tmp10_ == 1, "find_filter_offset_by_id (filter, \"bccessories\") == 1");
00289        _tmp11_ = unity_test_filter_suite_find_filter_offset_by_id (filter, "xenomorphs");
00290        _vala_assert (_tmp11_ == 2, "find_filter_offset_by_id (filter, \"xenomorphs\") == 2");
00291        _tmp12_ = unity_options_filter_add_option (filter, "weirdanimal", "Aardvaark", NULL);
00292        _tmp13_ = _tmp12_;
00293        _g_object_unref0 (_tmp13_);
00294        _tmp14_ = unity_test_filter_suite_find_filter_offset_by_id (filter, "weirdanimal");
00295        _vala_assert (_tmp14_ == 0, "find_filter_offset_by_id (filter, \"weirdanimal\") == 0");
00296        _tmp15_ = unity_test_filter_suite_find_filter_offset_by_id (filter, "accessories");
00297        _vala_assert (_tmp15_ == 1, "find_filter_offset_by_id (filter, \"accessories\") == 1");
00298        _tmp16_ = unity_test_filter_suite_find_filter_offset_by_id (filter, "bccessories");
00299        _vala_assert (_tmp16_ == 2, "find_filter_offset_by_id (filter, \"bccessories\") == 2");
00300        _tmp17_ = unity_test_filter_suite_find_filter_offset_by_id (filter, "xenomorphs");
00301        _vala_assert (_tmp17_ == 3, "find_filter_offset_by_id (filter, \"xenomorphs\") == 3");
00302        _tmp18_ = unity_options_filter_add_option (filter, "zooanimal", "Zebra", NULL);
00303        _tmp19_ = _tmp18_;
00304        _g_object_unref0 (_tmp19_);
00305        _tmp20_ = unity_test_filter_suite_find_filter_offset_by_id (filter, "weirdanimal");
00306        _vala_assert (_tmp20_ == 0, "find_filter_offset_by_id (filter, \"weirdanimal\") == 0");
00307        _tmp21_ = unity_test_filter_suite_find_filter_offset_by_id (filter, "accessories");
00308        _vala_assert (_tmp21_ == 1, "find_filter_offset_by_id (filter, \"accessories\") == 1");
00309        _tmp22_ = unity_test_filter_suite_find_filter_offset_by_id (filter, "bccessories");
00310        _vala_assert (_tmp22_ == 2, "find_filter_offset_by_id (filter, \"bccessories\") == 2");
00311        _tmp23_ = unity_test_filter_suite_find_filter_offset_by_id (filter, "xenomorphs");
00312        _vala_assert (_tmp23_ == 3, "find_filter_offset_by_id (filter, \"xenomorphs\") == 3");
00313        _tmp24_ = unity_test_filter_suite_find_filter_offset_by_id (filter, "zooanimal");
00314        _vala_assert (_tmp24_ == 4, "find_filter_offset_by_id (filter, \"zooanimal\") == 4");
00315        _g_object_unref0 (filter);
00316 }
00317 
00318 
00319 void unity_test_filter_suite_test_options_filter_sort_id (void) {
00320        UnityOptionsFilter* _tmp0_;
00321        UnityOptionsFilter* filter;
00322        UnityOptionsFilterSortType _tmp1_;
00323        UnityOptionsFilterSortType _tmp2_;
00324        UnityFilterOption* _tmp3_ = NULL;
00325        UnityFilterOption* _tmp4_;
00326        UnityFilterOption* _tmp5_ = NULL;
00327        UnityFilterOption* _tmp6_;
00328        UnityFilterOption* _tmp7_ = NULL;
00329        UnityFilterOption* _tmp8_;
00330        gint _tmp9_ = 0;
00331        gint _tmp10_ = 0;
00332        gint _tmp11_ = 0;
00333        UnityFilterOption* _tmp12_ = NULL;
00334        UnityFilterOption* _tmp13_;
00335        gint _tmp14_ = 0;
00336        gint _tmp15_ = 0;
00337        gint _tmp16_ = 0;
00338        gint _tmp17_ = 0;
00339        UnityFilterOption* _tmp18_ = NULL;
00340        UnityFilterOption* _tmp19_;
00341        gint _tmp20_ = 0;
00342        gint _tmp21_ = 0;
00343        gint _tmp22_ = 0;
00344        gint _tmp23_ = 0;
00345        gint _tmp24_ = 0;
00346        _tmp0_ = unity_options_filter_new ();
00347        filter = _tmp0_;
00348        unity_options_filter_set_sort_type (filter, UNITY_OPTIONS_FILTER_SORT_TYPE_ID);
00349        _tmp1_ = unity_options_filter_get_sort_type (filter);
00350        _tmp2_ = _tmp1_;
00351        _vala_assert (_tmp2_ == UNITY_OPTIONS_FILTER_SORT_TYPE_ID, "filter.sort_type == OptionsFilter.SortType.ID");
00352        _tmp3_ = unity_options_filter_add_option (filter, "accessories", "Accessories", NULL);
00353        _tmp4_ = _tmp3_;
00354        _g_object_unref0 (_tmp4_);
00355        _tmp5_ = unity_options_filter_add_option (filter, "bccessories", "Bccessories", NULL);
00356        _tmp6_ = _tmp5_;
00357        _g_object_unref0 (_tmp6_);
00358        _tmp7_ = unity_options_filter_add_option (filter, "xenomorphs", "Xenomorphic Creatures", NULL);
00359        _tmp8_ = _tmp7_;
00360        _g_object_unref0 (_tmp8_);
00361        _tmp9_ = unity_test_filter_suite_find_filter_offset_by_id (filter, "accessories");
00362        _vala_assert (_tmp9_ == 0, "find_filter_offset_by_id (filter, \"accessories\") == 0");
00363        _tmp10_ = unity_test_filter_suite_find_filter_offset_by_id (filter, "bccessories");
00364        _vala_assert (_tmp10_ == 1, "find_filter_offset_by_id (filter, \"bccessories\") == 1");
00365        _tmp11_ = unity_test_filter_suite_find_filter_offset_by_id (filter, "xenomorphs");
00366        _vala_assert (_tmp11_ == 2, "find_filter_offset_by_id (filter, \"xenomorphs\") == 2");
00367        _tmp12_ = unity_options_filter_add_option (filter, "weirdanimal", "Aardvaark", NULL);
00368        _tmp13_ = _tmp12_;
00369        _g_object_unref0 (_tmp13_);
00370        _tmp14_ = unity_test_filter_suite_find_filter_offset_by_id (filter, "accessories");
00371        _vala_assert (_tmp14_ == 0, "find_filter_offset_by_id (filter, \"accessories\") == 0");
00372        _tmp15_ = unity_test_filter_suite_find_filter_offset_by_id (filter, "bccessories");
00373        _vala_assert (_tmp15_ == 1, "find_filter_offset_by_id (filter, \"bccessories\") == 1");
00374        _tmp16_ = unity_test_filter_suite_find_filter_offset_by_id (filter, "weirdanimal");
00375        _vala_assert (_tmp16_ == 2, "find_filter_offset_by_id (filter, \"weirdanimal\") == 2");
00376        _tmp17_ = unity_test_filter_suite_find_filter_offset_by_id (filter, "xenomorphs");
00377        _vala_assert (_tmp17_ == 3, "find_filter_offset_by_id (filter, \"xenomorphs\") == 3");
00378        _tmp18_ = unity_options_filter_add_option (filter, "zooanimal", "Zebra", NULL);
00379        _tmp19_ = _tmp18_;
00380        _g_object_unref0 (_tmp19_);
00381        _tmp20_ = unity_test_filter_suite_find_filter_offset_by_id (filter, "accessories");
00382        _vala_assert (_tmp20_ == 0, "find_filter_offset_by_id (filter, \"accessories\") == 0");
00383        _tmp21_ = unity_test_filter_suite_find_filter_offset_by_id (filter, "bccessories");
00384        _vala_assert (_tmp21_ == 1, "find_filter_offset_by_id (filter, \"bccessories\") == 1");
00385        _tmp22_ = unity_test_filter_suite_find_filter_offset_by_id (filter, "weirdanimal");
00386        _vala_assert (_tmp22_ == 2, "find_filter_offset_by_id (filter, \"weirdanimal\") == 2");
00387        _tmp23_ = unity_test_filter_suite_find_filter_offset_by_id (filter, "xenomorphs");
00388        _vala_assert (_tmp23_ == 3, "find_filter_offset_by_id (filter, \"xenomorphs\") == 3");
00389        _tmp24_ = unity_test_filter_suite_find_filter_offset_by_id (filter, "zooanimal");
00390        _vala_assert (_tmp24_ == 4, "find_filter_offset_by_id (filter, \"zooanimal\") == 4");
00391        _g_object_unref0 (filter);
00392 }
00393 
00394 
00395 static void unity_test_value_filter_suite_init (GValue* value) {
00396        value->data[0].v_pointer = NULL;
00397 }
00398 
00399 
00400 static void unity_test_value_filter_suite_free_value (GValue* value) {
00401        if (value->data[0].v_pointer) {
00402               unity_test_filter_suite_unref (value->data[0].v_pointer);
00403        }
00404 }
00405 
00406 
00407 static void unity_test_value_filter_suite_copy_value (const GValue* src_value, GValue* dest_value) {
00408        if (src_value->data[0].v_pointer) {
00409               dest_value->data[0].v_pointer = unity_test_filter_suite_ref (src_value->data[0].v_pointer);
00410        } else {
00411               dest_value->data[0].v_pointer = NULL;
00412        }
00413 }
00414 
00415 
00416 static gpointer unity_test_value_filter_suite_peek_pointer (const GValue* value) {
00417        return value->data[0].v_pointer;
00418 }
00419 
00420 
00421 static gchar* unity_test_value_filter_suite_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
00422        if (collect_values[0].v_pointer) {
00423               UnityTestFilterSuite* object;
00424               object = collect_values[0].v_pointer;
00425               if (object->parent_instance.g_class == NULL) {
00426                      return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
00427               } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
00428                      return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
00429               }
00430               value->data[0].v_pointer = unity_test_filter_suite_ref (object);
00431        } else {
00432               value->data[0].v_pointer = NULL;
00433        }
00434        return NULL;
00435 }
00436 
00437 
00438 static gchar* unity_test_value_filter_suite_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
00439        UnityTestFilterSuite** object_p;
00440        object_p = collect_values[0].v_pointer;
00441        if (!object_p) {
00442               return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
00443        }
00444        if (!value->data[0].v_pointer) {
00445               *object_p = NULL;
00446        } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
00447               *object_p = value->data[0].v_pointer;
00448        } else {
00449               *object_p = unity_test_filter_suite_ref (value->data[0].v_pointer);
00450        }
00451        return NULL;
00452 }
00453 
00454 
00455 GParamSpec* unity_test_param_spec_filter_suite (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
00456        UnityTestParamSpecFilterSuite* spec;
00457        g_return_val_if_fail (g_type_is_a (object_type, UNITY_TEST_TYPE_FILTER_SUITE), NULL);
00458        spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
00459        G_PARAM_SPEC (spec)->value_type = object_type;
00460        return G_PARAM_SPEC (spec);
00461 }
00462 
00463 
00464 gpointer unity_test_value_get_filter_suite (const GValue* value) {
00465        g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, UNITY_TEST_TYPE_FILTER_SUITE), NULL);
00466        return value->data[0].v_pointer;
00467 }
00468 
00469 
00470 void unity_test_value_set_filter_suite (GValue* value, gpointer v_object) {
00471        UnityTestFilterSuite* old;
00472        g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, UNITY_TEST_TYPE_FILTER_SUITE));
00473        old = value->data[0].v_pointer;
00474        if (v_object) {
00475               g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, UNITY_TEST_TYPE_FILTER_SUITE));
00476               g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
00477               value->data[0].v_pointer = v_object;
00478               unity_test_filter_suite_ref (value->data[0].v_pointer);
00479        } else {
00480               value->data[0].v_pointer = NULL;
00481        }
00482        if (old) {
00483               unity_test_filter_suite_unref (old);
00484        }
00485 }
00486 
00487 
00488 void unity_test_value_take_filter_suite (GValue* value, gpointer v_object) {
00489        UnityTestFilterSuite* old;
00490        g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, UNITY_TEST_TYPE_FILTER_SUITE));
00491        old = value->data[0].v_pointer;
00492        if (v_object) {
00493               g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, UNITY_TEST_TYPE_FILTER_SUITE));
00494               g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
00495               value->data[0].v_pointer = v_object;
00496        } else {
00497               value->data[0].v_pointer = NULL;
00498        }
00499        if (old) {
00500               unity_test_filter_suite_unref (old);
00501        }
00502 }
00503 
00504 
00505 static void unity_test_filter_suite_class_init (UnityTestFilterSuiteClass * klass) {
00506        unity_test_filter_suite_parent_class = g_type_class_peek_parent (klass);
00507        UNITY_TEST_FILTER_SUITE_CLASS (klass)->finalize = unity_test_filter_suite_finalize;
00508 }
00509 
00510 
00511 static void unity_test_filter_suite_instance_init (UnityTestFilterSuite * self) {
00512        self->ref_count = 1;
00513 }
00514 
00515 
00516 static void unity_test_filter_suite_finalize (UnityTestFilterSuite* obj) {
00517        UnityTestFilterSuite * self;
00518        self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TEST_TYPE_FILTER_SUITE, UnityTestFilterSuite);
00519 }
00520 
00521 
00522 GType unity_test_filter_suite_get_type (void) {
00523        static volatile gsize unity_test_filter_suite_type_id__volatile = 0;
00524        if (g_once_init_enter (&unity_test_filter_suite_type_id__volatile)) {
00525               static const GTypeValueTable g_define_type_value_table = { unity_test_value_filter_suite_init, unity_test_value_filter_suite_free_value, unity_test_value_filter_suite_copy_value, unity_test_value_filter_suite_peek_pointer, "p", unity_test_value_filter_suite_collect_value, "p", unity_test_value_filter_suite_lcopy_value };
00526               static const GTypeInfo g_define_type_info = { sizeof (UnityTestFilterSuiteClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_test_filter_suite_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityTestFilterSuite), 0, (GInstanceInitFunc) unity_test_filter_suite_instance_init, &g_define_type_value_table };
00527               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) };
00528               GType unity_test_filter_suite_type_id;
00529               unity_test_filter_suite_type_id = g_type_register_fundamental (g_type_fundamental_next (), "UnityTestFilterSuite", &g_define_type_info, &g_define_type_fundamental_info, 0);
00530               g_once_init_leave (&unity_test_filter_suite_type_id__volatile, unity_test_filter_suite_type_id);
00531        }
00532        return unity_test_filter_suite_type_id__volatile;
00533 }
00534 
00535 
00536 gpointer unity_test_filter_suite_ref (gpointer instance) {
00537        UnityTestFilterSuite* self;
00538        self = instance;
00539        g_atomic_int_inc (&self->ref_count);
00540        return instance;
00541 }
00542 
00543 
00544 void unity_test_filter_suite_unref (gpointer instance) {
00545        UnityTestFilterSuite* self;
00546        self = instance;
00547        if (g_atomic_int_dec_and_test (&self->ref_count)) {
00548               UNITY_TEST_FILTER_SUITE_GET_CLASS (self)->finalize (self);
00549               g_type_free_instance ((GTypeInstance *) self);
00550        }
00551 }
00552 
00553 
00554