diff options
author | Colin Walters <walters@verbum.org> | 2012-12-02 12:15:53 -0500 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2012-12-02 16:25:02 -0500 |
commit | 97b30ae5e77d5e36d127d02b247d6d41b8e1c8c3 (patch) | |
tree | 5e038984d7b6586a747b06dd2476079b68587f80 /tests/scanner/warnlib.c | |
parent | ceb84d1e084b8048b2abb81d1e1ebe600f00d00e (diff) | |
download | gobject-introspection-97b30ae5e77d5e36d127d02b247d6d41b8e1c8c3.tar.gz |
WarnLib: New library for testing API that emits warnings
Both GIMarshallingTests and Regress right now use --warn-error; but
in some cases (e.g. GErrors without a corresponding enum), we still
want bindings to support the functionality.
So add this new library where we can add C API that emits
introspection warnings.
https://bugzilla.gnome.org/show_bug.cgi?id=689488
Diffstat (limited to 'tests/scanner/warnlib.c')
-rw-r--r-- | tests/scanner/warnlib.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/scanner/warnlib.c b/tests/scanner/warnlib.c new file mode 100644 index 00000000..4fc8515d --- /dev/null +++ b/tests/scanner/warnlib.c @@ -0,0 +1,20 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ + +#include "config.h" + +#include "warnlib.h" + +GQuark +warnlib_unpaired_error_quark (void) +{ + return g_quark_from_static_string ("warnlib-unpaired-error"); +} + +gboolean +warnlib_throw_unpaired (GError **error) +{ + g_set_error_literal (error, warnlib_unpaired_error_quark (), 0, + "Unpaired error"); + return FALSE; +} + |