diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-05-06 12:45:41 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-05-06 15:01:00 +0100 |
commit | 7a54c4538058c35f77e11c3999a03a35fb53fea8 (patch) | |
tree | 52db9a2c60a0618721813ebd7329915038f8eb4a | |
parent | b3ad0c11e2b3977c655116a8c2dc28221df17bee (diff) | |
download | telepathy-mission-control-7a54c4538058c35f77e11c3999a03a35fb53fea8.tar.gz |
Add a no-op plugin to check that NULL pointers are OK
-rw-r--r-- | tests/twisted/mcp-plugin.c | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/tests/twisted/mcp-plugin.c b/tests/twisted/mcp-plugin.c index 1c31acb8..31a6ffc4 100644 --- a/tests/twisted/mcp-plugin.c +++ b/tests/twisted/mcp-plugin.c @@ -30,6 +30,35 @@ #define DEBUG g_debug +/* ------ TestNoOpPlugin -------------------------------------- */ +/* doesn't implement anything, to check that NULL pointers are OK */ + +typedef struct { + GObject parent; +} TestNoOpPlugin; + +typedef struct { + GObjectClass parent_class; +} TestNoOpPluginClass; + +GType test_no_op_plugin_get_type (void) G_GNUC_CONST; + +G_DEFINE_TYPE_WITH_CODE (TestNoOpPlugin, test_no_op_plugin, + G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (MCP_TYPE_DBUS_ACL, NULL); + G_IMPLEMENT_INTERFACE (MCP_TYPE_REQUEST_POLICY, NULL); + G_IMPLEMENT_INTERFACE (MCP_TYPE_DISPATCH_OPERATION_POLICY, NULL)) + +static void +test_no_op_plugin_init (TestNoOpPlugin *self) +{ +} + +static void +test_no_op_plugin_class_init (TestNoOpPluginClass *cls) +{ +} + /* ------ TestPermissionPlugin -------------------------------------- */ typedef struct { @@ -427,13 +456,21 @@ mcp_plugin_ref_nth_object (guint n) switch (n) { case 0: - return g_object_new (test_permission_plugin_get_type (), + return g_object_new (test_no_op_plugin_get_type (), NULL); case 1: + return g_object_new (test_permission_plugin_get_type (), + NULL); + + case 2: return g_object_new (test_rejection_plugin_get_type (), NULL); + case 3: + return g_object_new (test_no_op_plugin_get_type (), + NULL); + default: return NULL; } |