~vcs-imports/vala/trunk

« back to all changes in this revision

Viewing changes to tests/errors/delegate-throws-error-code.c-expected

  • Committer: Rico Tzschichholz
  • Date: 2021-10-23 17:35:04 UTC
  • Revision ID: git-v1:9c2566584ec7f50715a7490c7d4e112506045585
tests: Add "throws error code" tests to increase coverage

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* errors_delegate_throws_error_code.c generated by valac, the Vala compiler
 
2
 * generated from errors_delegate_throws_error_code.vala, do not modify */
 
3
 
 
4
#include <glib.h>
 
5
 
 
6
#if !defined(VALA_EXTERN)
 
7
#if defined(_MSC_VER)
 
8
#define VALA_EXTERN __declspec(dllexport) extern
 
9
#elif __GNUC__ >= 4
 
10
#define VALA_EXTERN __attribute__((visibility("default"))) extern
 
11
#else
 
12
#define VALA_EXTERN extern
 
13
#endif
 
14
#endif
 
15
 
 
16
typedef void (*FooFunc) (gpointer user_data, GError** error);
 
17
 
 
18
typedef enum  {
 
19
        FOO_ERROR_FOO,
 
20
        FOO_ERROR_BAR
 
21
} FooError;
 
22
#define FOO_ERROR foo_error_quark ()
 
23
 
 
24
VALA_EXTERN GQuark foo_error_quark (void);
 
25
static void _vala_main (void);
 
26
static void __lambda4_ (GError** error);
 
27
static void ___lambda4__foo_func (gpointer self,
 
28
                           GError** error);
 
29
 
 
30
GQuark
 
31
foo_error_quark (void)
 
32
{
 
33
        return g_quark_from_static_string ("foo-error-quark");
 
34
}
 
35
 
 
36
static void
 
37
__lambda4_ (GError** error)
 
38
{
 
39
}
 
40
 
 
41
static void
 
42
___lambda4__foo_func (gpointer self,
 
43
                      GError** error)
 
44
{
 
45
        __lambda4_ (error);
 
46
}
 
47
 
 
48
static void
 
49
_vala_main (void)
 
50
{
 
51
        FooFunc foo = NULL;
 
52
        gpointer foo_target;
 
53
        GDestroyNotify foo_target_destroy_notify;
 
54
        GError* _inner_error0_ = NULL;
 
55
        foo = ___lambda4__foo_func;
 
56
        foo_target = NULL;
 
57
        foo_target_destroy_notify = NULL;
 
58
        foo (foo_target, &_inner_error0_);
 
59
        if (G_UNLIKELY (_inner_error0_ != NULL)) {
 
60
                (foo_target_destroy_notify == NULL) ? NULL : (foo_target_destroy_notify (foo_target), NULL);
 
61
                foo = NULL;
 
62
                foo_target = NULL;
 
63
                foo_target_destroy_notify = NULL;
 
64
                g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
 
65
                g_clear_error (&_inner_error0_);
 
66
                return;
 
67
        }
 
68
        (foo_target_destroy_notify == NULL) ? NULL : (foo_target_destroy_notify (foo_target), NULL);
 
69
        foo = NULL;
 
70
        foo_target = NULL;
 
71
        foo_target_destroy_notify = NULL;
 
72
}
 
73
 
 
74
int
 
75
main (int argc,
 
76
      char ** argv)
 
77
{
 
78
        _vala_main ();
 
79
        return 0;
 
80
}
 
81