~ubuntu-branches/ubuntu/precise/gwibber/precise

« back to all changes in this revision

Viewing changes to test/vala/test-vala.c

  • Committer: Package Import Robot
  • Author(s): Ken VanDine
  • Date: 2011-11-21 09:29:54 UTC
  • mfrom: (1.1.65)
  • Revision ID: package-import@ubuntu.com-20111121092954-v13j1zaju7dvqer3
Tags: 3.3.1-0ubuntu1
* New upstream release
  - Added a "debug" settings key to allow debug logging without running from 
    a terminal.  
  - Ensure _profile is passed a dict, if not it failed
  - Clean up indicator handling, setup the counts up front to ensure the 
    ordering is consistent.
  - Only trim the padding off the entry if we are running in the client.  
    This fixes the gray bar that was displayed below the poster entry 
    in gwibber-poster.
  - Translation fixes for liked and shared strings (LP: #833807)
  - Added LINGUAS file to ensure the po files make it in the 
    DIST (LP: #866038)
  - specify --shared-library when compiling the typelib, this fixes 
    GI (LP: #893125)
* lp_861903.patch, lp_882633.patch, and lp_884831.patch dropped, fixed 
  upstream
* debian/control
  - build depend on valac-0.14

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* test-vala.c generated by valac 0.14.0, the Vala compiler
 
2
 * generated from test-vala.vala, do not modify */
 
3
 
 
4
/*
 
5
 * Copyright (C) 2011 Canonical Ltd
 
6
 *
 
7
 * This library is free software; you can redistribute it and/or modify
 
8
 * it under the terms of the GNU Lesser General Public License
 
9
 * version 3.0 as published by the Free Software Foundation.
 
10
 *
 
11
 * This library is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU Lesser General Public License version 3.0 for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU Lesser General Public
 
17
 * License along with this library. If not, see
 
18
 * <http://www.gnu.org/licenses/>.
 
19
 *
 
20
 * Authored by Ken VanDine <ken@vandine.org>
 
21
 */
 
22
 
 
23
#include <glib.h>
 
24
#include <glib-object.h>
 
25
#include <stdlib.h>
 
26
#include <string.h>
 
27
#include <gio/gio.h>
 
28
#include <gwibber.h>
 
29
#include <gtk/gtk.h>
 
30
#include <config.h>
 
31
 
 
32
 
 
33
#define TYPE_MAIN (main_get_type ())
 
34
#define MAIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAIN, Main))
 
35
#define MAIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAIN, MainClass))
 
36
#define IS_MAIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAIN))
 
37
#define IS_MAIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAIN))
 
38
#define MAIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAIN, MainClass))
 
39
 
 
40
typedef struct _Main Main;
 
41
typedef struct _MainClass MainClass;
 
42
typedef struct _MainPrivate MainPrivate;
 
43
 
 
44
#define GWIBBER_TEST_TYPE_UTILS (gwibber_test_utils_get_type ())
 
45
#define GWIBBER_TEST_UTILS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GWIBBER_TEST_TYPE_UTILS, GwibberTestUtils))
 
46
#define GWIBBER_TEST_UTILS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GWIBBER_TEST_TYPE_UTILS, GwibberTestUtilsClass))
 
47
#define GWIBBER_TEST_IS_UTILS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GWIBBER_TEST_TYPE_UTILS))
 
48
#define GWIBBER_TEST_IS_UTILS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GWIBBER_TEST_TYPE_UTILS))
 
49
#define GWIBBER_TEST_UTILS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GWIBBER_TEST_TYPE_UTILS, GwibberTestUtilsClass))
 
50
 
 
51
typedef struct _GwibberTestUtils GwibberTestUtils;
 
52
typedef struct _GwibberTestUtilsClass GwibberTestUtilsClass;
 
53
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
 
54
 
 
55
#define GWIBBER_TEST_TYPE_UTILS_SUITE (gwibber_test_utils_suite_get_type ())
 
56
#define GWIBBER_TEST_UTILS_SUITE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GWIBBER_TEST_TYPE_UTILS_SUITE, GwibberTestUtilsSuite))
 
57
#define GWIBBER_TEST_UTILS_SUITE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GWIBBER_TEST_TYPE_UTILS_SUITE, GwibberTestUtilsSuiteClass))
 
58
#define GWIBBER_TEST_IS_UTILS_SUITE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GWIBBER_TEST_TYPE_UTILS_SUITE))
 
59
#define GWIBBER_TEST_IS_UTILS_SUITE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GWIBBER_TEST_TYPE_UTILS_SUITE))
 
60
#define GWIBBER_TEST_UTILS_SUITE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GWIBBER_TEST_TYPE_UTILS_SUITE, GwibberTestUtilsSuiteClass))
 
61
 
 
62
typedef struct _GwibberTestUtilsSuite GwibberTestUtilsSuite;
 
63
typedef struct _GwibberTestUtilsSuiteClass GwibberTestUtilsSuiteClass;
 
64
#define _gwibber_test_utils_suite_unref0(var) ((var == NULL) ? NULL : (var = (gwibber_test_utils_suite_unref (var), NULL)))
 
65
 
 
66
struct _Main {
 
67
        GObject parent_instance;
 
68
        MainPrivate * priv;
 
69
};
 
70
 
 
71
struct _MainClass {
 
72
        GObjectClass parent_class;
 
73
};
 
74
 
 
75
 
 
76
static gpointer main_parent_class = NULL;
 
77
 
 
78
GType main_get_type (void) G_GNUC_CONST;
 
79
enum  {
 
80
        MAIN_DUMMY_PROPERTY
 
81
};
 
82
static Main* main_new (void);
 
83
static Main* main_construct (GType object_type);
 
84
GwibberTestUtils* gwibber_test_utils_new (void);
 
85
GwibberTestUtils* gwibber_test_utils_construct (GType object_type);
 
86
GType gwibber_test_utils_get_type (void) G_GNUC_CONST;
 
87
void gwibber_test_utils_setup (GwibberTestUtils* self, const gchar* name, GError** error);
 
88
static void main_run_tests (Main* self, gboolean b);
 
89
static void _main_run_tests_gwibber_test_utils_available (GwibberTestUtils* _sender, gboolean up, gpointer self);
 
90
gpointer gwibber_test_utils_suite_ref (gpointer instance);
 
91
void gwibber_test_utils_suite_unref (gpointer instance);
 
92
GParamSpec* gwibber_test_param_spec_utils_suite (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
 
93
void gwibber_test_value_set_utils_suite (GValue* value, gpointer v_object);
 
94
void gwibber_test_value_take_utils_suite (GValue* value, gpointer v_object);
 
95
gpointer gwibber_test_value_get_utils_suite (const GValue* value);
 
96
GType gwibber_test_utils_suite_get_type (void) G_GNUC_CONST;
 
97
GwibberTestUtilsSuite* gwibber_test_utils_suite_new (void);
 
98
GwibberTestUtilsSuite* gwibber_test_utils_suite_construct (GType object_type);
 
99
static gint main_main (gchar** args, int args_length1);
 
100
 
 
101
 
 
102
static void _main_run_tests_gwibber_test_utils_available (GwibberTestUtils* _sender, gboolean up, gpointer self) {
 
103
#line 28 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
104
        main_run_tests (self, up);
 
105
#line 106 "test-vala.c"
 
106
}
 
107
 
 
108
 
 
109
static Main* main_construct (GType object_type) {
 
110
        Main * self = NULL;
 
111
        GwibberTestUtils* _tmp0_;
 
112
        GwibberTestUtils* u;
 
113
        GError * _inner_error_ = NULL;
 
114
#line 24 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
115
        self = (Main*) g_object_new (object_type, NULL);
 
116
#line 26 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
117
        _tmp0_ = gwibber_test_utils_new ();
 
118
#line 26 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
119
        u = _tmp0_;
 
120
#line 27 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
121
        gwibber_test_utils_setup (u, "com.Gwibber.Service", &_inner_error_);
 
122
#line 27 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
123
        if (_inner_error_ != NULL) {
 
124
#line 27 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
125
                _g_object_unref0 (u);
 
126
#line 27 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
127
                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);
 
128
#line 27 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
129
                g_clear_error (&_inner_error_);
 
130
#line 27 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
131
                return NULL;
 
132
#line 133 "test-vala.c"
 
133
        }
 
134
#line 28 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
135
        g_signal_connect_object (u, "available", (GCallback) _main_run_tests_gwibber_test_utils_available, self, 0);
 
136
#line 24 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
137
        _g_object_unref0 (u);
 
138
#line 24 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
139
        return self;
 
140
#line 141 "test-vala.c"
 
141
}
 
142
 
 
143
 
 
144
static Main* main_new (void) {
 
145
#line 24 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
146
        return main_construct (TYPE_MAIN);
 
147
#line 148 "test-vala.c"
 
148
}
 
149
 
 
150
 
 
151
static void main_run_tests (Main* self, gboolean b) {
 
152
        gchar** args;
 
153
        gint args_length1;
 
154
        gint _args_size_;
 
155
        GwibberService* _tmp0_;
 
156
        GwibberService* service;
 
157
        GwibberTestUtilsSuite* utils_suite = NULL;
 
158
        GwibberTestUtilsSuite* _tmp1_;
 
159
#line 31 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
160
        g_return_if_fail (self != NULL);
 
161
#line 33 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
162
        args = NULL;
 
163
#line 33 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
164
        args_length1 = 0;
 
165
#line 33 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
166
        _args_size_ = args_length1;
 
167
#line 34 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
168
        _tmp0_ = gwibber_service_new ();
 
169
#line 34 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
170
        service = _tmp0_;
 
171
#line 35 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
172
        g_test_init (&args_length1, &args, NULL);
 
173
#line 38 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
174
        _tmp1_ = gwibber_test_utils_suite_new ();
 
175
#line 38 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
176
        _gwibber_test_utils_suite_unref0 (utils_suite);
 
177
#line 38 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
178
        utils_suite = _tmp1_;
 
179
#line 39 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
180
        g_test_run ();
 
181
#line 40 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
182
        gwibber_service_quit (service);
 
183
#line 41 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
184
        gtk_main_quit ();
 
185
#line 31 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
186
        _gwibber_test_utils_suite_unref0 (utils_suite);
 
187
#line 31 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
188
        _g_object_unref0 (service);
 
189
#line 190 "test-vala.c"
 
190
}
 
191
 
 
192
 
 
193
static gint main_main (gchar** args, int args_length1) {
 
194
        gint result = 0;
 
195
        Main* _tmp0_;
 
196
        Main* m;
 
197
#line 46 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
198
        g_setenv ("XDG_DATA_HOME", TESTDIR "/data", TRUE);
 
199
#line 47 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
200
        g_setenv ("XDG_CACHE_HOME", TESTDIR "/data", TRUE);
 
201
#line 48 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
202
        gtk_init (&args_length1, &args);
 
203
#line 49 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
204
        _tmp0_ = main_new ();
 
205
#line 49 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
206
        m = _tmp0_;
 
207
#line 50 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
208
        gtk_main ();
 
209
#line 52 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
210
        result = 0;
 
211
#line 52 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
212
        _g_object_unref0 (m);
 
213
#line 52 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
214
        return result;
 
215
#line 216 "test-vala.c"
 
216
}
 
217
 
 
218
 
 
219
int main (int argc, char ** argv) {
 
220
#line 44 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
221
        g_type_init ();
 
222
#line 44 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
223
        return main_main (argv, argc);
 
224
#line 225 "test-vala.c"
 
225
}
 
226
 
 
227
 
 
228
static void main_class_init (MainClass * klass) {
 
229
#line 22 "/home/ken/src/gwibber/trunk/test/vala/test-vala.vala"
 
230
        main_parent_class = g_type_class_peek_parent (klass);
 
231
#line 232 "test-vala.c"
 
232
}
 
233
 
 
234
 
 
235
static void main_instance_init (Main * self) {
 
236
}
 
237
 
 
238
 
 
239
GType main_get_type (void) {
 
240
        static volatile gsize main_type_id__volatile = 0;
 
241
        if (g_once_init_enter (&main_type_id__volatile)) {
 
242
                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, NULL };
 
243
                GType main_type_id;
 
244
                main_type_id = g_type_register_static (G_TYPE_OBJECT, "Main", &g_define_type_info, 0);
 
245
                g_once_init_leave (&main_type_id__volatile, main_type_id);
 
246
        }
 
247
        return main_type_id__volatile;
 
248
}
 
249
 
 
250
 
 
251