Back to index

libunity  5.92.0
test-previews.c
Go to the documentation of this file.
00001 /* test-previews.c generated by valac 0.17.2, the Vala compiler
00002  * generated from test-previews.vala, do not modify */
00003 
00004 /* -*- Mode: vala; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
00005 /*
00006  * Copyright (C) 2012 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 <gio/gio.h>
00027 #include <unity-internal.h>
00028 #include <dee.h>
00029 #include <unity-protocol.h>
00030 #include <stdlib.h>
00031 #include <string.h>
00032 #include <gobject/gvaluecollector.h>
00033 
00034 
00035 #define UNITY_TEST_TYPE_PREVIEW_SUITE (unity_test_preview_suite_get_type ())
00036 #define UNITY_TEST_PREVIEW_SUITE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TEST_TYPE_PREVIEW_SUITE, UnityTestPreviewSuite))
00037 #define UNITY_TEST_PREVIEW_SUITE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TEST_TYPE_PREVIEW_SUITE, UnityTestPreviewSuiteClass))
00038 #define UNITY_TEST_IS_PREVIEW_SUITE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TEST_TYPE_PREVIEW_SUITE))
00039 #define UNITY_TEST_IS_PREVIEW_SUITE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TEST_TYPE_PREVIEW_SUITE))
00040 #define UNITY_TEST_PREVIEW_SUITE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TEST_TYPE_PREVIEW_SUITE, UnityTestPreviewSuiteClass))
00041 
00042 typedef struct _UnityTestPreviewSuite UnityTestPreviewSuite;
00043 typedef struct _UnityTestPreviewSuiteClass UnityTestPreviewSuiteClass;
00044 typedef struct _UnityTestPreviewSuitePrivate UnityTestPreviewSuitePrivate;
00045 #define _g_free0(var) (var = (g_free (var), NULL))
00046 #define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
00047 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
00048 typedef struct _Block1Data Block1Data;
00049 typedef struct _UnityTestParamSpecPreviewSuite UnityTestParamSpecPreviewSuite;
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 _UnityTestPreviewSuite {
00053        GTypeInstance parent_instance;
00054        volatile int ref_count;
00055        UnityTestPreviewSuitePrivate * priv;
00056 };
00057 
00058 struct _UnityTestPreviewSuiteClass {
00059        GTypeClass parent_class;
00060        void (*finalize) (UnityTestPreviewSuite *self);
00061 };
00062 
00063 struct _Block1Data {
00064        int _ref_count_;
00065        gchar* title;
00066        gchar* desc;
00067        gboolean got_generate_preview_signal;
00068 };
00069 
00070 struct _UnityTestParamSpecPreviewSuite {
00071        GParamSpec parent_instance;
00072 };
00073 
00074 
00075 static gpointer unity_test_preview_suite_parent_class = NULL;
00076 
00077 gpointer unity_test_preview_suite_ref (gpointer instance);
00078 void unity_test_preview_suite_unref (gpointer instance);
00079 GParamSpec* unity_test_param_spec_preview_suite (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
00080 void unity_test_value_set_preview_suite (GValue* value, gpointer v_object);
00081 void unity_test_value_take_preview_suite (GValue* value, gpointer v_object);
00082 gpointer unity_test_value_get_preview_suite (const GValue* value);
00083 GType unity_test_preview_suite_get_type (void) G_GNUC_CONST;
00084 enum  {
00085        UNITY_TEST_PREVIEW_SUITE_DUMMY_PROPERTY
00086 };
00087 UnityTestPreviewSuite* unity_test_preview_suite_new (void);
00088 UnityTestPreviewSuite* unity_test_preview_suite_construct (GType object_type);
00089 static void unity_test_preview_suite_test_preview_generic (void);
00090 static void _unity_test_preview_suite_test_preview_generic_gtest_data_func (gpointer self);
00091 static void unity_test_preview_suite_test_preview_generic_with_metadata (void);
00092 static void _unity_test_preview_suite_test_preview_generic_with_metadata_gtest_data_func (gpointer self);
00093 static void unity_test_preview_suite_test_preview_application (void);
00094 static void _unity_test_preview_suite_test_preview_application_gtest_data_func (gpointer self);
00095 static void unity_test_preview_suite_test_preview_music (void);
00096 static void _unity_test_preview_suite_test_preview_music_gtest_data_func (gpointer self);
00097 static void unity_test_preview_suite_test_preview_music_with_tracks (void);
00098 static void _unity_test_preview_suite_test_preview_music_with_tracks_gtest_data_func (gpointer self);
00099 static void unity_test_preview_suite_test_preview_movie (void);
00100 static void _unity_test_preview_suite_test_preview_movie_gtest_data_func (gpointer self);
00101 static void unity_test_preview_suite_test_preview_series (void);
00102 static void _unity_test_preview_suite_test_preview_series_gtest_data_func (gpointer self);
00103 static void unity_test_preview_suite_test_preview_series_with_items (void);
00104 static void _unity_test_preview_suite_test_preview_series_with_items_gtest_data_func (gpointer self);
00105 static gboolean unity_test_preview_suite_previews_equal (GVariant* data, GVariant* data2);
00106 static Block1Data* block1_data_ref (Block1Data* _data1_);
00107 static void block1_data_unref (void * _userdata_);
00108 static UnityPreview* __lambda2_ (Block1Data* _data1_);
00109 static UnityPreview* ___lambda2__unity_series_preview_request_item_preview (UnitySeriesPreview* _sender, const gchar* uri, gpointer self);
00110 static void unity_test_preview_suite_finalize (UnityTestPreviewSuite* obj);
00111 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
00112 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
00113 
00114 
00115 static void _unity_test_preview_suite_test_preview_generic_gtest_data_func (gpointer self) {
00116        unity_test_preview_suite_test_preview_generic ();
00117 }
00118 
00119 
00120 static void _unity_test_preview_suite_test_preview_generic_with_metadata_gtest_data_func (gpointer self) {
00121        unity_test_preview_suite_test_preview_generic_with_metadata ();
00122 }
00123 
00124 
00125 static void _unity_test_preview_suite_test_preview_application_gtest_data_func (gpointer self) {
00126        unity_test_preview_suite_test_preview_application ();
00127 }
00128 
00129 
00130 static void _unity_test_preview_suite_test_preview_music_gtest_data_func (gpointer self) {
00131        unity_test_preview_suite_test_preview_music ();
00132 }
00133 
00134 
00135 static void _unity_test_preview_suite_test_preview_music_with_tracks_gtest_data_func (gpointer self) {
00136        unity_test_preview_suite_test_preview_music_with_tracks ();
00137 }
00138 
00139 
00140 static void _unity_test_preview_suite_test_preview_movie_gtest_data_func (gpointer self) {
00141        unity_test_preview_suite_test_preview_movie ();
00142 }
00143 
00144 
00145 static void _unity_test_preview_suite_test_preview_series_gtest_data_func (gpointer self) {
00146        unity_test_preview_suite_test_preview_series ();
00147 }
00148 
00149 
00150 static void _unity_test_preview_suite_test_preview_series_with_items_gtest_data_func (gpointer self) {
00151        unity_test_preview_suite_test_preview_series_with_items ();
00152 }
00153 
00154 
00155 UnityTestPreviewSuite* unity_test_preview_suite_construct (GType object_type) {
00156        UnityTestPreviewSuite* self = NULL;
00157        self = (UnityTestPreviewSuite*) g_type_create_instance (object_type);
00158        g_test_add_data_func ("/Unit/Preview/GenericPreview", NULL, _unity_test_preview_suite_test_preview_generic_gtest_data_func);
00159        g_test_add_data_func ("/Unit/Preview/GenericPreview/WithMetadata", NULL, _unity_test_preview_suite_test_preview_generic_with_metadata_gtest_data_func);
00160        g_test_add_data_func ("/Unit/Preview/ApplicationPreview", NULL, _unity_test_preview_suite_test_preview_application_gtest_data_func);
00161        g_test_add_data_func ("/Unit/Preview/MusicPreview", NULL, _unity_test_preview_suite_test_preview_music_gtest_data_func);
00162        g_test_add_data_func ("/Unit/Preview/MusicPreview/WithTracks", NULL, _unity_test_preview_suite_test_preview_music_with_tracks_gtest_data_func);
00163        g_test_add_data_func ("/Unit/Preview/MoviePreview", NULL, _unity_test_preview_suite_test_preview_movie_gtest_data_func);
00164        g_test_add_data_func ("/Unit/Preview/SeriesPreview", NULL, _unity_test_preview_suite_test_preview_series_gtest_data_func);
00165        g_test_add_data_func ("/Unit/Preview/SeriesPreview/WithItems", NULL, _unity_test_preview_suite_test_preview_series_with_items_gtest_data_func);
00166        return self;
00167 }
00168 
00169 
00170 UnityTestPreviewSuite* unity_test_preview_suite_new (void) {
00171        return unity_test_preview_suite_construct (UNITY_TEST_TYPE_PREVIEW_SUITE);
00172 }
00173 
00174 
00175 static gboolean unity_test_preview_suite_previews_equal (GVariant* data, GVariant* data2) {
00176        gboolean result = FALSE;
00177        GVariant* _tmp0_;
00178        GVariant* _tmp1_;
00179        gboolean _tmp2_ = FALSE;
00180        g_return_val_if_fail (data != NULL, FALSE);
00181        g_return_val_if_fail (data2 != NULL, FALSE);
00182        _tmp0_ = data;
00183        _tmp1_ = data2;
00184        _tmp2_ = g_variant_equal (_tmp0_, _tmp1_);
00185        if (!_tmp2_) {
00186               GVariant* _tmp3_;
00187               gchar* _tmp4_ = NULL;
00188               gchar* _tmp5_;
00189               GVariant* _tmp6_;
00190               gchar* _tmp7_ = NULL;
00191               gchar* _tmp8_;
00192               _tmp3_ = data;
00193               _tmp4_ = g_variant_print (_tmp3_, TRUE);
00194               _tmp5_ = _tmp4_;
00195               _tmp6_ = data2;
00196               _tmp7_ = g_variant_print (_tmp6_, TRUE);
00197               _tmp8_ = _tmp7_;
00198               g_warning ("test-previews.vala:50: Reconstructed variant doesn't match:\n" \
00199 "%s\n" \
00200 "\n" \
00201 "%s", _tmp5_, _tmp8_);
00202               _g_free0 (_tmp8_);
00203               _g_free0 (_tmp5_);
00204               result = FALSE;
00205               return result;
00206        }
00207        result = TRUE;
00208        return result;
00209 }
00210 
00211 
00212 static void unity_test_preview_suite_test_preview_generic (void) {
00213        GThemedIcon* _tmp0_;
00214        GThemedIcon* thumbnail;
00215        UnityGenericPreview* _tmp1_;
00216        UnityGenericPreview* preview;
00217        GVariant* _tmp2_ = NULL;
00218        GVariant* data;
00219        UnityProtocolPreview* _tmp3_ = NULL;
00220        UnityProtocolGenericPreview* reconstructed;
00221        const gchar* _tmp4_;
00222        const gchar* _tmp5_;
00223        const gchar* _tmp6_;
00224        const gchar* _tmp7_;
00225        const gchar* _tmp8_;
00226        const gchar* _tmp9_;
00227        const gchar* _tmp10_;
00228        const gchar* _tmp11_;
00229        GIcon* _tmp12_;
00230        GIcon* _tmp13_;
00231        GIcon* _tmp14_;
00232        GIcon* _tmp15_;
00233        gboolean _tmp16_ = FALSE;
00234        GVariant* _tmp17_ = NULL;
00235        GVariant* _tmp18_;
00236        gboolean _tmp19_ = FALSE;
00237        _tmp0_ = (GThemedIcon*) g_themed_icon_new ("internet");
00238        thumbnail = _tmp0_;
00239        _tmp1_ = unity_generic_preview_new ("A title", "Description", (GIcon*) thumbnail);
00240        preview = _tmp1_;
00241        _tmp2_ = dee_serializable_serialize ((DeeSerializable*) preview);
00242        data = _tmp2_;
00243        _tmp3_ = unity_protocol_preview_parse (data);
00244        reconstructed = G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, UNITY_PROTOCOL_TYPE_GENERIC_PREVIEW) ? ((UnityProtocolGenericPreview*) _tmp3_) : NULL;
00245        _tmp4_ = unity_preview_get_title ((UnityPreview*) preview);
00246        _tmp5_ = _tmp4_;
00247        _tmp6_ = unity_protocol_preview_get_title ((UnityProtocolPreview*) reconstructed);
00248        _tmp7_ = _tmp6_;
00249        _vala_assert (g_strcmp0 (_tmp5_, _tmp7_) == 0, "preview.title == reconstructed.title");
00250        _tmp8_ = unity_preview_get_description_markup ((UnityPreview*) preview);
00251        _tmp9_ = _tmp8_;
00252        _tmp10_ = unity_protocol_preview_get_description ((UnityProtocolPreview*) reconstructed);
00253        _tmp11_ = _tmp10_;
00254        _vala_assert (g_strcmp0 (_tmp9_, _tmp11_) == 0, "preview.description_markup == reconstructed.description");
00255        _tmp12_ = unity_preview_get_thumbnail ((UnityPreview*) preview);
00256        _tmp13_ = _tmp12_;
00257        _tmp14_ = unity_protocol_preview_get_thumbnail ((UnityProtocolPreview*) reconstructed);
00258        _tmp15_ = _tmp14_;
00259        _tmp16_ = g_icon_equal (_tmp13_, _tmp15_);
00260        _vala_assert (_tmp16_, "preview.thumbnail.equal (reconstructed.thumbnail)");
00261        _tmp17_ = dee_serializable_serialize ((DeeSerializable*) reconstructed);
00262        _tmp18_ = _tmp17_;
00263        _tmp19_ = unity_test_preview_suite_previews_equal (data, _tmp18_);
00264        _vala_assert (_tmp19_, "previews_equal (data, reconstructed.serialize ())");
00265        _g_variant_unref0 (_tmp18_);
00266        _g_object_unref0 (reconstructed);
00267        _g_variant_unref0 (data);
00268        _g_object_unref0 (preview);
00269        _g_object_unref0 (thumbnail);
00270 }
00271 
00272 
00273 static void unity_test_preview_suite_test_preview_generic_with_metadata (void) {
00274        GThemedIcon* _tmp0_;
00275        GThemedIcon* thumbnail;
00276        UnityGenericPreview* _tmp1_;
00277        UnityGenericPreview* preview;
00278        UnityPreviewAction* _tmp2_;
00279        UnityPreviewAction* _tmp3_;
00280        UnityInfoHint* _tmp4_;
00281        UnityInfoHint* _tmp5_;
00282        GVariant* _tmp6_ = NULL;
00283        GVariant* data;
00284        UnityProtocolPreview* _tmp7_ = NULL;
00285        UnityProtocolGenericPreview* reconstructed;
00286        const gchar* _tmp8_;
00287        const gchar* _tmp9_;
00288        const gchar* _tmp10_;
00289        const gchar* _tmp11_;
00290        const gchar* _tmp12_;
00291        const gchar* _tmp13_;
00292        const gchar* _tmp14_;
00293        const gchar* _tmp15_;
00294        const gchar* _tmp16_;
00295        const gchar* _tmp17_;
00296        const gchar* _tmp18_;
00297        const gchar* _tmp19_;
00298        GIcon* _tmp20_;
00299        GIcon* _tmp21_;
00300        GIcon* _tmp22_;
00301        GIcon* _tmp23_;
00302        gboolean _tmp24_ = FALSE;
00303        gint _tmp25_ = 0;
00304        UnityProtocolPreviewActionRaw* _tmp26_ = NULL;
00305        gint _tmp27_ = 0;
00306        UnityProtocolPreviewActionRaw* _tmp28_ = NULL;
00307        UnityProtocolPreviewActionRaw _tmp29_;
00308        UnityProtocolPreviewActionRaw _tmp30_ = {0};
00309        UnityProtocolPreviewActionRaw action;
00310        UnityProtocolPreviewActionRaw _tmp31_;
00311        const gchar* _tmp32_;
00312        gint _tmp33_ = 0;
00313        UnityProtocolInfoHintRaw* _tmp34_ = NULL;
00314        gint _tmp35_ = 0;
00315        UnityProtocolInfoHintRaw* _tmp36_ = NULL;
00316        UnityProtocolInfoHintRaw _tmp37_;
00317        UnityProtocolInfoHintRaw _tmp38_ = {0};
00318        UnityProtocolInfoHintRaw hint;
00319        UnityProtocolInfoHintRaw _tmp39_;
00320        const gchar* _tmp40_;
00321        GVariant* _tmp41_ = NULL;
00322        GVariant* _tmp42_;
00323        gboolean _tmp43_ = FALSE;
00324        _tmp0_ = (GThemedIcon*) g_themed_icon_new ("internet");
00325        thumbnail = _tmp0_;
00326        _tmp1_ = unity_generic_preview_new ("A title", "Description", (GIcon*) thumbnail);
00327        preview = _tmp1_;
00328        unity_preview_set_subtitle ((UnityPreview*) preview, "subtitle");
00329        _tmp2_ = unity_preview_action_new ("action1", "Do stuff!", NULL);
00330        _tmp3_ = _tmp2_;
00331        unity_preview_add_action ((UnityPreview*) preview, _tmp3_);
00332        _g_object_unref0 (_tmp3_);
00333        _tmp4_ = unity_info_hint_new ("hint1", "Hint", NULL, "Hint value");
00334        g_object_ref_sink (_tmp4_);
00335        _tmp5_ = _tmp4_;
00336        unity_preview_add_info ((UnityPreview*) preview, _tmp5_);
00337        _g_object_unref0 (_tmp5_);
00338        _tmp6_ = dee_serializable_serialize ((DeeSerializable*) preview);
00339        data = _tmp6_;
00340        _tmp7_ = unity_protocol_preview_parse (data);
00341        reconstructed = G_TYPE_CHECK_INSTANCE_TYPE (_tmp7_, UNITY_PROTOCOL_TYPE_GENERIC_PREVIEW) ? ((UnityProtocolGenericPreview*) _tmp7_) : NULL;
00342        _tmp8_ = unity_preview_get_title ((UnityPreview*) preview);
00343        _tmp9_ = _tmp8_;
00344        _tmp10_ = unity_protocol_preview_get_title ((UnityProtocolPreview*) reconstructed);
00345        _tmp11_ = _tmp10_;
00346        _vala_assert (g_strcmp0 (_tmp9_, _tmp11_) == 0, "preview.title == reconstructed.title");
00347        _tmp12_ = unity_preview_get_subtitle ((UnityPreview*) preview);
00348        _tmp13_ = _tmp12_;
00349        _tmp14_ = unity_protocol_preview_get_subtitle ((UnityProtocolPreview*) reconstructed);
00350        _tmp15_ = _tmp14_;
00351        _vala_assert (g_strcmp0 (_tmp13_, _tmp15_) == 0, "preview.subtitle == reconstructed.subtitle");
00352        _tmp16_ = unity_preview_get_description_markup ((UnityPreview*) preview);
00353        _tmp17_ = _tmp16_;
00354        _tmp18_ = unity_protocol_preview_get_description ((UnityProtocolPreview*) reconstructed);
00355        _tmp19_ = _tmp18_;
00356        _vala_assert (g_strcmp0 (_tmp17_, _tmp19_) == 0, "preview.description_markup == reconstructed.description");
00357        _tmp20_ = unity_preview_get_thumbnail ((UnityPreview*) preview);
00358        _tmp21_ = _tmp20_;
00359        _tmp22_ = unity_protocol_preview_get_thumbnail ((UnityProtocolPreview*) reconstructed);
00360        _tmp23_ = _tmp22_;
00361        _tmp24_ = g_icon_equal (_tmp21_, _tmp23_);
00362        _vala_assert (_tmp24_, "preview.thumbnail.equal (reconstructed.thumbnail)");
00363        _tmp26_ = unity_protocol_preview_get_actions ((UnityProtocolPreview*) reconstructed, &_tmp25_);
00364        _vala_assert (_tmp25_ == 1, "reconstructed.get_actions().length == 1");
00365        _tmp28_ = unity_protocol_preview_get_actions ((UnityProtocolPreview*) reconstructed, &_tmp27_);
00366        _tmp29_ = _tmp28_[0];
00367        unity_protocol_preview_action_raw_copy (&_tmp29_, &_tmp30_);
00368        action = _tmp30_;
00369        _tmp31_ = action;
00370        _tmp32_ = _tmp31_.id;
00371        _vala_assert (g_strcmp0 (_tmp32_, "action1") == 0, "action.id == \"action1\"");
00372        _tmp34_ = unity_protocol_preview_get_info_hints ((UnityProtocolPreview*) reconstructed, &_tmp33_);
00373        _vala_assert (_tmp33_ == 1, "reconstructed.get_info_hints().length == 1");
00374        _tmp36_ = unity_protocol_preview_get_info_hints ((UnityProtocolPreview*) reconstructed, &_tmp35_);
00375        _tmp37_ = _tmp36_[0];
00376        unity_protocol_info_hint_raw_copy (&_tmp37_, &_tmp38_);
00377        hint = _tmp38_;
00378        _tmp39_ = hint;
00379        _tmp40_ = _tmp39_.id;
00380        _vala_assert (g_strcmp0 (_tmp40_, "hint1") == 0, "hint.id == \"hint1\"");
00381        _tmp41_ = dee_serializable_serialize ((DeeSerializable*) reconstructed);
00382        _tmp42_ = _tmp41_;
00383        _tmp43_ = unity_test_preview_suite_previews_equal (data, _tmp42_);
00384        _vala_assert (_tmp43_, "previews_equal (data, reconstructed.serialize ())");
00385        _g_variant_unref0 (_tmp42_);
00386        unity_protocol_info_hint_raw_destroy (&hint);
00387        unity_protocol_preview_action_raw_destroy (&action);
00388        _g_object_unref0 (reconstructed);
00389        _g_variant_unref0 (data);
00390        _g_object_unref0 (preview);
00391        _g_object_unref0 (thumbnail);
00392 }
00393 
00394 
00395 static void unity_test_preview_suite_test_preview_application (void) {
00396        GThemedIcon* _tmp0_;
00397        GThemedIcon* app_icon;
00398        UnityApplicationPreview* _tmp1_;
00399        UnityApplicationPreview* preview;
00400        GVariant* _tmp2_ = NULL;
00401        GVariant* data;
00402        UnityProtocolPreview* _tmp3_ = NULL;
00403        UnityProtocolApplicationPreview* reconstructed;
00404        const gchar* _tmp4_;
00405        const gchar* _tmp5_;
00406        const gchar* _tmp6_;
00407        const gchar* _tmp7_;
00408        const gchar* _tmp8_;
00409        const gchar* _tmp9_;
00410        const gchar* _tmp10_;
00411        const gchar* _tmp11_;
00412        GIcon* _tmp12_;
00413        GIcon* _tmp13_;
00414        GIcon* _tmp14_;
00415        GIcon* _tmp15_;
00416        gboolean _tmp16_ = FALSE;
00417        GIcon* _tmp17_;
00418        GIcon* _tmp18_;
00419        gboolean _tmp19_ = FALSE;
00420        const gchar* _tmp20_;
00421        const gchar* _tmp21_;
00422        const gchar* _tmp22_;
00423        const gchar* _tmp23_;
00424        const gchar* _tmp24_;
00425        const gchar* _tmp25_;
00426        const gchar* _tmp26_;
00427        const gchar* _tmp27_;
00428        const gchar* _tmp28_;
00429        const gchar* _tmp29_;
00430        const gchar* _tmp30_;
00431        const gchar* _tmp31_;
00432        GVariant* _tmp32_ = NULL;
00433        GVariant* _tmp33_;
00434        gboolean _tmp34_ = FALSE;
00435        _tmp0_ = (GThemedIcon*) g_themed_icon_new ("gedit");
00436        app_icon = _tmp0_;
00437        _tmp1_ = unity_application_preview_new ("A title", "subtitle", "Description", (GIcon*) app_icon, NULL);
00438        preview = _tmp1_;
00439        _tmp2_ = dee_serializable_serialize ((DeeSerializable*) preview);
00440        data = _tmp2_;
00441        _tmp3_ = unity_protocol_preview_parse (data);
00442        reconstructed = G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, UNITY_PROTOCOL_TYPE_APPLICATION_PREVIEW) ? ((UnityProtocolApplicationPreview*) _tmp3_) : NULL;
00443        _tmp4_ = unity_preview_get_title ((UnityPreview*) preview);
00444        _tmp5_ = _tmp4_;
00445        _tmp6_ = unity_protocol_preview_get_title ((UnityProtocolPreview*) reconstructed);
00446        _tmp7_ = _tmp6_;
00447        _vala_assert (g_strcmp0 (_tmp5_, _tmp7_) == 0, "preview.title == reconstructed.title");
00448        _tmp8_ = unity_preview_get_description_markup ((UnityPreview*) preview);
00449        _tmp9_ = _tmp8_;
00450        _tmp10_ = unity_protocol_preview_get_description ((UnityProtocolPreview*) reconstructed);
00451        _tmp11_ = _tmp10_;
00452        _vala_assert (g_strcmp0 (_tmp9_, _tmp11_) == 0, "preview.description_markup == reconstructed.description");
00453        _tmp12_ = unity_preview_get_thumbnail ((UnityPreview*) preview);
00454        _tmp13_ = _tmp12_;
00455        _tmp14_ = unity_protocol_preview_get_thumbnail ((UnityProtocolPreview*) reconstructed);
00456        _tmp15_ = _tmp14_;
00457        _tmp16_ = g_icon_equal (_tmp13_, _tmp15_);
00458        _vala_assert (_tmp16_, "preview.thumbnail.equal (reconstructed.thumbnail)");
00459        _tmp17_ = unity_protocol_application_preview_get_app_icon (reconstructed);
00460        _tmp18_ = _tmp17_;
00461        _tmp19_ = g_icon_equal ((GIcon*) app_icon, _tmp18_);
00462        _vala_assert (_tmp19_, "app_icon.equal (reconstructed.app_icon)");
00463        _tmp20_ = unity_application_preview_get_last_update (preview);
00464        _tmp21_ = _tmp20_;
00465        _tmp22_ = unity_protocol_application_preview_get_last_update (reconstructed);
00466        _tmp23_ = _tmp22_;
00467        _vala_assert (g_strcmp0 (_tmp21_, _tmp23_) == 0, "preview.last_update == reconstructed.last_update");
00468        _tmp24_ = unity_application_preview_get_copyright (preview);
00469        _tmp25_ = _tmp24_;
00470        _tmp26_ = unity_protocol_application_preview_get_copyright (reconstructed);
00471        _tmp27_ = _tmp26_;
00472        _vala_assert (g_strcmp0 (_tmp25_, _tmp27_) == 0, "preview.copyright == reconstructed.copyright");
00473        _tmp28_ = unity_application_preview_get_license (preview);
00474        _tmp29_ = _tmp28_;
00475        _tmp30_ = unity_protocol_application_preview_get_license (reconstructed);
00476        _tmp31_ = _tmp30_;
00477        _vala_assert (g_strcmp0 (_tmp29_, _tmp31_) == 0, "preview.license == reconstructed.license");
00478        _tmp32_ = dee_serializable_serialize ((DeeSerializable*) reconstructed);
00479        _tmp33_ = _tmp32_;
00480        _tmp34_ = unity_test_preview_suite_previews_equal (data, _tmp33_);
00481        _vala_assert (_tmp34_, "previews_equal (data, reconstructed.serialize ())");
00482        _g_variant_unref0 (_tmp33_);
00483        _g_object_unref0 (reconstructed);
00484        _g_variant_unref0 (data);
00485        _g_object_unref0 (preview);
00486        _g_object_unref0 (app_icon);
00487 }
00488 
00489 
00490 static void unity_test_preview_suite_test_preview_music (void) {
00491        GFile* _tmp0_ = NULL;
00492        GFile* _tmp1_;
00493        GFileIcon* _tmp2_;
00494        GFileIcon* _tmp3_;
00495        GFileIcon* artwork;
00496        UnityMusicPreview* _tmp4_;
00497        UnityMusicPreview* preview;
00498        GVariant* _tmp5_ = NULL;
00499        GVariant* data;
00500        UnityProtocolPreview* _tmp6_ = NULL;
00501        UnityProtocolMusicPreview* reconstructed;
00502        const gchar* _tmp7_;
00503        const gchar* _tmp8_;
00504        const gchar* _tmp9_;
00505        const gchar* _tmp10_;
00506        const gchar* _tmp11_;
00507        const gchar* _tmp12_;
00508        const gchar* _tmp13_;
00509        const gchar* _tmp14_;
00510        GIcon* _tmp15_;
00511        GIcon* _tmp16_;
00512        GIcon* _tmp17_;
00513        GIcon* _tmp18_;
00514        gboolean _tmp19_ = FALSE;
00515        GIcon* _tmp20_;
00516        GIcon* _tmp21_;
00517        gboolean _tmp22_ = FALSE;
00518        GVariant* _tmp23_ = NULL;
00519        GVariant* _tmp24_;
00520        gboolean _tmp25_ = FALSE;
00521        _tmp0_ = g_file_new_for_path ("/usr/share/icons/beatles.jpg");
00522        _tmp1_ = _tmp0_;
00523        _tmp2_ = (GFileIcon*) g_file_icon_new (_tmp1_);
00524        _tmp3_ = _tmp2_;
00525        _g_object_unref0 (_tmp1_);
00526        artwork = _tmp3_;
00527        _tmp4_ = unity_music_preview_new ("Beatles", "Help", (GIcon*) artwork);
00528        preview = _tmp4_;
00529        _tmp5_ = dee_serializable_serialize ((DeeSerializable*) preview);
00530        data = _tmp5_;
00531        _tmp6_ = unity_protocol_preview_parse (data);
00532        reconstructed = G_TYPE_CHECK_INSTANCE_TYPE (_tmp6_, UNITY_PROTOCOL_TYPE_MUSIC_PREVIEW) ? ((UnityProtocolMusicPreview*) _tmp6_) : NULL;
00533        _tmp7_ = unity_preview_get_title ((UnityPreview*) preview);
00534        _tmp8_ = _tmp7_;
00535        _tmp9_ = unity_protocol_preview_get_title ((UnityProtocolPreview*) reconstructed);
00536        _tmp10_ = _tmp9_;
00537        _vala_assert (g_strcmp0 (_tmp8_, _tmp10_) == 0, "preview.title == reconstructed.title");
00538        _tmp11_ = unity_preview_get_subtitle ((UnityPreview*) preview);
00539        _tmp12_ = _tmp11_;
00540        _tmp13_ = unity_protocol_preview_get_subtitle ((UnityProtocolPreview*) reconstructed);
00541        _tmp14_ = _tmp13_;
00542        _vala_assert (g_strcmp0 (_tmp12_, _tmp14_) == 0, "preview.subtitle == reconstructed.subtitle");
00543        _tmp15_ = unity_preview_get_thumbnail ((UnityPreview*) preview);
00544        _tmp16_ = _tmp15_;
00545        _tmp17_ = unity_protocol_preview_get_thumbnail ((UnityProtocolPreview*) reconstructed);
00546        _tmp18_ = _tmp17_;
00547        _tmp19_ = g_icon_equal (_tmp16_, _tmp18_);
00548        _vala_assert (_tmp19_, "preview.thumbnail.equal (reconstructed.thumbnail)");
00549        _tmp20_ = unity_protocol_preview_get_thumbnail ((UnityProtocolPreview*) reconstructed);
00550        _tmp21_ = _tmp20_;
00551        _tmp22_ = g_icon_equal ((GIcon*) artwork, _tmp21_);
00552        _vala_assert (_tmp22_, "artwork.equal (reconstructed.thumbnail)");
00553        _tmp23_ = dee_serializable_serialize ((DeeSerializable*) reconstructed);
00554        _tmp24_ = _tmp23_;
00555        _tmp25_ = unity_test_preview_suite_previews_equal (data, _tmp24_);
00556        _vala_assert (_tmp25_, "previews_equal (data, reconstructed.serialize ())");
00557        _g_variant_unref0 (_tmp24_);
00558        _g_object_unref0 (reconstructed);
00559        _g_variant_unref0 (data);
00560        _g_object_unref0 (preview);
00561        _g_object_unref0 (artwork);
00562 }
00563 
00564 
00565 static void unity_test_preview_suite_test_preview_music_with_tracks (void) {
00566        GFile* _tmp0_ = NULL;
00567        GFile* _tmp1_;
00568        GFileIcon* _tmp2_;
00569        GFileIcon* _tmp3_;
00570        GFileIcon* artwork;
00571        UnityMusicPreview* _tmp4_;
00572        UnityMusicPreview* preview;
00573        gchar* _tmp5_;
00574        gchar* track_uri;
00575        UnityTrackMetadata* _tmp6_;
00576        UnityTrackMetadata* track;
00577        GVariant* _tmp7_ = NULL;
00578        GVariant* data;
00579        UnityProtocolPreview* _tmp8_ = NULL;
00580        UnityProtocolMusicPreview* reconstructed;
00581        const gchar* _tmp9_;
00582        const gchar* _tmp10_;
00583        const gchar* _tmp11_;
00584        const gchar* _tmp12_;
00585        const gchar* _tmp13_;
00586        const gchar* _tmp14_;
00587        const gchar* _tmp15_;
00588        const gchar* _tmp16_;
00589        GIcon* _tmp17_;
00590        GIcon* _tmp18_;
00591        GIcon* _tmp19_;
00592        GIcon* _tmp20_;
00593        gboolean _tmp21_ = FALSE;
00594        GIcon* _tmp22_;
00595        GIcon* _tmp23_;
00596        gboolean _tmp24_ = FALSE;
00597        GVariant* _tmp25_ = NULL;
00598        GVariant* _tmp26_;
00599        gboolean _tmp27_ = FALSE;
00600        _tmp0_ = g_file_new_for_path ("/usr/share/icons/beatles.jpg");
00601        _tmp1_ = _tmp0_;
00602        _tmp2_ = (GFileIcon*) g_file_icon_new (_tmp1_);
00603        _tmp3_ = _tmp2_;
00604        _g_object_unref0 (_tmp1_);
00605        artwork = _tmp3_;
00606        _tmp4_ = unity_music_preview_new ("Beatles", "Help", (GIcon*) artwork);
00607        preview = _tmp4_;
00608        _tmp5_ = g_strdup ("file:///media/music/beatles/help/1.mp3");
00609        track_uri = _tmp5_;
00610        _tmp6_ = unity_track_metadata_new_full (track_uri, 1, "Help", "Beatles", "Help!", (guint) 123);
00611        track = _tmp6_;
00612        unity_music_preview_add_track (preview, track);
00613        unity_music_preview_set_current_track_uri (preview, track_uri);
00614        unity_music_preview_set_current_progress (preview, 0.3f);
00615        _tmp7_ = dee_serializable_serialize ((DeeSerializable*) preview);
00616        data = _tmp7_;
00617        _tmp8_ = unity_protocol_preview_parse (data);
00618        reconstructed = G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, UNITY_PROTOCOL_TYPE_MUSIC_PREVIEW) ? ((UnityProtocolMusicPreview*) _tmp8_) : NULL;
00619        _tmp9_ = unity_preview_get_title ((UnityPreview*) preview);
00620        _tmp10_ = _tmp9_;
00621        _tmp11_ = unity_protocol_preview_get_title ((UnityProtocolPreview*) reconstructed);
00622        _tmp12_ = _tmp11_;
00623        _vala_assert (g_strcmp0 (_tmp10_, _tmp12_) == 0, "preview.title == reconstructed.title");
00624        _tmp13_ = unity_preview_get_subtitle ((UnityPreview*) preview);
00625        _tmp14_ = _tmp13_;
00626        _tmp15_ = unity_protocol_preview_get_subtitle ((UnityProtocolPreview*) reconstructed);
00627        _tmp16_ = _tmp15_;
00628        _vala_assert (g_strcmp0 (_tmp14_, _tmp16_) == 0, "preview.subtitle == reconstructed.subtitle");
00629        _tmp17_ = unity_preview_get_thumbnail ((UnityPreview*) preview);
00630        _tmp18_ = _tmp17_;
00631        _tmp19_ = unity_protocol_preview_get_thumbnail ((UnityProtocolPreview*) reconstructed);
00632        _tmp20_ = _tmp19_;
00633        _tmp21_ = g_icon_equal (_tmp18_, _tmp20_);
00634        _vala_assert (_tmp21_, "preview.thumbnail.equal (reconstructed.thumbnail)");
00635        _tmp22_ = unity_protocol_preview_get_thumbnail ((UnityProtocolPreview*) reconstructed);
00636        _tmp23_ = _tmp22_;
00637        _tmp24_ = g_icon_equal ((GIcon*) artwork, _tmp23_);
00638        _vala_assert (_tmp24_, "artwork.equal (reconstructed.thumbnail)");
00639        _tmp25_ = dee_serializable_serialize ((DeeSerializable*) reconstructed);
00640        _tmp26_ = _tmp25_;
00641        _tmp27_ = unity_test_preview_suite_previews_equal (data, _tmp26_);
00642        _vala_assert (_tmp27_, "previews_equal (data, reconstructed.serialize ())");
00643        _g_variant_unref0 (_tmp26_);
00644        _g_object_unref0 (reconstructed);
00645        _g_variant_unref0 (data);
00646        _g_object_unref0 (track);
00647        _g_free0 (track_uri);
00648        _g_object_unref0 (preview);
00649        _g_object_unref0 (artwork);
00650 }
00651 
00652 
00653 static void unity_test_preview_suite_test_preview_movie (void) {
00654        GFile* _tmp0_ = NULL;
00655        GFile* _tmp1_;
00656        GFileIcon* _tmp2_;
00657        GFileIcon* _tmp3_;
00658        GFileIcon* artwork;
00659        UnityMoviePreview* _tmp4_;
00660        UnityMoviePreview* preview;
00661        GVariant* _tmp5_ = NULL;
00662        GVariant* data;
00663        UnityProtocolPreview* _tmp6_ = NULL;
00664        UnityProtocolMoviePreview* reconstructed;
00665        const gchar* _tmp7_;
00666        const gchar* _tmp8_;
00667        const gchar* _tmp9_;
00668        const gchar* _tmp10_;
00669        const gchar* _tmp11_;
00670        const gchar* _tmp12_;
00671        const gchar* _tmp13_;
00672        const gchar* _tmp14_;
00673        const gchar* _tmp15_;
00674        const gchar* _tmp16_;
00675        const gchar* _tmp17_;
00676        const gchar* _tmp18_;
00677        GIcon* _tmp19_;
00678        GIcon* _tmp20_;
00679        GIcon* _tmp21_;
00680        GIcon* _tmp22_;
00681        gboolean _tmp23_ = FALSE;
00682        GIcon* _tmp24_;
00683        GIcon* _tmp25_;
00684        gboolean _tmp26_ = FALSE;
00685        guint _tmp27_;
00686        guint _tmp28_;
00687        const gchar* _tmp29_;
00688        const gchar* _tmp30_;
00689        GVariant* _tmp31_ = NULL;
00690        GVariant* _tmp32_;
00691        gboolean _tmp33_ = FALSE;
00692        _tmp0_ = g_file_new_for_path ("/usr/share/icons/my_favourite_movie.png");
00693        _tmp1_ = _tmp0_;
00694        _tmp2_ = (GFileIcon*) g_file_icon_new (_tmp1_);
00695        _tmp3_ = _tmp2_;
00696        _g_object_unref0 (_tmp1_);
00697        artwork = _tmp3_;
00698        _tmp4_ = unity_movie_preview_new ("Movie!", "The favourite", "It really is", (GIcon*) artwork);
00699        preview = _tmp4_;
00700        unity_movie_preview_set_year (preview, "2012");
00701        unity_movie_preview_set_rating (preview, 4.3f, (guint) 12);
00702        _tmp5_ = dee_serializable_serialize ((DeeSerializable*) preview);
00703        data = _tmp5_;
00704        _tmp6_ = unity_protocol_preview_parse (data);
00705        reconstructed = G_TYPE_CHECK_INSTANCE_TYPE (_tmp6_, UNITY_PROTOCOL_TYPE_MOVIE_PREVIEW) ? ((UnityProtocolMoviePreview*) _tmp6_) : NULL;
00706        _tmp7_ = unity_preview_get_title ((UnityPreview*) preview);
00707        _tmp8_ = _tmp7_;
00708        _tmp9_ = unity_protocol_preview_get_title ((UnityProtocolPreview*) reconstructed);
00709        _tmp10_ = _tmp9_;
00710        _vala_assert (g_strcmp0 (_tmp8_, _tmp10_) == 0, "preview.title == reconstructed.title");
00711        _tmp11_ = unity_preview_get_subtitle ((UnityPreview*) preview);
00712        _tmp12_ = _tmp11_;
00713        _tmp13_ = unity_protocol_preview_get_subtitle ((UnityProtocolPreview*) reconstructed);
00714        _tmp14_ = _tmp13_;
00715        _vala_assert (g_strcmp0 (_tmp12_, _tmp14_) == 0, "preview.subtitle == reconstructed.subtitle");
00716        _tmp15_ = unity_preview_get_description_markup ((UnityPreview*) preview);
00717        _tmp16_ = _tmp15_;
00718        _tmp17_ = unity_protocol_preview_get_description ((UnityProtocolPreview*) reconstructed);
00719        _tmp18_ = _tmp17_;
00720        _vala_assert (g_strcmp0 (_tmp16_, _tmp18_) == 0, "preview.description_markup == reconstructed.description");
00721        _tmp19_ = unity_preview_get_thumbnail ((UnityPreview*) preview);
00722        _tmp20_ = _tmp19_;
00723        _tmp21_ = unity_protocol_preview_get_thumbnail ((UnityProtocolPreview*) reconstructed);
00724        _tmp22_ = _tmp21_;
00725        _tmp23_ = g_icon_equal (_tmp20_, _tmp22_);
00726        _vala_assert (_tmp23_, "preview.thumbnail.equal (reconstructed.thumbnail)");
00727        _tmp24_ = unity_protocol_preview_get_thumbnail ((UnityProtocolPreview*) reconstructed);
00728        _tmp25_ = _tmp24_;
00729        _tmp26_ = g_icon_equal ((GIcon*) artwork, _tmp25_);
00730        _vala_assert (_tmp26_, "artwork.equal (reconstructed.thumbnail)");
00731        _tmp27_ = unity_protocol_movie_preview_get_num_ratings (reconstructed);
00732        _tmp28_ = _tmp27_;
00733        _vala_assert (_tmp28_ == ((guint) 12), "reconstructed.num_ratings == 12");
00734        _tmp29_ = unity_protocol_movie_preview_get_year (reconstructed);
00735        _tmp30_ = _tmp29_;
00736        _vala_assert (g_strcmp0 (_tmp30_, "2012") == 0, "reconstructed.year == \"2012\"");
00737        _tmp31_ = dee_serializable_serialize ((DeeSerializable*) reconstructed);
00738        _tmp32_ = _tmp31_;
00739        _tmp33_ = unity_test_preview_suite_previews_equal (data, _tmp32_);
00740        _vala_assert (_tmp33_, "previews_equal (data, reconstructed.serialize ())");
00741        _g_variant_unref0 (_tmp32_);
00742        _g_object_unref0 (reconstructed);
00743        _g_variant_unref0 (data);
00744        _g_object_unref0 (preview);
00745        _g_object_unref0 (artwork);
00746 }
00747 
00748 
00749 static void unity_test_preview_suite_test_preview_series (void) {
00750        UnitySeriesItem** _tmp0_ = NULL;
00751        UnitySeriesItem** _tmp1_;
00752        gint _tmp1__length1;
00753        UnitySeriesPreview* _tmp2_;
00754        UnitySeriesPreview* _tmp3_;
00755        UnitySeriesPreview* preview;
00756        GVariant* _tmp4_ = NULL;
00757        GVariant* data;
00758        UnityProtocolPreview* _tmp5_ = NULL;
00759        UnityProtocolSeriesPreview* reconstructed;
00760        GIcon* _tmp6_;
00761        GIcon* _tmp7_;
00762        GIcon* _tmp8_;
00763        GIcon* _tmp9_;
00764        gboolean _tmp10_ = FALSE;
00765        GVariant* _tmp11_ = NULL;
00766        GVariant* _tmp12_;
00767        gboolean _tmp13_ = FALSE;
00768        _tmp0_ = g_new0 (UnitySeriesItem*, 0 + 1);
00769        _tmp1_ = _tmp0_;
00770        _tmp1__length1 = 0;
00771        _tmp2_ = unity_series_preview_new (_tmp1_, 0, "");
00772        _tmp3_ = _tmp2_;
00773        _tmp1_ = (_vala_array_free (_tmp1_, _tmp1__length1, (GDestroyNotify) g_object_unref), NULL);
00774        preview = _tmp3_;
00775        _tmp4_ = dee_serializable_serialize ((DeeSerializable*) preview);
00776        data = _tmp4_;
00777        _tmp5_ = unity_protocol_preview_parse (data);
00778        reconstructed = G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, UNITY_PROTOCOL_TYPE_SERIES_PREVIEW) ? ((UnityProtocolSeriesPreview*) _tmp5_) : NULL;
00779        _tmp6_ = unity_preview_get_thumbnail ((UnityPreview*) preview);
00780        _tmp7_ = _tmp6_;
00781        _tmp8_ = unity_protocol_preview_get_thumbnail ((UnityProtocolPreview*) reconstructed);
00782        _tmp9_ = _tmp8_;
00783        _tmp10_ = g_icon_equal (_tmp7_, _tmp9_);
00784        _vala_assert (_tmp10_, "preview.thumbnail.equal (reconstructed.thumbnail)");
00785        _tmp11_ = dee_serializable_serialize ((DeeSerializable*) reconstructed);
00786        _tmp12_ = _tmp11_;
00787        _tmp13_ = unity_test_preview_suite_previews_equal (data, _tmp12_);
00788        _vala_assert (_tmp13_, "previews_equal (data, reconstructed.serialize ())");
00789        _g_variant_unref0 (_tmp12_);
00790        _g_object_unref0 (reconstructed);
00791        _g_variant_unref0 (data);
00792        _g_object_unref0 (preview);
00793 }
00794 
00795 
00796 static Block1Data* block1_data_ref (Block1Data* _data1_) {
00797        g_atomic_int_inc (&_data1_->_ref_count_);
00798        return _data1_;
00799 }
00800 
00801 
00802 static void block1_data_unref (void * _userdata_) {
00803        Block1Data* _data1_;
00804        _data1_ = (Block1Data*) _userdata_;
00805        if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
00806               _g_free0 (_data1_->desc);
00807               _g_free0 (_data1_->title);
00808               g_slice_free (Block1Data, _data1_);
00809        }
00810 }
00811 
00812 
00813 static gpointer _g_object_ref0 (gpointer self) {
00814        return self ? g_object_ref (self) : NULL;
00815 }
00816 
00817 
00818 static UnityPreview* __lambda2_ (Block1Data* _data1_) {
00819        UnityPreview* result = NULL;
00820        UnityGenericPreview* _tmp0_;
00821        _data1_->got_generate_preview_signal = TRUE;
00822        _tmp0_ = unity_generic_preview_new (_data1_->title, _data1_->desc, NULL);
00823        result = (UnityPreview*) _tmp0_;
00824        return result;
00825 }
00826 
00827 
00828 static UnityPreview* ___lambda2__unity_series_preview_request_item_preview (UnitySeriesPreview* _sender, const gchar* uri, gpointer self) {
00829        UnityPreview* result;
00830        result = __lambda2_ (self);
00831        return result;
00832 }
00833 
00834 
00835 static void unity_test_preview_suite_test_preview_series_with_items (void) {
00836        Block1Data* _data1_;
00837        GFile* _tmp0_ = NULL;
00838        GFile* _tmp1_;
00839        GFileIcon* _tmp2_;
00840        GFileIcon* _tmp3_;
00841        GFileIcon* artwork;
00842        gchar* _tmp4_;
00843        gchar* _tmp5_;
00844        UnitySeriesItem* _tmp6_;
00845        UnitySeriesItem* item1;
00846        UnitySeriesItem* _tmp7_;
00847        UnitySeriesItem* item2;
00848        UnitySeriesItem* _tmp8_;
00849        UnitySeriesItem* _tmp9_;
00850        UnitySeriesItem** _tmp10_ = NULL;
00851        UnitySeriesItem** _tmp11_;
00852        gint _tmp11__length1;
00853        UnitySeriesPreview* _tmp12_;
00854        UnitySeriesPreview* _tmp13_;
00855        UnitySeriesPreview* preview;
00856        GVariant* _tmp14_ = NULL;
00857        GVariant* data;
00858        UnityProtocolPreview* _tmp15_ = NULL;
00859        UnityProtocolSeriesPreview* reconstructed;
00860        GIcon* _tmp16_;
00861        GIcon* _tmp17_;
00862        GIcon* _tmp18_;
00863        GIcon* _tmp19_;
00864        gboolean _tmp20_ = FALSE;
00865        gint _tmp21_ = 0;
00866        UnityProtocolSeriesItemRaw* _tmp22_ = NULL;
00867        UnityProtocolPreview* _tmp23_;
00868        UnityProtocolPreview* _tmp24_;
00869        const gchar* _tmp25_;
00870        const gchar* _tmp26_;
00871        UnityProtocolPreview* _tmp27_;
00872        UnityProtocolPreview* _tmp28_;
00873        const gchar* _tmp29_;
00874        const gchar* _tmp30_;
00875        GVariant* _tmp31_ = NULL;
00876        GVariant* _tmp32_;
00877        gboolean _tmp33_ = FALSE;
00878        _data1_ = g_slice_new0 (Block1Data);
00879        _data1_->_ref_count_ = 1;
00880        _tmp0_ = g_file_new_for_path ("/usr/share/icons/beatles.jpg");
00881        _tmp1_ = _tmp0_;
00882        _tmp2_ = (GFileIcon*) g_file_icon_new (_tmp1_);
00883        _tmp3_ = _tmp2_;
00884        _g_object_unref0 (_tmp1_);
00885        artwork = _tmp3_;
00886        _tmp4_ = g_strdup ("A title");
00887        _data1_->title = _tmp4_;
00888        _tmp5_ = g_strdup ("Description");
00889        _data1_->desc = _tmp5_;
00890        _data1_->got_generate_preview_signal = FALSE;
00891        _tmp6_ = unity_series_item_new ("file:///media/series_item_1.jpg", "Item #1", (GIcon*) artwork);
00892        item1 = _tmp6_;
00893        _tmp7_ = unity_series_item_new ("file:///media/series_item_2.jpg", "Item #2", NULL);
00894        item2 = _tmp7_;
00895        _tmp8_ = _g_object_ref0 (item1);
00896        _tmp9_ = _g_object_ref0 (item2);
00897        _tmp10_ = g_new0 (UnitySeriesItem*, 2 + 1);
00898        _tmp10_[0] = _tmp8_;
00899        _tmp10_[1] = _tmp9_;
00900        _tmp11_ = _tmp10_;
00901        _tmp11__length1 = 2;
00902        _tmp12_ = unity_series_preview_new (_tmp11_, 2, "file:///media/series_item_2.jpg");
00903        _tmp13_ = _tmp12_;
00904        _tmp11_ = (_vala_array_free (_tmp11_, _tmp11__length1, (GDestroyNotify) g_object_unref), NULL);
00905        preview = _tmp13_;
00906        g_signal_connect_data (preview, "request-item-preview", (GCallback) ___lambda2__unity_series_preview_request_item_preview, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
00907        _tmp14_ = dee_serializable_serialize ((DeeSerializable*) preview);
00908        data = _tmp14_;
00909        _tmp15_ = unity_protocol_preview_parse (data);
00910        reconstructed = G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, UNITY_PROTOCOL_TYPE_SERIES_PREVIEW) ? ((UnityProtocolSeriesPreview*) _tmp15_) : NULL;
00911        _vala_assert (_data1_->got_generate_preview_signal, "got_generate_preview_signal");
00912        _tmp16_ = unity_preview_get_thumbnail ((UnityPreview*) preview);
00913        _tmp17_ = _tmp16_;
00914        _tmp18_ = unity_protocol_preview_get_thumbnail ((UnityProtocolPreview*) reconstructed);
00915        _tmp19_ = _tmp18_;
00916        _tmp20_ = g_icon_equal (_tmp17_, _tmp19_);
00917        _vala_assert (_tmp20_, "preview.thumbnail.equal (reconstructed.thumbnail)");
00918        _tmp22_ = unity_protocol_series_preview_get_items (reconstructed, &_tmp21_);
00919        _vala_assert (_tmp21_ == 2, "reconstructed.get_items().length == 2");
00920        _tmp23_ = unity_protocol_series_preview_get_child_preview (reconstructed);
00921        _tmp24_ = _tmp23_;
00922        _tmp25_ = unity_protocol_preview_get_title (_tmp24_);
00923        _tmp26_ = _tmp25_;
00924        _vala_assert (g_strcmp0 (_tmp26_, _data1_->title) == 0, "reconstructed.child_preview.title == title");
00925        _tmp27_ = unity_protocol_series_preview_get_child_preview (reconstructed);
00926        _tmp28_ = _tmp27_;
00927        _tmp29_ = unity_protocol_preview_get_description (_tmp28_);
00928        _tmp30_ = _tmp29_;
00929        _vala_assert (g_strcmp0 (_tmp30_, _data1_->desc) == 0, "reconstructed.child_preview.description == desc");
00930        _tmp31_ = dee_serializable_serialize ((DeeSerializable*) reconstructed);
00931        _tmp32_ = _tmp31_;
00932        _tmp33_ = unity_test_preview_suite_previews_equal (data, _tmp32_);
00933        _vala_assert (_tmp33_, "previews_equal (data, reconstructed.serialize ())");
00934        _g_variant_unref0 (_tmp32_);
00935        _g_object_unref0 (reconstructed);
00936        _g_variant_unref0 (data);
00937        _g_object_unref0 (preview);
00938        _g_object_unref0 (item2);
00939        _g_object_unref0 (item1);
00940        _g_object_unref0 (artwork);
00941        block1_data_unref (_data1_);
00942        _data1_ = NULL;
00943 }
00944 
00945 
00946 static void unity_test_value_preview_suite_init (GValue* value) {
00947        value->data[0].v_pointer = NULL;
00948 }
00949 
00950 
00951 static void unity_test_value_preview_suite_free_value (GValue* value) {
00952        if (value->data[0].v_pointer) {
00953               unity_test_preview_suite_unref (value->data[0].v_pointer);
00954        }
00955 }
00956 
00957 
00958 static void unity_test_value_preview_suite_copy_value (const GValue* src_value, GValue* dest_value) {
00959        if (src_value->data[0].v_pointer) {
00960               dest_value->data[0].v_pointer = unity_test_preview_suite_ref (src_value->data[0].v_pointer);
00961        } else {
00962               dest_value->data[0].v_pointer = NULL;
00963        }
00964 }
00965 
00966 
00967 static gpointer unity_test_value_preview_suite_peek_pointer (const GValue* value) {
00968        return value->data[0].v_pointer;
00969 }
00970 
00971 
00972 static gchar* unity_test_value_preview_suite_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
00973        if (collect_values[0].v_pointer) {
00974               UnityTestPreviewSuite* object;
00975               object = collect_values[0].v_pointer;
00976               if (object->parent_instance.g_class == NULL) {
00977                      return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
00978               } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
00979                      return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
00980               }
00981               value->data[0].v_pointer = unity_test_preview_suite_ref (object);
00982        } else {
00983               value->data[0].v_pointer = NULL;
00984        }
00985        return NULL;
00986 }
00987 
00988 
00989 static gchar* unity_test_value_preview_suite_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
00990        UnityTestPreviewSuite** object_p;
00991        object_p = collect_values[0].v_pointer;
00992        if (!object_p) {
00993               return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
00994        }
00995        if (!value->data[0].v_pointer) {
00996               *object_p = NULL;
00997        } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
00998               *object_p = value->data[0].v_pointer;
00999        } else {
01000               *object_p = unity_test_preview_suite_ref (value->data[0].v_pointer);
01001        }
01002        return NULL;
01003 }
01004 
01005 
01006 GParamSpec* unity_test_param_spec_preview_suite (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
01007        UnityTestParamSpecPreviewSuite* spec;
01008        g_return_val_if_fail (g_type_is_a (object_type, UNITY_TEST_TYPE_PREVIEW_SUITE), NULL);
01009        spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
01010        G_PARAM_SPEC (spec)->value_type = object_type;
01011        return G_PARAM_SPEC (spec);
01012 }
01013 
01014 
01015 gpointer unity_test_value_get_preview_suite (const GValue* value) {
01016        g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, UNITY_TEST_TYPE_PREVIEW_SUITE), NULL);
01017        return value->data[0].v_pointer;
01018 }
01019 
01020 
01021 void unity_test_value_set_preview_suite (GValue* value, gpointer v_object) {
01022        UnityTestPreviewSuite* old;
01023        g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, UNITY_TEST_TYPE_PREVIEW_SUITE));
01024        old = value->data[0].v_pointer;
01025        if (v_object) {
01026               g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, UNITY_TEST_TYPE_PREVIEW_SUITE));
01027               g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
01028               value->data[0].v_pointer = v_object;
01029               unity_test_preview_suite_ref (value->data[0].v_pointer);
01030        } else {
01031               value->data[0].v_pointer = NULL;
01032        }
01033        if (old) {
01034               unity_test_preview_suite_unref (old);
01035        }
01036 }
01037 
01038 
01039 void unity_test_value_take_preview_suite (GValue* value, gpointer v_object) {
01040        UnityTestPreviewSuite* old;
01041        g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, UNITY_TEST_TYPE_PREVIEW_SUITE));
01042        old = value->data[0].v_pointer;
01043        if (v_object) {
01044               g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, UNITY_TEST_TYPE_PREVIEW_SUITE));
01045               g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
01046               value->data[0].v_pointer = v_object;
01047        } else {
01048               value->data[0].v_pointer = NULL;
01049        }
01050        if (old) {
01051               unity_test_preview_suite_unref (old);
01052        }
01053 }
01054 
01055 
01056 static void unity_test_preview_suite_class_init (UnityTestPreviewSuiteClass * klass) {
01057        unity_test_preview_suite_parent_class = g_type_class_peek_parent (klass);
01058        UNITY_TEST_PREVIEW_SUITE_CLASS (klass)->finalize = unity_test_preview_suite_finalize;
01059 }
01060 
01061 
01062 static void unity_test_preview_suite_instance_init (UnityTestPreviewSuite * self) {
01063        self->ref_count = 1;
01064 }
01065 
01066 
01067 static void unity_test_preview_suite_finalize (UnityTestPreviewSuite* obj) {
01068        UnityTestPreviewSuite * self;
01069        self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TEST_TYPE_PREVIEW_SUITE, UnityTestPreviewSuite);
01070 }
01071 
01072 
01073 GType unity_test_preview_suite_get_type (void) {
01074        static volatile gsize unity_test_preview_suite_type_id__volatile = 0;
01075        if (g_once_init_enter (&unity_test_preview_suite_type_id__volatile)) {
01076               static const GTypeValueTable g_define_type_value_table = { unity_test_value_preview_suite_init, unity_test_value_preview_suite_free_value, unity_test_value_preview_suite_copy_value, unity_test_value_preview_suite_peek_pointer, "p", unity_test_value_preview_suite_collect_value, "p", unity_test_value_preview_suite_lcopy_value };
01077               static const GTypeInfo g_define_type_info = { sizeof (UnityTestPreviewSuiteClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_test_preview_suite_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityTestPreviewSuite), 0, (GInstanceInitFunc) unity_test_preview_suite_instance_init, &g_define_type_value_table };
01078               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) };
01079               GType unity_test_preview_suite_type_id;
01080               unity_test_preview_suite_type_id = g_type_register_fundamental (g_type_fundamental_next (), "UnityTestPreviewSuite", &g_define_type_info, &g_define_type_fundamental_info, 0);
01081               g_once_init_leave (&unity_test_preview_suite_type_id__volatile, unity_test_preview_suite_type_id);
01082        }
01083        return unity_test_preview_suite_type_id__volatile;
01084 }
01085 
01086 
01087 gpointer unity_test_preview_suite_ref (gpointer instance) {
01088        UnityTestPreviewSuite* self;
01089        self = instance;
01090        g_atomic_int_inc (&self->ref_count);
01091        return instance;
01092 }
01093 
01094 
01095 void unity_test_preview_suite_unref (gpointer instance) {
01096        UnityTestPreviewSuite* self;
01097        self = instance;
01098        if (g_atomic_int_dec_and_test (&self->ref_count)) {
01099               UNITY_TEST_PREVIEW_SUITE_GET_CLASS (self)->finalize (self);
01100               g_type_free_instance ((GTypeInstance *) self);
01101        }
01102 }
01103 
01104 
01105 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
01106        if ((array != NULL) && (destroy_func != NULL)) {
01107               int i;
01108               for (i = 0; i < array_length; i = i + 1) {
01109                      if (((gpointer*) array)[i] != NULL) {
01110                             destroy_func (((gpointer*) array)[i]);
01111                      }
01112               }
01113        }
01114 }
01115 
01116 
01117 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
01118        _vala_array_destroy (array, array_length, destroy_func);
01119        g_free (array);
01120 }
01121 
01122 
01123