1
/* test-case.c generated by valac 0.11.2.25-30b2-dirty, the Vala compiler
1
/* test-case.c generated by valac 0.11.5.3-fe751, the Vala compiler
2
2
* generated from test-case.vala, do not modify */
91
92
struct _FolksTestCaseAdaptorPrivate {
93
FolksTestCaseTestMethod test;
95
GDestroyNotify test_target_destroy_notify;
96
FolksTestCase* test_case;
94
FolksTestCaseTestMethod _test;
95
gpointer _test_target;
96
GDestroyNotify _test_target_destroy_notify;
97
FolksTestCase* _test_case;
99
100
struct _FolksTestCaseParamSpecAdaptor {
138
139
FOLKS_TEST_CASE_ADAPTOR_DUMMY_PROPERTY
141
static void _folks_test_case_adaptor_printerr_func_stack_trace (FolksTestCaseAdaptor* self, const gchar* text);
142
static void _folks_test_case_adaptor_log_func_stack_trace (FolksTestCaseAdaptor* self, const gchar* log_domain, GLogLevelFlags log_levels, const gchar* message);
143
static void __folks_test_case_adaptor_log_func_stack_trace_glog_func (const gchar* log_domain, GLogLevelFlags log_levels, const gchar* message, gpointer self);
140
144
static void folks_test_case_adaptor_set_name (FolksTestCaseAdaptor* self, const gchar* value);
141
145
static void folks_test_case_adaptor_finalize (FolksTestCaseAdaptor* obj);
142
146
static void folks_test_case_finalize (GObject* obj);
150
154
g_return_val_if_fail (name != NULL, NULL);
151
155
self = (FolksTestCase*) g_object_new (object_type, NULL);
152
156
_tmp0_ = g_test_create_suite (name);
153
self->priv->suite = _tmp0_;
157
self->priv->_suite = _tmp0_;
196
200
_tmp0_ = folks_test_case_adaptor_new (name, test, test_target, self);
197
201
adaptor = _tmp0_;
198
202
_tmp1_ = _folks_test_case_adaptor_ref0 (adaptor);
199
_vala_array_add1 (&self->priv->adaptors, &self->priv->adaptors_length1, &self->priv->_adaptors_size_, _tmp1_);
203
_vala_array_add1 (&self->priv->_adaptors, &self->priv->_adaptors_length1, &self->priv->__adaptors_size_, _tmp1_);
200
204
_tmp2_ = folks_test_case_adaptor_get_name (adaptor);
201
205
_tmp3_ = g_test_create_case (_tmp2_, (gsize) 0, adaptor, (void (*) (void)) _folks_test_case_adaptor_set_up_gtest_func, (void (*) (void)) _folks_test_case_adaptor_run_gtest_func, (void (*) (void)) _folks_test_case_adaptor_tear_down_gtest_func);
202
g_test_suite_add (self->priv->suite, _tmp3_);
206
g_test_suite_add (self->priv->_suite, _tmp3_);
203
207
_folks_test_case_adaptor_unref0 (adaptor);
227
231
GTestSuite* folks_test_case_get_suite (FolksTestCase* self) {
228
232
GTestSuite* result = NULL;
229
233
g_return_val_if_fail (self != NULL, NULL);
230
result = self->priv->suite;
234
result = self->priv->_suite;
240
244
static FolksTestCaseAdaptor* folks_test_case_adaptor_construct (GType object_type, const gchar* name, FolksTestCaseTestMethod test, void* test_target, FolksTestCase* test_case) {
241
245
FolksTestCaseAdaptor* self = NULL;
242
FolksTestCaseTestMethod _tmp0_;
243
FolksTestCaseTestMethod _tmp1_;
244
FolksTestCase* _tmp2_;
245
FolksTestCase* _tmp3_;
248
FolksTestCaseTestMethod _tmp2_;
249
FolksTestCaseTestMethod _tmp3_;
250
FolksTestCase* _tmp4_;
251
FolksTestCase* _tmp5_;
246
252
g_return_val_if_fail (name != NULL, NULL);
247
253
g_return_val_if_fail (test_case != NULL, NULL);
248
254
self = (FolksTestCaseAdaptor*) g_type_create_instance (object_type);
249
folks_test_case_adaptor_set_name (self, name);
255
_tmp0_ = g_strdup (name);
252
(self->priv->test_target_destroy_notify == NULL) ? NULL : (self->priv->test_target_destroy_notify (self->priv->test_target), NULL);
253
self->priv->test = NULL;
254
self->priv->test_target = NULL;
255
self->priv->test_target_destroy_notify = NULL;
256
self->priv->test_target = test_target;
257
self->priv->test_target_destroy_notify = NULL;
258
self->priv->test = _tmp1_;
259
_tmp2_ = _g_object_ref0 (test_case);
257
_g_free0 (self->priv->_name);
258
self->priv->_name = _tmp1_;
261
_g_object_unref0 (self->priv->test_case);
262
self->priv->test_case = _tmp3_;
261
(self->priv->_test_target_destroy_notify == NULL) ? NULL : (self->priv->_test_target_destroy_notify (self->priv->_test_target), NULL);
262
self->priv->_test = NULL;
263
self->priv->_test_target = NULL;
264
self->priv->_test_target_destroy_notify = NULL;
265
self->priv->_test_target = test_target;
266
self->priv->_test_target_destroy_notify = NULL;
267
self->priv->_test = _tmp3_;
268
_tmp4_ = _g_object_ref0 (test_case);
270
_g_object_unref0 (self->priv->_test_case);
271
self->priv->_test_case = _tmp5_;
281
static void __folks_test_case_adaptor_log_func_stack_trace_glog_func (const gchar* log_domain, GLogLevelFlags log_levels, const gchar* message, gpointer self) {
282
_folks_test_case_adaptor_log_func_stack_trace (self, log_domain, log_levels, message);
272
286
static void folks_test_case_adaptor_set_up (FolksTestCaseAdaptor* self, void* fixture) {
273
287
g_return_if_fail (self != NULL);
274
folks_test_case_set_up (self->priv->test_case);
288
g_set_printerr_handler ((GPrintFunc) _folks_test_case_adaptor_printerr_func_stack_trace);
289
g_log_set_default_handler (__folks_test_case_adaptor_log_func_stack_trace_glog_func, self);
290
folks_test_case_set_up (self->priv->_test_case);
294
static void _folks_test_case_adaptor_printerr_func_stack_trace (FolksTestCaseAdaptor* self, const gchar* text) {
295
g_return_if_fail (self != NULL);
297
fprintf (stderr, "%s", text);
299
g_on_error_stack_trace ("libtool --mode=execute gdb");
303
static void _folks_test_case_adaptor_log_func_stack_trace (FolksTestCaseAdaptor* self, const gchar* log_domain, GLogLevelFlags log_levels, const gchar* message) {
304
g_return_if_fail (self != NULL);
305
g_return_if_fail (message != NULL);
306
g_log_default_handler (log_domain, log_levels, message, NULL);
307
if ((log_levels & ((G_LOG_LEVEL_WARNING | G_LOG_LEVEL_ERROR) | G_LOG_LEVEL_CRITICAL)) != 0) {
308
g_on_error_stack_trace ("libtool --mode=execute gdb");
278
313
static void folks_test_case_adaptor_run (FolksTestCaseAdaptor* self, void* fixture) {
279
314
g_return_if_fail (self != NULL);
280
self->priv->test (self->priv->test_target);
315
self->priv->_test (self->priv->_test_target);
284
319
static void folks_test_case_adaptor_tear_down (FolksTestCaseAdaptor* self, void* fixture) {
285
320
g_return_if_fail (self != NULL);
286
folks_test_case_tear_down (self->priv->test_case);
321
folks_test_case_tear_down (self->priv->_test_case);
433
468
FolksTestCaseAdaptor * self;
434
469
self = FOLKS_TEST_CASE_ADAPTOR (obj);
435
470
_g_free0 (self->priv->_name);
436
(self->priv->test_target_destroy_notify == NULL) ? NULL : (self->priv->test_target_destroy_notify (self->priv->test_target), NULL);
437
self->priv->test = NULL;
438
self->priv->test_target = NULL;
439
self->priv->test_target_destroy_notify = NULL;
440
_g_object_unref0 (self->priv->test_case);
471
(self->priv->_test_target_destroy_notify == NULL) ? NULL : (self->priv->_test_target_destroy_notify (self->priv->_test_target), NULL);
472
self->priv->_test = NULL;
473
self->priv->_test_target = NULL;
474
self->priv->_test_target_destroy_notify = NULL;
475
_g_object_unref0 (self->priv->_test_case);
486
521
FolksTestCaseAdaptor** _tmp0_ = NULL;
487
522
self->priv = FOLKS_TEST_CASE_GET_PRIVATE (self);
488
523
_tmp0_ = g_new0 (FolksTestCaseAdaptor*, 0 + 1);
489
self->priv->adaptors = _tmp0_;
490
self->priv->adaptors_length1 = 0;
491
self->priv->_adaptors_size_ = self->priv->adaptors_length1;
524
self->priv->_adaptors = _tmp0_;
525
self->priv->_adaptors_length1 = 0;
526
self->priv->__adaptors_size_ = self->priv->_adaptors_length1;
495
530
static void folks_test_case_finalize (GObject* obj) {
496
531
FolksTestCase * self;
497
532
self = FOLKS_TEST_CASE (obj);
498
self->priv->adaptors = (_vala_array_free (self->priv->adaptors, self->priv->adaptors_length1, (GDestroyNotify) folks_test_case_adaptor_unref), NULL);
533
self->priv->_adaptors = (_vala_array_free (self->priv->_adaptors, self->priv->_adaptors_length1, (GDestroyNotify) folks_test_case_adaptor_unref), NULL);
499
534
G_OBJECT_CLASS (folks_test_case_parent_class)->finalize (obj);