From 97b30ae5e77d5e36d127d02b247d6d41b8e1c8c3 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Sun, 2 Dec 2012 12:15:53 -0500 Subject: 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 --- tests/scanner/warnlib.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tests/scanner/warnlib.h (limited to 'tests/scanner/warnlib.h') diff --git a/tests/scanner/warnlib.h b/tests/scanner/warnlib.h new file mode 100644 index 00000000..8aca901a --- /dev/null +++ b/tests/scanner/warnlib.h @@ -0,0 +1,13 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ + +#ifndef __WARNLIB_H__ +#define __WARNLIB_H__ + +#include + +#define WARNLIB_UNPAIRED_ERROR (warnlib_unpaired_error_quark ()) +GQuark warnlib_unpaired_error_quark (void); + +gboolean warnlib_throw_unpaired (GError **error); + +#endif -- cgit v1.2.1 From b714353e38cf72b6cb2754d413b3688a47624028 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Sun, 3 Feb 2013 10:50:21 -0500 Subject: tests: Move do_moo to warnlib We want to warn on unnamed params in declarations to ensure that all functions are bindable. Thus, we need to move a test containing unnamed params to WarnLib so it can be tested. https://bugzilla.gnome.org/show_bug.cgi?id=693098 --- tests/scanner/warnlib.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'tests/scanner/warnlib.h') diff --git a/tests/scanner/warnlib.h b/tests/scanner/warnlib.h index 8aca901a..9e448c08 100644 --- a/tests/scanner/warnlib.h +++ b/tests/scanner/warnlib.h @@ -10,4 +10,27 @@ GQuark warnlib_unpaired_error_quark (void); gboolean warnlib_throw_unpaired (GError **error); +/* interface */ +#define WARNLIB_TYPE_WHATEVER (warnlib_whatever_get_type ()) +#define WARNLIB_WHATEVER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), WARNLIB_TYPE_WHATEVER, WarnLibWhatever)) +#define WARNLIB_IS_WHATEVER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), WARNLIB_TYPE_WHATEVER)) +#define WARNLIB_WHATEVER_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), WARNLIB_TYPE_WHATEVER, WarnLibWhateverIface)) + +typedef struct _WarnLibWhateverIface WarnLibWhateverIface; +typedef struct _WarnLibWhatever WarnLibWhatever; + +struct _WarnLibWhateverIface +{ + GTypeInterface parent_iface; + + /* virtual table */ + + /* explicitly test un-named parameters */ + void (*do_moo) (WarnLibWhatever *self, int, gpointer); +}; + +void warnlib_whatever_do_moo (WarnLibWhatever *self, int, gpointer); + +GType warnlib_whatever_get_type (void) G_GNUC_CONST; + #endif -- cgit v1.2.1 From 001631bf9b9e672154492bf6547c0c7c985ed3e0 Mon Sep 17 00:00:00 2001 From: Dieter Verfaillie Date: Fri, 23 Aug 2013 08:48:05 +0200 Subject: giscanner: write virtual method instance parameter docs to .gir file --- tests/scanner/warnlib.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/scanner/warnlib.h') diff --git a/tests/scanner/warnlib.h b/tests/scanner/warnlib.h index 9e448c08..a4c28b47 100644 --- a/tests/scanner/warnlib.h +++ b/tests/scanner/warnlib.h @@ -27,9 +27,12 @@ struct _WarnLibWhateverIface /* explicitly test un-named parameters */ void (*do_moo) (WarnLibWhatever *self, int, gpointer); + + void (*do_boo) (WarnLibWhatever *self, int x, gpointer y); }; void warnlib_whatever_do_moo (WarnLibWhatever *self, int, gpointer); +void warnlib_whatever_do_boo (WarnLibWhatever *self, int, gpointer); GType warnlib_whatever_get_type (void) G_GNUC_CONST; -- cgit v1.2.1