[libpeas] Test peas_extension_call() before calling interface vfunc
- From: Steve Frécinaux <sfre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libpeas] Test peas_extension_call() before calling interface vfunc
- Date: Tue, 25 Jan 2011 19:15:28 +0000 (UTC)
commit 343b8efc7566473c53a6311cc377821beabb4587
Author: Garrett Regier <alias301 gmail com>
Date: Tue Jan 25 04:11:29 2011 -0800
Test peas_extension_call() before calling interface vfunc
tests/libpeas/testing/testing-extension.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/tests/libpeas/testing/testing-extension.c b/tests/libpeas/testing/testing-extension.c
index 48a779f..3982a1d 100644
--- a/tests/libpeas/testing/testing-extension.c
+++ b/tests/libpeas/testing/testing-extension.c
@@ -25,6 +25,7 @@
#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
#include <glib.h>
#include <libpeas/peas.h>
@@ -176,6 +177,7 @@ testing_extension_call_no_args_ (PeasEngine *engine)
callable = INTROSPECTION_CALLABLE (extension);
+ g_assert (peas_extension_call (extension, "call_no_args"));
introspection_callable_call_no_args (callable);
g_object_unref (extension);
@@ -199,6 +201,11 @@ testing_extension_call_with_return_ (PeasEngine *engine)
callable = INTROSPECTION_CALLABLE (extension);
+ g_assert (peas_extension_call (extension, "call_with_return", &return_val));
+ g_assert_cmpstr (return_val, ==, "Hello, World!");
+
+ return_val = NULL;
+
return_val = introspection_callable_call_with_return (callable);
g_assert_cmpstr (return_val, ==, "Hello, World!");
@@ -223,6 +230,11 @@ testing_extension_call_single_arg_ (PeasEngine *engine)
callable = INTROSPECTION_CALLABLE (extension);
+ g_assert (peas_extension_call (extension, "call_single_arg", &called));
+ g_assert (called);
+
+ called = FALSE;
+
introspection_callable_call_single_arg (callable, &called);
g_assert (called);
@@ -247,6 +259,12 @@ testing_extension_call_multi_args_ (PeasEngine *engine)
callable = INTROSPECTION_CALLABLE (extension);
+ g_assert (peas_extension_call (extension, "call_multi_args",
+ ¶ms[0], ¶ms[1], ¶ms[2]));
+ g_assert (params[0] && params[1] && params[2]);
+
+ memset (params, FALSE, G_N_ELEMENTS (params));
+
introspection_callable_call_multi_args (callable, ¶ms[0],
¶ms[1], ¶ms[2]);
g_assert (params[0] && params[1] && params[2]);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]