Back to index

unity-lens-music  6.0.0
test-rhythmbox-parser.c
Go to the documentation of this file.
00001 /* test-rhythmbox-parser.c generated by valac 0.14.2, the Vala compiler
00002  * generated from test-rhythmbox-parser.vala, do not modify */
00003 
00004 /*
00005  * Copyright (C) 2012 Canonical Ltd
00006  *
00007  * This program is free software: you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License version 3 as
00009  * published by the Free Software Foundation.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00018  *
00019  * Authored by Didier Roche <didrocks@ubuntu.com>
00020  *
00021  */
00022 
00023 #include <glib.h>
00024 #include <glib-object.h>
00025 #include <stdlib.h>
00026 #include <string.h>
00027 #include <gobject/gvaluecollector.h>
00028 
00029 
00030 #define TYPE_MAIN (main_get_type ())
00031 #define MAIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAIN, Main))
00032 #define MAIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAIN, MainClass))
00033 #define IS_MAIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAIN))
00034 #define IS_MAIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAIN))
00035 #define MAIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAIN, MainClass))
00036 
00037 typedef struct _Main Main;
00038 typedef struct _MainClass MainClass;
00039 typedef struct _MainPrivate MainPrivate;
00040 
00041 #define UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_TYPE_XML_PARSER (unity_music_lens_rhythmbox_collection_xml_parser_get_type ())
00042 #define UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_XML_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_TYPE_XML_PARSER, UnityMusicLensRhythmboxCollectionXmlParser))
00043 #define UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_XML_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_TYPE_XML_PARSER, UnityMusicLensRhythmboxCollectionXmlParserClass))
00044 #define UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_IS_XML_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_TYPE_XML_PARSER))
00045 #define UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_IS_XML_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_TYPE_XML_PARSER))
00046 #define UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_XML_PARSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_TYPE_XML_PARSER, UnityMusicLensRhythmboxCollectionXmlParserClass))
00047 
00048 typedef struct _UnityMusicLensRhythmboxCollectionXmlParser UnityMusicLensRhythmboxCollectionXmlParser;
00049 typedef struct _UnityMusicLensRhythmboxCollectionXmlParserClass UnityMusicLensRhythmboxCollectionXmlParserClass;
00050 
00051 #define UNITY_MUSIC_LENS_TYPE_TRACK (unity_music_lens_track_get_type ())
00052 #define UNITY_MUSIC_LENS_TRACK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_TRACK, UnityMusicLensTrack))
00053 #define UNITY_MUSIC_LENS_TRACK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_TRACK, UnityMusicLensTrackClass))
00054 #define UNITY_MUSIC_LENS_IS_TRACK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_TRACK))
00055 #define UNITY_MUSIC_LENS_IS_TRACK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_TRACK))
00056 #define UNITY_MUSIC_LENS_TRACK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_TRACK, UnityMusicLensTrackClass))
00057 
00058 typedef struct _UnityMusicLensTrack UnityMusicLensTrack;
00059 typedef struct _UnityMusicLensTrackClass UnityMusicLensTrackClass;
00060 
00061 #define UNITY_MUSIC_LENS_TYPE_TRACK_TYPE (unity_music_lens_track_type_get_type ())
00062 #define _g_free0(var) (var = (g_free (var), NULL))
00063 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
00064 typedef struct _ParamSpecMain ParamSpecMain;
00065 
00066 struct _Main {
00067        GTypeInstance parent_instance;
00068        volatile int ref_count;
00069        MainPrivate * priv;
00070 };
00071 
00072 struct _MainClass {
00073        GTypeClass parent_class;
00074        void (*finalize) (Main *self);
00075 };
00076 
00077 typedef enum  {
00078        UNITY_MUSIC_LENS_TRACK_TYPE_SONG,
00079        UNITY_MUSIC_LENS_TRACK_TYPE_RADIO
00080 } UnityMusicLensTrackType;
00081 
00082 struct _ParamSpecMain {
00083        GParamSpec parent_instance;
00084 };
00085 
00086 
00087 static gpointer main_parent_class = NULL;
00088 
00089 gpointer main_ref (gpointer instance);
00090 void main_unref (gpointer instance);
00091 GParamSpec* param_spec_main (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
00092 void value_set_main (GValue* value, gpointer v_object);
00093 void value_take_main (GValue* value, gpointer v_object);
00094 gpointer value_get_main (const GValue* value);
00095 GType main_get_type (void) G_GNUC_CONST;
00096 enum  {
00097        MAIN_DUMMY_PROPERTY
00098 };
00099 gint main_main (gchar** args, int args_length1);
00100 static void main_test_radios (void);
00101 static void _main_test_radios_gtest_data_func (gpointer self);
00102 static void main_test_songs (void);
00103 static void _main_test_songs_gtest_data_func (gpointer self);
00104 static void main_test_lazy_load (void);
00105 static void _main_test_lazy_load_gtest_data_func (gpointer self);
00106 static void main_test_invalid_songload (void);
00107 static void _main_test_invalid_songload_gtest_data_func (gpointer self);
00108 UnityMusicLensRhythmboxCollectionXmlParser* unity_music_lens_rhythmbox_collection_xml_parser_new (void);
00109 UnityMusicLensRhythmboxCollectionXmlParser* unity_music_lens_rhythmbox_collection_xml_parser_construct (GType object_type);
00110 GType unity_music_lens_rhythmbox_collection_xml_parser_get_type (void) G_GNUC_CONST;
00111 GType unity_music_lens_track_get_type (void) G_GNUC_CONST;
00112 static void __lambda7_ (UnityMusicLensTrack* track);
00113 const gchar* unity_music_lens_track_get_title (UnityMusicLensTrack* self);
00114 const gchar* unity_music_lens_track_get_genre (UnityMusicLensTrack* self);
00115 const gchar* unity_music_lens_track_get_artist (UnityMusicLensTrack* self);
00116 const gchar* unity_music_lens_track_get_album (UnityMusicLensTrack* self);
00117 const gchar* unity_music_lens_track_get_uri (UnityMusicLensTrack* self);
00118 gint unity_music_lens_track_get_year (UnityMusicLensTrack* self);
00119 GType unity_music_lens_track_type_get_type (void) G_GNUC_CONST;
00120 UnityMusicLensTrackType unity_music_lens_track_get_type_track (UnityMusicLensTrack* self);
00121 static void ___lambda7__unity_music_lens_rhythmbox_collection_xml_parser_track_info_ready (UnityMusicLensRhythmboxCollectionXmlParser* _sender, UnityMusicLensTrack* track, gpointer self);
00122 gboolean unity_music_lens_rhythmbox_collection_xml_parser_parse (UnityMusicLensRhythmboxCollectionXmlParser* self, const gchar* content, gsize len, GError** error);
00123 static void __lambda8_ (UnityMusicLensTrack* track);
00124 const gchar* unity_music_lens_track_get_mime_type (UnityMusicLensTrack* self);
00125 static void ___lambda8__unity_music_lens_rhythmbox_collection_xml_parser_track_info_ready (UnityMusicLensRhythmboxCollectionXmlParser* _sender, UnityMusicLensTrack* track, gpointer self);
00126 static void __lambda9_ (UnityMusicLensTrack* track);
00127 static void ___lambda9__unity_music_lens_rhythmbox_collection_xml_parser_track_info_ready (UnityMusicLensRhythmboxCollectionXmlParser* _sender, UnityMusicLensTrack* track, gpointer self);
00128 static void __lambda10_ (UnityMusicLensTrack* track);
00129 static void ___lambda10__unity_music_lens_rhythmbox_collection_xml_parser_track_info_ready (UnityMusicLensRhythmboxCollectionXmlParser* _sender, UnityMusicLensTrack* track, gpointer self);
00130 Main* main_new (void);
00131 Main* main_construct (GType object_type);
00132 static void main_finalize (Main* obj);
00133 
00134 
00135 static void _main_test_radios_gtest_data_func (gpointer self) {
00136        main_test_radios ();
00137 }
00138 
00139 
00140 static void _main_test_songs_gtest_data_func (gpointer self) {
00141        main_test_songs ();
00142 }
00143 
00144 
00145 static void _main_test_lazy_load_gtest_data_func (gpointer self) {
00146        main_test_lazy_load ();
00147 }
00148 
00149 
00150 static void _main_test_invalid_songload_gtest_data_func (gpointer self) {
00151        main_test_invalid_songload ();
00152 }
00153 
00154 
00155 gint main_main (gchar** args, int args_length1) {
00156        gint result = 0;
00157        g_test_init (&args_length1, &args, NULL);
00158        g_test_add_data_func ("/Unit/ParserChecker/Radios", NULL, _main_test_radios_gtest_data_func);
00159        g_test_add_data_func ("/Unit/ParserChecker/Songs", NULL, _main_test_songs_gtest_data_func);
00160        g_test_add_data_func ("/Unit/ParserChecker/LazyLoad", NULL, _main_test_lazy_load_gtest_data_func);
00161        g_test_add_data_func ("/Unit/ParserChecker/LazyLoad", NULL, _main_test_invalid_songload_gtest_data_func);
00162        g_test_run ();
00163        result = 0;
00164        return result;
00165 }
00166 
00167 
00168 int main (int argc, char ** argv) {
00169        g_type_init ();
00170        return main_main (argv, argc);
00171 }
00172 
00173 
00174 static void __lambda7_ (UnityMusicLensTrack* track) {
00175        UnityMusicLensTrack* _tmp0_;
00176        const gchar* _tmp1_;
00177        const gchar* _tmp2_;
00178        UnityMusicLensTrack* _tmp3_;
00179        const gchar* _tmp4_;
00180        const gchar* _tmp5_;
00181        UnityMusicLensTrack* _tmp6_;
00182        const gchar* _tmp7_;
00183        const gchar* _tmp8_;
00184        UnityMusicLensTrack* _tmp9_;
00185        const gchar* _tmp10_;
00186        const gchar* _tmp11_;
00187        UnityMusicLensTrack* _tmp12_;
00188        const gchar* _tmp13_;
00189        const gchar* _tmp14_;
00190        UnityMusicLensTrack* _tmp15_;
00191        gint _tmp16_;
00192        gint _tmp17_;
00193        UnityMusicLensTrack* _tmp18_;
00194        UnityMusicLensTrackType _tmp19_;
00195        UnityMusicLensTrackType _tmp20_;
00196        g_return_if_fail (track != NULL);
00197        _tmp0_ = track;
00198        _tmp1_ = unity_music_lens_track_get_title (_tmp0_);
00199        _tmp2_ = _tmp1_;
00200        g_assert_cmpstr (_tmp2_, ==, "Absolute Radio 80s (Modem)");
00201        _tmp3_ = track;
00202        _tmp4_ = unity_music_lens_track_get_genre (_tmp3_);
00203        _tmp5_ = _tmp4_;
00204        g_assert_cmpstr (_tmp5_, ==, "other");
00205        _tmp6_ = track;
00206        _tmp7_ = unity_music_lens_track_get_artist (_tmp6_);
00207        _tmp8_ = _tmp7_;
00208        g_assert_cmpstr (_tmp8_, ==, "");
00209        _tmp9_ = track;
00210        _tmp10_ = unity_music_lens_track_get_album (_tmp9_);
00211        _tmp11_ = _tmp10_;
00212        g_assert_cmpstr (_tmp11_, ==, "");
00213        _tmp12_ = track;
00214        _tmp13_ = unity_music_lens_track_get_uri (_tmp12_);
00215        _tmp14_ = _tmp13_;
00216        g_assert_cmpstr (_tmp14_, ==, "http://network.absoluteradio.co.uk/core/audio/ogg/live.pls?service=a8");
00217        _tmp15_ = track;
00218        _tmp16_ = unity_music_lens_track_get_year (_tmp15_);
00219        _tmp17_ = _tmp16_;
00220        g_assert_cmpint (_tmp17_, ==, 0);
00221        _tmp18_ = track;
00222        _tmp19_ = unity_music_lens_track_get_type_track (_tmp18_);
00223        _tmp20_ = _tmp19_;
00224        g_assert (_tmp20_ == UNITY_MUSIC_LENS_TRACK_TYPE_RADIO);
00225 }
00226 
00227 
00228 static void ___lambda7__unity_music_lens_rhythmbox_collection_xml_parser_track_info_ready (UnityMusicLensRhythmboxCollectionXmlParser* _sender, UnityMusicLensTrack* track, gpointer self) {
00229        __lambda7_ (track);
00230 }
00231 
00232 
00233 static void main_test_radios (void) {
00234        UnityMusicLensRhythmboxCollectionXmlParser* _tmp0_;
00235        UnityMusicLensRhythmboxCollectionXmlParser* parser;
00236        gchar* _tmp1_;
00237        gchar* collection_to_parse;
00238        gint _tmp2_;
00239        gint _tmp3_;
00240        GError * _inner_error_ = NULL;
00241        _tmp0_ = unity_music_lens_rhythmbox_collection_xml_parser_new ();
00242        parser = _tmp0_;
00243        _tmp1_ = g_strdup ("<?xml version=\"1.0\" standalone=\"yes\"?>\n" \
00244 "<rhythmdb version=\"1.8\">\n" \
00245 "  <entry type=\"iradio\">\n" \
00246 "    <title>Absolute Radio 80s (Modem)</title>\n" \
00247 "    <genre>80's</genre>\n" \
00248 "    <artist></artist>\n" \
00249 "    <album></album>\n" \
00250 "    <location>http://network.absoluteradio.co.uk/core/audio/ogg/live.p" \
00251 "ls?service=a8</location>\n" \
00252 "    <play-count>6</play-count>\n" \
00253 "    <last-played>1339693331</last-played>\n" \
00254 "    <bitrate>32</bitrate>\n" \
00255 "    <date>0</date>\n" \
00256 "    <media-type>application/octet-stream</media-type>\n" \
00257 "  </entry>\n" \
00258 "</rhythmdb>");
00259        collection_to_parse = _tmp1_;
00260        g_signal_connect (parser, "track-info-ready", (GCallback) ___lambda7__unity_music_lens_rhythmbox_collection_xml_parser_track_info_ready, NULL);
00261        _tmp2_ = strlen (collection_to_parse);
00262        _tmp3_ = _tmp2_;
00263        unity_music_lens_rhythmbox_collection_xml_parser_parse (parser, collection_to_parse, (gsize) _tmp3_, &_inner_error_);
00264        if (_inner_error_ != NULL) {
00265               _g_free0 (collection_to_parse);
00266               _g_object_unref0 (parser);
00267               g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
00268               g_clear_error (&_inner_error_);
00269               return;
00270        }
00271        _g_free0 (collection_to_parse);
00272        _g_object_unref0 (parser);
00273 }
00274 
00275 
00276 static void __lambda8_ (UnityMusicLensTrack* track) {
00277        UnityMusicLensTrack* _tmp0_;
00278        const gchar* _tmp1_;
00279        const gchar* _tmp2_;
00280        UnityMusicLensTrack* _tmp3_;
00281        const gchar* _tmp4_;
00282        const gchar* _tmp5_;
00283        UnityMusicLensTrack* _tmp6_;
00284        const gchar* _tmp7_;
00285        const gchar* _tmp8_;
00286        UnityMusicLensTrack* _tmp9_;
00287        const gchar* _tmp10_;
00288        const gchar* _tmp11_;
00289        UnityMusicLensTrack* _tmp12_;
00290        const gchar* _tmp13_;
00291        const gchar* _tmp14_;
00292        UnityMusicLensTrack* _tmp15_;
00293        gint _tmp16_;
00294        gint _tmp17_;
00295        UnityMusicLensTrack* _tmp18_;
00296        const gchar* _tmp19_;
00297        const gchar* _tmp20_;
00298        UnityMusicLensTrack* _tmp21_;
00299        UnityMusicLensTrackType _tmp22_;
00300        UnityMusicLensTrackType _tmp23_;
00301        g_return_if_fail (track != NULL);
00302        _tmp0_ = track;
00303        _tmp1_ = unity_music_lens_track_get_title (_tmp0_);
00304        _tmp2_ = _tmp1_;
00305        g_assert_cmpstr (_tmp2_, ==, "LA PASSION");
00306        _tmp3_ = track;
00307        _tmp4_ = unity_music_lens_track_get_genre (_tmp3_);
00308        _tmp5_ = _tmp4_;
00309        g_assert_cmpstr (_tmp5_, ==, "techno");
00310        _tmp6_ = track;
00311        _tmp7_ = unity_music_lens_track_get_artist (_tmp6_);
00312        _tmp8_ = _tmp7_;
00313        g_assert_cmpstr (_tmp8_, ==, "GIGI D'AGOSTINO");
00314        _tmp9_ = track;
00315        _tmp10_ = unity_music_lens_track_get_album (_tmp9_);
00316        _tmp11_ = _tmp10_;
00317        g_assert_cmpstr (_tmp11_, ==, "Loulou 007");
00318        _tmp12_ = track;
00319        _tmp13_ = unity_music_lens_track_get_uri (_tmp12_);
00320        _tmp14_ = _tmp13_;
00321        g_assert_cmpstr (_tmp14_, ==, "file:///home/moi/Gigi%20d'agostino%20Passion.mp3");
00322        _tmp15_ = track;
00323        _tmp16_ = unity_music_lens_track_get_year (_tmp15_);
00324        _tmp17_ = _tmp16_;
00325        g_assert_cmpint (_tmp17_, ==, 2000);
00326        _tmp18_ = track;
00327        _tmp19_ = unity_music_lens_track_get_mime_type (_tmp18_);
00328        _tmp20_ = _tmp19_;
00329        g_assert_cmpstr (_tmp20_, ==, "audio/mpeg");
00330        _tmp21_ = track;
00331        _tmp22_ = unity_music_lens_track_get_type_track (_tmp21_);
00332        _tmp23_ = _tmp22_;
00333        g_assert (_tmp23_ == UNITY_MUSIC_LENS_TRACK_TYPE_SONG);
00334 }
00335 
00336 
00337 static void ___lambda8__unity_music_lens_rhythmbox_collection_xml_parser_track_info_ready (UnityMusicLensRhythmboxCollectionXmlParser* _sender, UnityMusicLensTrack* track, gpointer self) {
00338        __lambda8_ (track);
00339 }
00340 
00341 
00342 static void main_test_songs (void) {
00343        UnityMusicLensRhythmboxCollectionXmlParser* _tmp0_;
00344        UnityMusicLensRhythmboxCollectionXmlParser* parser;
00345        gchar* _tmp1_;
00346        gchar* collection_to_parse;
00347        gint _tmp2_;
00348        gint _tmp3_;
00349        GError * _inner_error_ = NULL;
00350        _tmp0_ = unity_music_lens_rhythmbox_collection_xml_parser_new ();
00351        parser = _tmp0_;
00352        _tmp1_ = g_strdup ("<?xml version=\"1.0\" standalone=\"yes\"?>\n" \
00353 "<rhythmdb version=\"1.8\">\n" \
00354 "  <entry type=\"song\">\n" \
00355 "    <title>LA PASSION</title>\n" \
00356 "    <genre>Dance</genre>\n" \
00357 "    <artist>GIGI D'AGOSTINO</artist>\n" \
00358 "    <album>Loulou 007</album>\n" \
00359 "    <duration>228</duration>\n" \
00360 "    <file-size>3661842</file-size>\n" \
00361 "    <location>file:///home/moi/Gigi%20d'agostino%20Passion.mp3</locati" \
00362 "on>\n" \
00363 "    <mtime>1338273042</mtime>\n" \
00364 "    <first-seen>1338536342</first-seen>\n" \
00365 "    <last-seen>1340378542</last-seen>\n" \
00366 "    <bitrate>128</bitrate>\n" \
00367 "    <date>730142</date>\n" \
00368 "    <media-type>audio/mpeg</media-type>\n" \
00369 "    <comment>http://www.danceparadise.ca.tc</comment>\n" \
00370 "  </entry>\n" \
00371 "</rhythmdb>");
00372        collection_to_parse = _tmp1_;
00373        g_signal_connect (parser, "track-info-ready", (GCallback) ___lambda8__unity_music_lens_rhythmbox_collection_xml_parser_track_info_ready, NULL);
00374        _tmp2_ = strlen (collection_to_parse);
00375        _tmp3_ = _tmp2_;
00376        unity_music_lens_rhythmbox_collection_xml_parser_parse (parser, collection_to_parse, (gsize) _tmp3_, &_inner_error_);
00377        if (_inner_error_ != NULL) {
00378               _g_free0 (collection_to_parse);
00379               _g_object_unref0 (parser);
00380               g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
00381               g_clear_error (&_inner_error_);
00382               return;
00383        }
00384        _g_free0 (collection_to_parse);
00385        _g_object_unref0 (parser);
00386 }
00387 
00388 
00389 static void __lambda9_ (UnityMusicLensTrack* track) {
00390        UnityMusicLensTrack* _tmp0_;
00391        const gchar* _tmp1_;
00392        const gchar* _tmp2_;
00393        UnityMusicLensTrack* _tmp3_;
00394        const gchar* _tmp4_;
00395        const gchar* _tmp5_;
00396        UnityMusicLensTrack* _tmp6_;
00397        UnityMusicLensTrackType _tmp7_;
00398        UnityMusicLensTrackType _tmp8_;
00399        g_return_if_fail (track != NULL);
00400        _tmp0_ = track;
00401        _tmp1_ = unity_music_lens_track_get_title (_tmp0_);
00402        _tmp2_ = _tmp1_;
00403        g_assert_cmpstr (_tmp2_, ==, "LA PASSION");
00404        _tmp3_ = track;
00405        _tmp4_ = unity_music_lens_track_get_album (_tmp3_);
00406        _tmp5_ = _tmp4_;
00407        g_assert_cmpstr (_tmp5_, ==, "Loulou 007");
00408        _tmp6_ = track;
00409        _tmp7_ = unity_music_lens_track_get_type_track (_tmp6_);
00410        _tmp8_ = _tmp7_;
00411        g_assert (_tmp8_ == UNITY_MUSIC_LENS_TRACK_TYPE_SONG);
00412 }
00413 
00414 
00415 static void ___lambda9__unity_music_lens_rhythmbox_collection_xml_parser_track_info_ready (UnityMusicLensRhythmboxCollectionXmlParser* _sender, UnityMusicLensTrack* track, gpointer self) {
00416        __lambda9_ (track);
00417 }
00418 
00419 
00420 static void main_test_lazy_load (void) {
00421        UnityMusicLensRhythmboxCollectionXmlParser* _tmp0_;
00422        UnityMusicLensRhythmboxCollectionXmlParser* parser;
00423        gchar* _tmp1_;
00424        gchar* collection_to_parse_chunk;
00425        UnityMusicLensRhythmboxCollectionXmlParser* _tmp2_;
00426        const gchar* _tmp3_;
00427        const gchar* _tmp4_;
00428        gint _tmp5_;
00429        gint _tmp6_;
00430        gchar* _tmp7_;
00431        UnityMusicLensRhythmboxCollectionXmlParser* _tmp8_;
00432        UnityMusicLensRhythmboxCollectionXmlParser* _tmp9_;
00433        const gchar* _tmp10_;
00434        const gchar* _tmp11_;
00435        gint _tmp12_;
00436        gint _tmp13_;
00437        GError * _inner_error_ = NULL;
00438        _tmp0_ = unity_music_lens_rhythmbox_collection_xml_parser_new ();
00439        parser = _tmp0_;
00440        _tmp1_ = g_strdup ("<?xml version=\"1.0\" standalone=\"yes\"?>\n" \
00441 "<rhythmdb version=\"1.8\">\n" \
00442 "  <entry type=\"song\">\n" \
00443 "    <title>LA PASSION</title>\n" \
00444 "    <genre>Dance</genre>\n" \
00445 "    <artist>GIGI D'AGOSTINO</artist>\n");
00446        collection_to_parse_chunk = _tmp1_;
00447        _tmp2_ = parser;
00448        _tmp3_ = collection_to_parse_chunk;
00449        _tmp4_ = collection_to_parse_chunk;
00450        _tmp5_ = strlen (_tmp4_);
00451        _tmp6_ = _tmp5_;
00452        unity_music_lens_rhythmbox_collection_xml_parser_parse (_tmp2_, _tmp3_, (gsize) _tmp6_, &_inner_error_);
00453        if (_inner_error_ != NULL) {
00454               _g_free0 (collection_to_parse_chunk);
00455               _g_object_unref0 (parser);
00456               g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
00457               g_clear_error (&_inner_error_);
00458               return;
00459        }
00460        _tmp7_ = g_strdup ("\n" \
00461 "    <album>Loulou 007</album>\n" \
00462 "    <duration>228</duration>\n" \
00463 "    <file-size>3661842</file-size>\n" \
00464 "    <location>file:///home/moi/Gigi%20d'agostino%20Passion.mp3</locati" \
00465 "on>\n" \
00466 "    <mtime>1338273042</mtime>\n" \
00467 "    <first-seen>1338536342</first-seen>\n" \
00468 "    <last-seen>1340378542</last-seen>\n" \
00469 "    <bitrate>128</bitrate>\n" \
00470 "    <date>730142</date>\n" \
00471 "    <media-type>audio/mpeg</media-type>\n" \
00472 "    <comment>http://www.danceparadise.ca.tc</comment>\n" \
00473 "  </entry>");
00474        _g_free0 (collection_to_parse_chunk);
00475        collection_to_parse_chunk = _tmp7_;
00476        _tmp8_ = parser;
00477        g_signal_connect (_tmp8_, "track-info-ready", (GCallback) ___lambda9__unity_music_lens_rhythmbox_collection_xml_parser_track_info_ready, NULL);
00478        _tmp9_ = parser;
00479        _tmp10_ = collection_to_parse_chunk;
00480        _tmp11_ = collection_to_parse_chunk;
00481        _tmp12_ = strlen (_tmp11_);
00482        _tmp13_ = _tmp12_;
00483        unity_music_lens_rhythmbox_collection_xml_parser_parse (_tmp9_, _tmp10_, (gsize) _tmp13_, &_inner_error_);
00484        if (_inner_error_ != NULL) {
00485               _g_free0 (collection_to_parse_chunk);
00486               _g_object_unref0 (parser);
00487               g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
00488               g_clear_error (&_inner_error_);
00489               return;
00490        }
00491        _g_free0 (collection_to_parse_chunk);
00492        _g_object_unref0 (parser);
00493 }
00494 
00495 
00496 static void __lambda10_ (UnityMusicLensTrack* track) {
00497        UnityMusicLensTrack* _tmp0_;
00498        const gchar* _tmp1_;
00499        const gchar* _tmp2_;
00500        UnityMusicLensTrack* _tmp3_;
00501        UnityMusicLensTrackType _tmp4_;
00502        UnityMusicLensTrackType _tmp5_;
00503        g_return_if_fail (track != NULL);
00504        _tmp0_ = track;
00505        _tmp1_ = unity_music_lens_track_get_title (_tmp0_);
00506        _tmp2_ = _tmp1_;
00507        g_assert_cmpstr (_tmp2_, ==, "le poisson");
00508        _tmp3_ = track;
00509        _tmp4_ = unity_music_lens_track_get_type_track (_tmp3_);
00510        _tmp5_ = _tmp4_;
00511        g_assert (_tmp5_ == UNITY_MUSIC_LENS_TRACK_TYPE_SONG);
00512 }
00513 
00514 
00515 static void ___lambda10__unity_music_lens_rhythmbox_collection_xml_parser_track_info_ready (UnityMusicLensRhythmboxCollectionXmlParser* _sender, UnityMusicLensTrack* track, gpointer self) {
00516        __lambda10_ (track);
00517 }
00518 
00519 
00520 static void main_test_invalid_songload (void) {
00521        UnityMusicLensRhythmboxCollectionXmlParser* _tmp0_;
00522        UnityMusicLensRhythmboxCollectionXmlParser* parser;
00523        gchar* _tmp1_;
00524        gchar* collection_to_parse_chunk;
00525        gint _tmp2_;
00526        gint _tmp3_;
00527        GError * _inner_error_ = NULL;
00528        _tmp0_ = unity_music_lens_rhythmbox_collection_xml_parser_new ();
00529        parser = _tmp0_;
00530        _tmp1_ = g_strdup ("<?xml version=\"1.0\" standalone=\"yes\"?>\n" \
00531 "<rhythmdb version=\"1.8\">\n" \
00532 "  <entry type=\"song\">\n" \
00533 "    <title>LA PASSION</title>\n" \
00534 "    <genre>Dance</genre>\n" \
00535 "  <entry type=\"song\">\n" \
00536 "    <title>le poisson</title>\n" \
00537 "    <genre>Dance</genre>\n" \
00538 "  </entry>");
00539        collection_to_parse_chunk = _tmp1_;
00540        g_signal_connect (parser, "track-info-ready", (GCallback) ___lambda10__unity_music_lens_rhythmbox_collection_xml_parser_track_info_ready, NULL);
00541        _tmp2_ = strlen (collection_to_parse_chunk);
00542        _tmp3_ = _tmp2_;
00543        unity_music_lens_rhythmbox_collection_xml_parser_parse (parser, collection_to_parse_chunk, (gsize) _tmp3_, &_inner_error_);
00544        if (_inner_error_ != NULL) {
00545               _g_free0 (collection_to_parse_chunk);
00546               _g_object_unref0 (parser);
00547               g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
00548               g_clear_error (&_inner_error_);
00549               return;
00550        }
00551        _g_free0 (collection_to_parse_chunk);
00552        _g_object_unref0 (parser);
00553 }
00554 
00555 
00556 Main* main_construct (GType object_type) {
00557        Main* self = NULL;
00558        self = (Main*) g_type_create_instance (object_type);
00559        return self;
00560 }
00561 
00562 
00563 Main* main_new (void) {
00564        return main_construct (TYPE_MAIN);
00565 }
00566 
00567 
00568 static void value_main_init (GValue* value) {
00569        value->data[0].v_pointer = NULL;
00570 }
00571 
00572 
00573 static void value_main_free_value (GValue* value) {
00574        if (value->data[0].v_pointer) {
00575               main_unref (value->data[0].v_pointer);
00576        }
00577 }
00578 
00579 
00580 static void value_main_copy_value (const GValue* src_value, GValue* dest_value) {
00581        if (src_value->data[0].v_pointer) {
00582               dest_value->data[0].v_pointer = main_ref (src_value->data[0].v_pointer);
00583        } else {
00584               dest_value->data[0].v_pointer = NULL;
00585        }
00586 }
00587 
00588 
00589 static gpointer value_main_peek_pointer (const GValue* value) {
00590        return value->data[0].v_pointer;
00591 }
00592 
00593 
00594 static gchar* value_main_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
00595        if (collect_values[0].v_pointer) {
00596               Main* object;
00597               object = collect_values[0].v_pointer;
00598               if (object->parent_instance.g_class == NULL) {
00599                      return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
00600               } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
00601                      return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
00602               }
00603               value->data[0].v_pointer = main_ref (object);
00604        } else {
00605               value->data[0].v_pointer = NULL;
00606        }
00607        return NULL;
00608 }
00609 
00610 
00611 static gchar* value_main_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
00612        Main** object_p;
00613        object_p = collect_values[0].v_pointer;
00614        if (!object_p) {
00615               return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
00616        }
00617        if (!value->data[0].v_pointer) {
00618               *object_p = NULL;
00619        } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
00620               *object_p = value->data[0].v_pointer;
00621        } else {
00622               *object_p = main_ref (value->data[0].v_pointer);
00623        }
00624        return NULL;
00625 }
00626 
00627 
00628 GParamSpec* param_spec_main (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
00629        ParamSpecMain* spec;
00630        g_return_val_if_fail (g_type_is_a (object_type, TYPE_MAIN), NULL);
00631        spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
00632        G_PARAM_SPEC (spec)->value_type = object_type;
00633        return G_PARAM_SPEC (spec);
00634 }
00635 
00636 
00637 gpointer value_get_main (const GValue* value) {
00638        g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_MAIN), NULL);
00639        return value->data[0].v_pointer;
00640 }
00641 
00642 
00643 void value_set_main (GValue* value, gpointer v_object) {
00644        Main* old;
00645        g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_MAIN));
00646        old = value->data[0].v_pointer;
00647        if (v_object) {
00648               g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_MAIN));
00649               g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
00650               value->data[0].v_pointer = v_object;
00651               main_ref (value->data[0].v_pointer);
00652        } else {
00653               value->data[0].v_pointer = NULL;
00654        }
00655        if (old) {
00656               main_unref (old);
00657        }
00658 }
00659 
00660 
00661 void value_take_main (GValue* value, gpointer v_object) {
00662        Main* old;
00663        g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_MAIN));
00664        old = value->data[0].v_pointer;
00665        if (v_object) {
00666               g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_MAIN));
00667               g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
00668               value->data[0].v_pointer = v_object;
00669        } else {
00670               value->data[0].v_pointer = NULL;
00671        }
00672        if (old) {
00673               main_unref (old);
00674        }
00675 }
00676 
00677 
00678 static void main_class_init (MainClass * klass) {
00679        main_parent_class = g_type_class_peek_parent (klass);
00680        MAIN_CLASS (klass)->finalize = main_finalize;
00681 }
00682 
00683 
00684 static void main_instance_init (Main * self) {
00685        self->ref_count = 1;
00686 }
00687 
00688 
00689 static void main_finalize (Main* obj) {
00690        Main * self;
00691        self = MAIN (obj);
00692 }
00693 
00694 
00695 GType main_get_type (void) {
00696        static volatile gsize main_type_id__volatile = 0;
00697        if (g_once_init_enter (&main_type_id__volatile)) {
00698               static const GTypeValueTable g_define_type_value_table = { value_main_init, value_main_free_value, value_main_copy_value, value_main_peek_pointer, "p", value_main_collect_value, "p", value_main_lcopy_value };
00699               static const GTypeInfo g_define_type_info = { sizeof (MainClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) main_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Main), 0, (GInstanceInitFunc) main_instance_init, &g_define_type_value_table };
00700               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) };
00701               GType main_type_id;
00702               main_type_id = g_type_register_fundamental (g_type_fundamental_next (), "Main", &g_define_type_info, &g_define_type_fundamental_info, 0);
00703               g_once_init_leave (&main_type_id__volatile, main_type_id);
00704        }
00705        return main_type_id__volatile;
00706 }
00707 
00708 
00709 gpointer main_ref (gpointer instance) {
00710        Main* self;
00711        self = instance;
00712        g_atomic_int_inc (&self->ref_count);
00713        return instance;
00714 }
00715 
00716 
00717 void main_unref (gpointer instance) {
00718        Main* self;
00719        self = instance;
00720        if (g_atomic_int_dec_and_test (&self->ref_count)) {
00721               MAIN_GET_CLASS (self)->finalize (self);
00722               g_type_free_instance ((GTypeInstance *) self);
00723        }
00724 }
00725 
00726 
00727