Back to index

libunity  5.92.0
test-scope-signals.c
Go to the documentation of this file.
00001 /* test-scope-signals.c generated by valac 0.17.2, the Vala compiler
00002  * generated from test-scope-signals.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 Michal Hruby <michal.hruby@canonical.com>
00021  *
00022  */
00023 
00024 #include <glib.h>
00025 #include <glib-object.h>
00026 #include <unity-internal.h>
00027 #include <gio/gio.h>
00028 #include <unity-protocol.h>
00029 #include <stdlib.h>
00030 #include <string.h>
00031 #include <gobject/gvaluecollector.h>
00032 
00033 
00034 #define UNITY_TEST_TYPE_SCOPE_SUITE (unity_test_scope_suite_get_type ())
00035 #define UNITY_TEST_SCOPE_SUITE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TEST_TYPE_SCOPE_SUITE, UnityTestScopeSuite))
00036 #define UNITY_TEST_SCOPE_SUITE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TEST_TYPE_SCOPE_SUITE, UnityTestScopeSuiteClass))
00037 #define UNITY_TEST_IS_SCOPE_SUITE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TEST_TYPE_SCOPE_SUITE))
00038 #define UNITY_TEST_IS_SCOPE_SUITE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TEST_TYPE_SCOPE_SUITE))
00039 #define UNITY_TEST_SCOPE_SUITE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TEST_TYPE_SCOPE_SUITE, UnityTestScopeSuiteClass))
00040 
00041 typedef struct _UnityTestScopeSuite UnityTestScopeSuite;
00042 typedef struct _UnityTestScopeSuiteClass UnityTestScopeSuiteClass;
00043 typedef struct _UnityTestScopeSuitePrivate UnityTestScopeSuitePrivate;
00044 typedef struct _Block2Data Block2Data;
00045 #define _g_main_loop_unref0(var) ((var == NULL) ? NULL : (var = (g_main_loop_unref (var), NULL)))
00046 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
00047 typedef struct _Block3Data Block3Data;
00048 typedef struct _Block4Data Block4Data;
00049 typedef struct _Block5Data Block5Data;
00050 typedef struct _Block6Data Block6Data;
00051 typedef struct _Block7Data Block7Data;
00052 typedef struct _UnityTestParamSpecScopeSuite UnityTestParamSpecScopeSuite;
00053 #define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
00054 
00055 struct _UnityTestScopeSuite {
00056        GTypeInstance parent_instance;
00057        volatile int ref_count;
00058        UnityTestScopeSuitePrivate * priv;
00059 };
00060 
00061 struct _UnityTestScopeSuiteClass {
00062        GTypeClass parent_class;
00063        void (*finalize) (UnityTestScopeSuite *self);
00064 };
00065 
00066 struct _Block2Data {
00067        int _ref_count_;
00068        GMainLoop* ml;
00069        gboolean got_signal;
00070 };
00071 
00072 struct _Block3Data {
00073        int _ref_count_;
00074        GMainLoop* ml;
00075        gboolean got_signal;
00076 };
00077 
00078 struct _Block4Data {
00079        int _ref_count_;
00080        GMainLoop* ml;
00081        gboolean got_changed_signal;
00082        gboolean got_gen_signal;
00083 };
00084 
00085 struct _Block5Data {
00086        int _ref_count_;
00087        GMainLoop* ml;
00088        UnityScope* scope;
00089        gint num_changed_signals;
00090        gint num_gen_signals;
00091 };
00092 
00093 struct _Block6Data {
00094        int _ref_count_;
00095        GMainLoop* ml;
00096        gint num_changed;
00097 };
00098 
00099 struct _Block7Data {
00100        int _ref_count_;
00101        GMainLoop* ml;
00102        UnityScope* scope;
00103        GCancellable* canc;
00104 };
00105 
00106 struct _UnityTestParamSpecScopeSuite {
00107        GParamSpec parent_instance;
00108 };
00109 
00110 
00111 static gpointer unity_test_scope_suite_parent_class = NULL;
00112 
00113 gpointer unity_test_scope_suite_ref (gpointer instance);
00114 void unity_test_scope_suite_unref (gpointer instance);
00115 GParamSpec* unity_test_param_spec_scope_suite (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
00116 void unity_test_value_set_scope_suite (GValue* value, gpointer v_object);
00117 void unity_test_value_take_scope_suite (GValue* value, gpointer v_object);
00118 gpointer unity_test_value_get_scope_suite (const GValue* value);
00119 GType unity_test_scope_suite_get_type (void) G_GNUC_CONST;
00120 enum  {
00121        UNITY_TEST_SCOPE_SUITE_DUMMY_PROPERTY
00122 };
00123 UnityTestScopeSuite* unity_test_scope_suite_new (void);
00124 UnityTestScopeSuite* unity_test_scope_suite_construct (GType object_type);
00125 static void unity_test_scope_suite_test_no_search_changed (void);
00126 static void _unity_test_scope_suite_test_no_search_changed_gtest_data_func (gpointer self);
00127 static void unity_test_scope_suite_test_search_changed (void);
00128 static void _unity_test_scope_suite_test_search_changed_gtest_data_func (gpointer self);
00129 static void unity_test_scope_suite_test_search_key (void);
00130 static void _unity_test_scope_suite_test_search_key_gtest_data_func (gpointer self);
00131 static void unity_test_scope_suite_test_search_key_details (void);
00132 static void _unity_test_scope_suite_test_search_key_details_gtest_data_func (gpointer self);
00133 static void unity_test_scope_suite_test_multiple_queue_calls (void);
00134 static void _unity_test_scope_suite_test_multiple_queue_calls_gtest_data_func (gpointer self);
00135 static void unity_test_scope_suite_test_cancellable (void);
00136 static void _unity_test_scope_suite_test_cancellable_gtest_data_func (gpointer self);
00137 static Block2Data* block2_data_ref (Block2Data* _data2_);
00138 static void block2_data_unref (void * _userdata_);
00139 static void __lambda3_ (Block2Data* _data2_);
00140 static void ___lambda3__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self);
00141 static gboolean __lambda4_ (Block2Data* _data2_);
00142 static gboolean ___lambda4__gsource_func (gpointer self);
00143 static Block3Data* block3_data_ref (Block3Data* _data3_);
00144 static void block3_data_unref (void * _userdata_);
00145 static void __lambda5_ (Block3Data* _data3_);
00146 static void ___lambda5__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self);
00147 static gboolean __lambda6_ (void);
00148 static gboolean ___lambda6__gsource_func (gpointer self);
00149 static Block4Data* block4_data_ref (Block4Data* _data4_);
00150 static void block4_data_unref (void * _userdata_);
00151 static void __lambda7_ (Block4Data* _data4_, UnityLensSearch* lens_search, UnitySearchType search_type, GCancellable* cancellable);
00152 static void ___lambda7__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self);
00153 static gchar* __lambda8_ (Block4Data* _data4_, UnityLensSearch* lens_search);
00154 static gchar* ___lambda8__unity_scope_generate_search_key (UnityScope* _sender, UnityLensSearch* search, gpointer self);
00155 static gboolean __lambda9_ (void);
00156 static gboolean ___lambda9__gsource_func (gpointer self);
00157 static Block5Data* block5_data_ref (Block5Data* _data5_);
00158 static void block5_data_unref (void * _userdata_);
00159 static void __lambda10_ (Block5Data* _data5_, UnityLensSearch* lens_search, UnitySearchType search_type, GCancellable* cancellable);
00160 static void ___lambda10__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self);
00161 static gchar* __lambda11_ (Block5Data* _data5_, UnityLensSearch* lens_search);
00162 static gchar* ___lambda11__unity_scope_generate_search_key (UnityScope* _sender, UnityLensSearch* search, gpointer self);
00163 static gboolean __lambda12_ (void);
00164 static gboolean ___lambda12__gsource_func (gpointer self);
00165 static Block6Data* block6_data_ref (Block6Data* _data6_);
00166 static void block6_data_unref (void * _userdata_);
00167 static void __lambda13_ (Block6Data* _data6_);
00168 static void ___lambda13__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self);
00169 static gboolean __lambda14_ (Block6Data* _data6_);
00170 static gboolean ___lambda14__gsource_func (gpointer self);
00171 static Block7Data* block7_data_ref (Block7Data* _data7_);
00172 static void block7_data_unref (void * _userdata_);
00173 static void __lambda15_ (Block7Data* _data7_, UnityLensSearch* lens_search, UnitySearchType search_type, GCancellable* cancellable);
00174 static void ___lambda15__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self);
00175 static gboolean __lambda16_ (void);
00176 static gboolean ___lambda16__gsource_func (gpointer self);
00177 static void unity_test_scope_suite_finalize (UnityTestScopeSuite* obj);
00178 
00179 
00180 static void _unity_test_scope_suite_test_no_search_changed_gtest_data_func (gpointer self) {
00181        unity_test_scope_suite_test_no_search_changed ();
00182 }
00183 
00184 
00185 static void _unity_test_scope_suite_test_search_changed_gtest_data_func (gpointer self) {
00186        unity_test_scope_suite_test_search_changed ();
00187 }
00188 
00189 
00190 static void _unity_test_scope_suite_test_search_key_gtest_data_func (gpointer self) {
00191        unity_test_scope_suite_test_search_key ();
00192 }
00193 
00194 
00195 static void _unity_test_scope_suite_test_search_key_details_gtest_data_func (gpointer self) {
00196        unity_test_scope_suite_test_search_key_details ();
00197 }
00198 
00199 
00200 static void _unity_test_scope_suite_test_multiple_queue_calls_gtest_data_func (gpointer self) {
00201        unity_test_scope_suite_test_multiple_queue_calls ();
00202 }
00203 
00204 
00205 static void _unity_test_scope_suite_test_cancellable_gtest_data_func (gpointer self) {
00206        unity_test_scope_suite_test_cancellable ();
00207 }
00208 
00209 
00210 UnityTestScopeSuite* unity_test_scope_suite_construct (GType object_type) {
00211        UnityTestScopeSuite* self = NULL;
00212        self = (UnityTestScopeSuite*) g_type_create_instance (object_type);
00213        g_test_add_data_func ("/Unit/Scope/Signal/NoSearchChanged", NULL, _unity_test_scope_suite_test_no_search_changed_gtest_data_func);
00214        g_test_add_data_func ("/Unit/Scope/Signal/SearchChanged", NULL, _unity_test_scope_suite_test_search_changed_gtest_data_func);
00215        g_test_add_data_func ("/Unit/Scope/Signal/SearchKey", NULL, _unity_test_scope_suite_test_search_key_gtest_data_func);
00216        g_test_add_data_func ("/Unit/Scope/Signal/SearchKeyDetails", NULL, _unity_test_scope_suite_test_search_key_details_gtest_data_func);
00217        g_test_add_data_func ("/Unit/Scope/Signals/MultipleQueueCalls", NULL, _unity_test_scope_suite_test_multiple_queue_calls_gtest_data_func);
00218        g_test_add_data_func ("/Unit/Scope/Signals/Cancellable", NULL, _unity_test_scope_suite_test_cancellable_gtest_data_func);
00219        return self;
00220 }
00221 
00222 
00223 UnityTestScopeSuite* unity_test_scope_suite_new (void) {
00224        return unity_test_scope_suite_construct (UNITY_TEST_TYPE_SCOPE_SUITE);
00225 }
00226 
00227 
00228 static Block2Data* block2_data_ref (Block2Data* _data2_) {
00229        g_atomic_int_inc (&_data2_->_ref_count_);
00230        return _data2_;
00231 }
00232 
00233 
00234 static void block2_data_unref (void * _userdata_) {
00235        Block2Data* _data2_;
00236        _data2_ = (Block2Data*) _userdata_;
00237        if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
00238               _g_main_loop_unref0 (_data2_->ml);
00239               g_slice_free (Block2Data, _data2_);
00240        }
00241 }
00242 
00243 
00244 static void __lambda3_ (Block2Data* _data2_) {
00245        _data2_->got_signal = TRUE;
00246        g_main_loop_quit (_data2_->ml);
00247 }
00248 
00249 
00250 static void ___lambda3__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self) {
00251        __lambda3_ (self);
00252 }
00253 
00254 
00255 static gboolean __lambda4_ (Block2Data* _data2_) {
00256        gboolean result = FALSE;
00257        g_main_loop_quit (_data2_->ml);
00258        result = FALSE;
00259        return result;
00260 }
00261 
00262 
00263 static gboolean ___lambda4__gsource_func (gpointer self) {
00264        gboolean result;
00265        result = __lambda4_ (self);
00266        return result;
00267 }
00268 
00269 
00270 static void unity_test_scope_suite_test_no_search_changed (void) {
00271        Block2Data* _data2_;
00272        GMainLoop* _tmp0_;
00273        UnityScope* _tmp1_;
00274        UnityScope* scope;
00275        guint _tmp2_ = 0U;
00276        guint tid;
00277        _data2_ = g_slice_new0 (Block2Data);
00278        _data2_->_ref_count_ = 1;
00279        _tmp0_ = g_main_loop_new (NULL, FALSE);
00280        _data2_->ml = _tmp0_;
00281        _tmp1_ = unity_scope_new ("com/canonical/Scope/Test");
00282        scope = _tmp1_;
00283        _vala_assert (scope != NULL, "scope != null");
00284        _data2_->got_signal = FALSE;
00285        g_signal_connect_data (scope, "search-changed", (GCallback) ___lambda3__unity_scope_search_changed, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
00286        unity_scope_queue_search_changed (scope, UNITY_SEARCH_TYPE_DEFAULT);
00287        _tmp2_ = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 500, ___lambda4__gsource_func, block2_data_ref (_data2_), block2_data_unref);
00288        tid = _tmp2_;
00289        g_main_loop_run (_data2_->ml);
00290        _vala_assert (_data2_->got_signal == FALSE, "got_signal == false");
00291        g_source_remove (tid);
00292        _g_object_unref0 (scope);
00293        block2_data_unref (_data2_);
00294        _data2_ = NULL;
00295 }
00296 
00297 
00298 static Block3Data* block3_data_ref (Block3Data* _data3_) {
00299        g_atomic_int_inc (&_data3_->_ref_count_);
00300        return _data3_;
00301 }
00302 
00303 
00304 static void block3_data_unref (void * _userdata_) {
00305        Block3Data* _data3_;
00306        _data3_ = (Block3Data*) _userdata_;
00307        if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
00308               _g_main_loop_unref0 (_data3_->ml);
00309               g_slice_free (Block3Data, _data3_);
00310        }
00311 }
00312 
00313 
00314 static void __lambda5_ (Block3Data* _data3_) {
00315        _data3_->got_signal = TRUE;
00316        g_main_loop_quit (_data3_->ml);
00317 }
00318 
00319 
00320 static void ___lambda5__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self) {
00321        __lambda5_ (self);
00322 }
00323 
00324 
00325 static gboolean __lambda6_ (void) {
00326        gboolean result = FALSE;
00327        g_assert_not_reached ();
00328        return result;
00329 }
00330 
00331 
00332 static gboolean ___lambda6__gsource_func (gpointer self) {
00333        gboolean result;
00334        result = __lambda6_ ();
00335        return result;
00336 }
00337 
00338 
00339 static void unity_test_scope_suite_test_search_changed (void) {
00340        Block3Data* _data3_;
00341        GMainLoop* _tmp0_;
00342        UnityScope* _tmp1_;
00343        UnityScope* scope;
00344        guint _tmp2_ = 0U;
00345        guint tid;
00346        _data3_ = g_slice_new0 (Block3Data);
00347        _data3_->_ref_count_ = 1;
00348        _tmp0_ = g_main_loop_new (NULL, FALSE);
00349        _data3_->ml = _tmp0_;
00350        _tmp1_ = unity_scope_new ("com/canonical/Scope/Test");
00351        scope = _tmp1_;
00352        _vala_assert (scope != NULL, "scope != null");
00353        unity_scope_set_view_type_internal (scope, UNITY_PROTOCOL_VIEW_TYPE_LENS_VIEW);
00354        _data3_->got_signal = FALSE;
00355        g_signal_connect_data (scope, "search-changed", (GCallback) ___lambda5__unity_scope_search_changed, block3_data_ref (_data3_), (GClosureNotify) block3_data_unref, 0);
00356        unity_scope_queue_search_changed (scope, UNITY_SEARCH_TYPE_DEFAULT);
00357        _tmp2_ = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 500, ___lambda6__gsource_func, NULL, NULL);
00358        tid = _tmp2_;
00359        g_main_loop_run (_data3_->ml);
00360        _vala_assert (_data3_->got_signal == TRUE, "got_signal == true");
00361        g_source_remove (tid);
00362        _g_object_unref0 (scope);
00363        block3_data_unref (_data3_);
00364        _data3_ = NULL;
00365 }
00366 
00367 
00368 static Block4Data* block4_data_ref (Block4Data* _data4_) {
00369        g_atomic_int_inc (&_data4_->_ref_count_);
00370        return _data4_;
00371 }
00372 
00373 
00374 static void block4_data_unref (void * _userdata_) {
00375        Block4Data* _data4_;
00376        _data4_ = (Block4Data*) _userdata_;
00377        if (g_atomic_int_dec_and_test (&_data4_->_ref_count_)) {
00378               _g_main_loop_unref0 (_data4_->ml);
00379               g_slice_free (Block4Data, _data4_);
00380        }
00381 }
00382 
00383 
00384 static void __lambda7_ (Block4Data* _data4_, UnityLensSearch* lens_search, UnitySearchType search_type, GCancellable* cancellable) {
00385        g_return_if_fail (lens_search != NULL);
00386        g_return_if_fail (cancellable != NULL);
00387        _data4_->got_changed_signal = TRUE;
00388        g_main_loop_quit (_data4_->ml);
00389 }
00390 
00391 
00392 static void ___lambda7__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self) {
00393        __lambda7_ (self, search, search_type, cancellable);
00394 }
00395 
00396 
00397 static gchar* __lambda8_ (Block4Data* _data4_, UnityLensSearch* lens_search) {
00398        gchar* result = NULL;
00399        gchar* _tmp0_;
00400        g_return_val_if_fail (lens_search != NULL, NULL);
00401        _data4_->got_gen_signal = TRUE;
00402        _tmp0_ = g_strdup ("foo");
00403        result = _tmp0_;
00404        return result;
00405 }
00406 
00407 
00408 static gchar* ___lambda8__unity_scope_generate_search_key (UnityScope* _sender, UnityLensSearch* search, gpointer self) {
00409        gchar* result;
00410        result = __lambda8_ (self, search);
00411        return result;
00412 }
00413 
00414 
00415 static gboolean __lambda9_ (void) {
00416        gboolean result = FALSE;
00417        g_assert_not_reached ();
00418        return result;
00419 }
00420 
00421 
00422 static gboolean ___lambda9__gsource_func (gpointer self) {
00423        gboolean result;
00424        result = __lambda9_ ();
00425        return result;
00426 }
00427 
00428 
00429 static void unity_test_scope_suite_test_search_key (void) {
00430        Block4Data* _data4_;
00431        GMainLoop* _tmp0_;
00432        UnityScope* _tmp1_;
00433        UnityScope* scope;
00434        guint _tmp2_ = 0U;
00435        guint tid;
00436        _data4_ = g_slice_new0 (Block4Data);
00437        _data4_->_ref_count_ = 1;
00438        _tmp0_ = g_main_loop_new (NULL, FALSE);
00439        _data4_->ml = _tmp0_;
00440        _tmp1_ = unity_scope_new ("com/canonical/Scope/Test");
00441        scope = _tmp1_;
00442        _vala_assert (scope != NULL, "scope != null");
00443        unity_scope_set_view_type_internal (scope, UNITY_PROTOCOL_VIEW_TYPE_LENS_VIEW);
00444        _data4_->got_changed_signal = FALSE;
00445        g_signal_connect_data (scope, "search-changed", (GCallback) ___lambda7__unity_scope_search_changed, block4_data_ref (_data4_), (GClosureNotify) block4_data_unref, 0);
00446        _data4_->got_gen_signal = FALSE;
00447        g_signal_connect_data (scope, "generate-search-key", (GCallback) ___lambda8__unity_scope_generate_search_key, block4_data_ref (_data4_), (GClosureNotify) block4_data_unref, 0);
00448        unity_scope_queue_search_changed (scope, UNITY_SEARCH_TYPE_DEFAULT);
00449        _tmp2_ = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 500, ___lambda9__gsource_func, NULL, NULL);
00450        tid = _tmp2_;
00451        g_main_loop_run (_data4_->ml);
00452        _vala_assert (_data4_->got_changed_signal == TRUE, "got_changed_signal == true");
00453        _vala_assert (_data4_->got_gen_signal == TRUE, "got_gen_signal == true");
00454        g_source_remove (tid);
00455        _g_object_unref0 (scope);
00456        block4_data_unref (_data4_);
00457        _data4_ = NULL;
00458 }
00459 
00460 
00461 static Block5Data* block5_data_ref (Block5Data* _data5_) {
00462        g_atomic_int_inc (&_data5_->_ref_count_);
00463        return _data5_;
00464 }
00465 
00466 
00467 static void block5_data_unref (void * _userdata_) {
00468        Block5Data* _data5_;
00469        _data5_ = (Block5Data*) _userdata_;
00470        if (g_atomic_int_dec_and_test (&_data5_->_ref_count_)) {
00471               _g_object_unref0 (_data5_->scope);
00472               _g_main_loop_unref0 (_data5_->ml);
00473               g_slice_free (Block5Data, _data5_);
00474        }
00475 }
00476 
00477 
00478 static void __lambda10_ (Block5Data* _data5_, UnityLensSearch* lens_search, UnitySearchType search_type, GCancellable* cancellable) {
00479        gint _tmp0_;
00480        g_return_if_fail (lens_search != NULL);
00481        g_return_if_fail (cancellable != NULL);
00482        _tmp0_ = _data5_->num_changed_signals;
00483        _data5_->num_changed_signals = _tmp0_ + 1;
00484        if (_data5_->num_changed_signals == 1) {
00485               unity_scope_set_view_type_internal (_data5_->scope, UNITY_PROTOCOL_VIEW_TYPE_HOME_VIEW);
00486        } else {
00487               if (_data5_->num_changed_signals >= 2) {
00488                      g_main_loop_quit (_data5_->ml);
00489               }
00490        }
00491 }
00492 
00493 
00494 static void ___lambda10__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self) {
00495        __lambda10_ (self, search, search_type, cancellable);
00496 }
00497 
00498 
00499 static gchar* __lambda11_ (Block5Data* _data5_, UnityLensSearch* lens_search) {
00500        gchar* result = NULL;
00501        gint _tmp0_;
00502        gchar* _tmp1_;
00503        g_return_val_if_fail (lens_search != NULL, NULL);
00504        _tmp0_ = _data5_->num_gen_signals;
00505        _data5_->num_gen_signals = _tmp0_ + 1;
00506        _tmp1_ = g_strdup ("foo");
00507        result = _tmp1_;
00508        return result;
00509 }
00510 
00511 
00512 static gchar* ___lambda11__unity_scope_generate_search_key (UnityScope* _sender, UnityLensSearch* search, gpointer self) {
00513        gchar* result;
00514        result = __lambda11_ (self, search);
00515        return result;
00516 }
00517 
00518 
00519 static gboolean __lambda12_ (void) {
00520        gboolean result = FALSE;
00521        g_assert_not_reached ();
00522        return result;
00523 }
00524 
00525 
00526 static gboolean ___lambda12__gsource_func (gpointer self) {
00527        gboolean result;
00528        result = __lambda12_ ();
00529        return result;
00530 }
00531 
00532 
00533 static void unity_test_scope_suite_test_search_key_details (void) {
00534        Block5Data* _data5_;
00535        GMainLoop* _tmp0_;
00536        UnityScope* _tmp1_;
00537        guint _tmp2_ = 0U;
00538        guint tid;
00539        _data5_ = g_slice_new0 (Block5Data);
00540        _data5_->_ref_count_ = 1;
00541        _tmp0_ = g_main_loop_new (NULL, FALSE);
00542        _data5_->ml = _tmp0_;
00543        _tmp1_ = unity_scope_new ("com/canonical/Scope/Test");
00544        _data5_->scope = _tmp1_;
00545        _vala_assert (_data5_->scope != NULL, "scope != null");
00546        unity_scope_set_view_type_internal (_data5_->scope, UNITY_PROTOCOL_VIEW_TYPE_LENS_VIEW);
00547        _data5_->num_changed_signals = 0;
00548        _data5_->num_gen_signals = 0;
00549        g_signal_connect_data (_data5_->scope, "search-changed", (GCallback) ___lambda10__unity_scope_search_changed, block5_data_ref (_data5_), (GClosureNotify) block5_data_unref, 0);
00550        g_signal_connect_data (_data5_->scope, "generate-search-key::default", (GCallback) ___lambda11__unity_scope_generate_search_key, block5_data_ref (_data5_), (GClosureNotify) block5_data_unref, 0);
00551        unity_scope_queue_search_changed (_data5_->scope, UNITY_SEARCH_TYPE_DEFAULT);
00552        unity_scope_queue_search_changed (_data5_->scope, UNITY_SEARCH_TYPE_GLOBAL);
00553        _tmp2_ = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 500, ___lambda12__gsource_func, NULL, NULL);
00554        tid = _tmp2_;
00555        g_main_loop_run (_data5_->ml);
00556        _vala_assert (_data5_->num_changed_signals == 2, "num_changed_signals == 2");
00557        _vala_assert (_data5_->num_gen_signals == 1, "num_gen_signals == 1");
00558        g_source_remove (tid);
00559        block5_data_unref (_data5_);
00560        _data5_ = NULL;
00561 }
00562 
00563 
00564 static Block6Data* block6_data_ref (Block6Data* _data6_) {
00565        g_atomic_int_inc (&_data6_->_ref_count_);
00566        return _data6_;
00567 }
00568 
00569 
00570 static void block6_data_unref (void * _userdata_) {
00571        Block6Data* _data6_;
00572        _data6_ = (Block6Data*) _userdata_;
00573        if (g_atomic_int_dec_and_test (&_data6_->_ref_count_)) {
00574               _g_main_loop_unref0 (_data6_->ml);
00575               g_slice_free (Block6Data, _data6_);
00576        }
00577 }
00578 
00579 
00580 static void __lambda13_ (Block6Data* _data6_) {
00581        gint _tmp0_;
00582        _tmp0_ = _data6_->num_changed;
00583        _data6_->num_changed = _tmp0_ + 1;
00584 }
00585 
00586 
00587 static void ___lambda13__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self) {
00588        __lambda13_ (self);
00589 }
00590 
00591 
00592 static gboolean __lambda14_ (Block6Data* _data6_) {
00593        gboolean result = FALSE;
00594        g_main_loop_quit (_data6_->ml);
00595        result = FALSE;
00596        return result;
00597 }
00598 
00599 
00600 static gboolean ___lambda14__gsource_func (gpointer self) {
00601        gboolean result;
00602        result = __lambda14_ (self);
00603        return result;
00604 }
00605 
00606 
00607 static void unity_test_scope_suite_test_multiple_queue_calls (void) {
00608        Block6Data* _data6_;
00609        GMainLoop* _tmp0_;
00610        UnityScope* _tmp1_;
00611        UnityScope* scope;
00612        _data6_ = g_slice_new0 (Block6Data);
00613        _data6_->_ref_count_ = 1;
00614        _tmp0_ = g_main_loop_new (NULL, FALSE);
00615        _data6_->ml = _tmp0_;
00616        _tmp1_ = unity_scope_new ("com/canonical/Scope/Test");
00617        scope = _tmp1_;
00618        _vala_assert (scope != NULL, "scope != null");
00619        unity_scope_set_view_type_internal (scope, UNITY_PROTOCOL_VIEW_TYPE_LENS_VIEW);
00620        _data6_->num_changed = 0;
00621        g_signal_connect_data (scope, "search-changed", (GCallback) ___lambda13__unity_scope_search_changed, block6_data_ref (_data6_), (GClosureNotify) block6_data_unref, 0);
00622        unity_scope_queue_search_changed (scope, UNITY_SEARCH_TYPE_DEFAULT);
00623        unity_scope_queue_search_changed (scope, UNITY_SEARCH_TYPE_GLOBAL);
00624        unity_scope_queue_search_changed (scope, UNITY_SEARCH_TYPE_DEFAULT);
00625        unity_scope_queue_search_changed (scope, UNITY_SEARCH_TYPE_GLOBAL);
00626        unity_scope_queue_search_changed (scope, UNITY_SEARCH_TYPE_DEFAULT);
00627        unity_scope_queue_search_changed (scope, UNITY_SEARCH_TYPE_GLOBAL);
00628        unity_scope_queue_search_changed (scope, UNITY_SEARCH_TYPE_DEFAULT);
00629        unity_scope_queue_search_changed (scope, UNITY_SEARCH_TYPE_DEFAULT);
00630        unity_scope_queue_search_changed (scope, UNITY_SEARCH_TYPE_GLOBAL);
00631        unity_scope_queue_search_changed (scope, UNITY_SEARCH_TYPE_GLOBAL);
00632        g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 500, ___lambda14__gsource_func, block6_data_ref (_data6_), block6_data_unref);
00633        g_main_loop_run (_data6_->ml);
00634        _vala_assert (_data6_->num_changed == 1, "num_changed == 1");
00635        _g_object_unref0 (scope);
00636        block6_data_unref (_data6_);
00637        _data6_ = NULL;
00638 }
00639 
00640 
00641 static Block7Data* block7_data_ref (Block7Data* _data7_) {
00642        g_atomic_int_inc (&_data7_->_ref_count_);
00643        return _data7_;
00644 }
00645 
00646 
00647 static void block7_data_unref (void * _userdata_) {
00648        Block7Data* _data7_;
00649        _data7_ = (Block7Data*) _userdata_;
00650        if (g_atomic_int_dec_and_test (&_data7_->_ref_count_)) {
00651               _g_object_unref0 (_data7_->canc);
00652               _g_object_unref0 (_data7_->scope);
00653               _g_main_loop_unref0 (_data7_->ml);
00654               g_slice_free (Block7Data, _data7_);
00655        }
00656 }
00657 
00658 
00659 static gpointer _g_object_ref0 (gpointer self) {
00660        return self ? g_object_ref (self) : NULL;
00661 }
00662 
00663 
00664 static void __lambda15_ (Block7Data* _data7_, UnityLensSearch* lens_search, UnitySearchType search_type, GCancellable* cancellable) {
00665        g_return_if_fail (lens_search != NULL);
00666        g_return_if_fail (cancellable != NULL);
00667        if (_data7_->canc == NULL) {
00668               GCancellable* _tmp0_;
00669               GCancellable* _tmp1_;
00670               _tmp0_ = cancellable;
00671               _tmp1_ = _g_object_ref0 (_tmp0_);
00672               _g_object_unref0 (_data7_->canc);
00673               _data7_->canc = _tmp1_;
00674               unity_scope_queue_search_changed (_data7_->scope, UNITY_SEARCH_TYPE_DEFAULT);
00675        } else {
00676               GCancellable* _tmp2_;
00677               gboolean _tmp3_ = FALSE;
00678               _tmp2_ = cancellable;
00679               _tmp3_ = g_cancellable_is_cancelled (_tmp2_);
00680               _vala_assert (_tmp3_ == FALSE, "cancellable.is_cancelled () == false");
00681               g_main_loop_quit (_data7_->ml);
00682        }
00683 }
00684 
00685 
00686 static void ___lambda15__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self) {
00687        __lambda15_ (self, search, search_type, cancellable);
00688 }
00689 
00690 
00691 static gboolean __lambda16_ (void) {
00692        gboolean result = FALSE;
00693        g_assert_not_reached ();
00694        return result;
00695 }
00696 
00697 
00698 static gboolean ___lambda16__gsource_func (gpointer self) {
00699        gboolean result;
00700        result = __lambda16_ ();
00701        return result;
00702 }
00703 
00704 
00705 static void unity_test_scope_suite_test_cancellable (void) {
00706        Block7Data* _data7_;
00707        GMainLoop* _tmp0_;
00708        UnityScope* _tmp1_;
00709        guint _tmp2_ = 0U;
00710        guint tid;
00711        gboolean _tmp3_ = FALSE;
00712        _data7_ = g_slice_new0 (Block7Data);
00713        _data7_->_ref_count_ = 1;
00714        _tmp0_ = g_main_loop_new (NULL, FALSE);
00715        _data7_->ml = _tmp0_;
00716        _tmp1_ = unity_scope_new ("com/canonical/Scope/Test");
00717        _data7_->scope = _tmp1_;
00718        _vala_assert (_data7_->scope != NULL, "scope != null");
00719        unity_scope_set_view_type_internal (_data7_->scope, UNITY_PROTOCOL_VIEW_TYPE_LENS_VIEW);
00720        _data7_->canc = NULL;
00721        g_signal_connect_data (_data7_->scope, "search-changed", (GCallback) ___lambda15__unity_scope_search_changed, block7_data_ref (_data7_), (GClosureNotify) block7_data_unref, 0);
00722        unity_scope_queue_search_changed (_data7_->scope, UNITY_SEARCH_TYPE_DEFAULT);
00723        _tmp2_ = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 500, ___lambda16__gsource_func, NULL, NULL);
00724        tid = _tmp2_;
00725        g_main_loop_run (_data7_->ml);
00726        _vala_assert (_data7_->canc != NULL, "canc != null");
00727        _tmp3_ = g_cancellable_is_cancelled (_data7_->canc);
00728        _vala_assert (_tmp3_ == TRUE, "canc.is_cancelled () == true");
00729        g_source_remove (tid);
00730        block7_data_unref (_data7_);
00731        _data7_ = NULL;
00732 }
00733 
00734 
00735 static void unity_test_value_scope_suite_init (GValue* value) {
00736        value->data[0].v_pointer = NULL;
00737 }
00738 
00739 
00740 static void unity_test_value_scope_suite_free_value (GValue* value) {
00741        if (value->data[0].v_pointer) {
00742               unity_test_scope_suite_unref (value->data[0].v_pointer);
00743        }
00744 }
00745 
00746 
00747 static void unity_test_value_scope_suite_copy_value (const GValue* src_value, GValue* dest_value) {
00748        if (src_value->data[0].v_pointer) {
00749               dest_value->data[0].v_pointer = unity_test_scope_suite_ref (src_value->data[0].v_pointer);
00750        } else {
00751               dest_value->data[0].v_pointer = NULL;
00752        }
00753 }
00754 
00755 
00756 static gpointer unity_test_value_scope_suite_peek_pointer (const GValue* value) {
00757        return value->data[0].v_pointer;
00758 }
00759 
00760 
00761 static gchar* unity_test_value_scope_suite_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
00762        if (collect_values[0].v_pointer) {
00763               UnityTestScopeSuite* object;
00764               object = collect_values[0].v_pointer;
00765               if (object->parent_instance.g_class == NULL) {
00766                      return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
00767               } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
00768                      return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
00769               }
00770               value->data[0].v_pointer = unity_test_scope_suite_ref (object);
00771        } else {
00772               value->data[0].v_pointer = NULL;
00773        }
00774        return NULL;
00775 }
00776 
00777 
00778 static gchar* unity_test_value_scope_suite_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
00779        UnityTestScopeSuite** object_p;
00780        object_p = collect_values[0].v_pointer;
00781        if (!object_p) {
00782               return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
00783        }
00784        if (!value->data[0].v_pointer) {
00785               *object_p = NULL;
00786        } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
00787               *object_p = value->data[0].v_pointer;
00788        } else {
00789               *object_p = unity_test_scope_suite_ref (value->data[0].v_pointer);
00790        }
00791        return NULL;
00792 }
00793 
00794 
00795 GParamSpec* unity_test_param_spec_scope_suite (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
00796        UnityTestParamSpecScopeSuite* spec;
00797        g_return_val_if_fail (g_type_is_a (object_type, UNITY_TEST_TYPE_SCOPE_SUITE), NULL);
00798        spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
00799        G_PARAM_SPEC (spec)->value_type = object_type;
00800        return G_PARAM_SPEC (spec);
00801 }
00802 
00803 
00804 gpointer unity_test_value_get_scope_suite (const GValue* value) {
00805        g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, UNITY_TEST_TYPE_SCOPE_SUITE), NULL);
00806        return value->data[0].v_pointer;
00807 }
00808 
00809 
00810 void unity_test_value_set_scope_suite (GValue* value, gpointer v_object) {
00811        UnityTestScopeSuite* old;
00812        g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, UNITY_TEST_TYPE_SCOPE_SUITE));
00813        old = value->data[0].v_pointer;
00814        if (v_object) {
00815               g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, UNITY_TEST_TYPE_SCOPE_SUITE));
00816               g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
00817               value->data[0].v_pointer = v_object;
00818               unity_test_scope_suite_ref (value->data[0].v_pointer);
00819        } else {
00820               value->data[0].v_pointer = NULL;
00821        }
00822        if (old) {
00823               unity_test_scope_suite_unref (old);
00824        }
00825 }
00826 
00827 
00828 void unity_test_value_take_scope_suite (GValue* value, gpointer v_object) {
00829        UnityTestScopeSuite* old;
00830        g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, UNITY_TEST_TYPE_SCOPE_SUITE));
00831        old = value->data[0].v_pointer;
00832        if (v_object) {
00833               g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, UNITY_TEST_TYPE_SCOPE_SUITE));
00834               g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
00835               value->data[0].v_pointer = v_object;
00836        } else {
00837               value->data[0].v_pointer = NULL;
00838        }
00839        if (old) {
00840               unity_test_scope_suite_unref (old);
00841        }
00842 }
00843 
00844 
00845 static void unity_test_scope_suite_class_init (UnityTestScopeSuiteClass * klass) {
00846        unity_test_scope_suite_parent_class = g_type_class_peek_parent (klass);
00847        UNITY_TEST_SCOPE_SUITE_CLASS (klass)->finalize = unity_test_scope_suite_finalize;
00848 }
00849 
00850 
00851 static void unity_test_scope_suite_instance_init (UnityTestScopeSuite * self) {
00852        self->ref_count = 1;
00853 }
00854 
00855 
00856 static void unity_test_scope_suite_finalize (UnityTestScopeSuite* obj) {
00857        UnityTestScopeSuite * self;
00858        self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TEST_TYPE_SCOPE_SUITE, UnityTestScopeSuite);
00859 }
00860 
00861 
00862 GType unity_test_scope_suite_get_type (void) {
00863        static volatile gsize unity_test_scope_suite_type_id__volatile = 0;
00864        if (g_once_init_enter (&unity_test_scope_suite_type_id__volatile)) {
00865               static const GTypeValueTable g_define_type_value_table = { unity_test_value_scope_suite_init, unity_test_value_scope_suite_free_value, unity_test_value_scope_suite_copy_value, unity_test_value_scope_suite_peek_pointer, "p", unity_test_value_scope_suite_collect_value, "p", unity_test_value_scope_suite_lcopy_value };
00866               static const GTypeInfo g_define_type_info = { sizeof (UnityTestScopeSuiteClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_test_scope_suite_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityTestScopeSuite), 0, (GInstanceInitFunc) unity_test_scope_suite_instance_init, &g_define_type_value_table };
00867               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) };
00868               GType unity_test_scope_suite_type_id;
00869               unity_test_scope_suite_type_id = g_type_register_fundamental (g_type_fundamental_next (), "UnityTestScopeSuite", &g_define_type_info, &g_define_type_fundamental_info, 0);
00870               g_once_init_leave (&unity_test_scope_suite_type_id__volatile, unity_test_scope_suite_type_id);
00871        }
00872        return unity_test_scope_suite_type_id__volatile;
00873 }
00874 
00875 
00876 gpointer unity_test_scope_suite_ref (gpointer instance) {
00877        UnityTestScopeSuite* self;
00878        self = instance;
00879        g_atomic_int_inc (&self->ref_count);
00880        return instance;
00881 }
00882 
00883 
00884 void unity_test_scope_suite_unref (gpointer instance) {
00885        UnityTestScopeSuite* self;
00886        self = instance;
00887        if (g_atomic_int_dec_and_test (&self->ref_count)) {
00888               UNITY_TEST_SCOPE_SUITE_GET_CLASS (self)->finalize (self);
00889               g_type_free_instance ((GTypeInstance *) self);
00890        }
00891 }
00892 
00893 
00894