[libpeas] Add an extension set test for creating an invalid extension set
- From: Steve Frécinaux <sfre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libpeas] Add an extension set test for creating an invalid extension set
- Date: Sun, 6 Mar 2011 12:59:17 +0000 (UTC)
commit d691bc4746a8de2e8a6626ecd1f3046cc618bda3
Author: Garrett Regier <alias301 gmail com>
Date: Sat Mar 5 06:37:51 2011 -0800
Add an extension set test for creating an invalid extension set
tests/libpeas/extension-set.c | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
---
diff --git a/tests/libpeas/extension-set.c b/tests/libpeas/extension-set.c
index de1c838..c7a2618 100644
--- a/tests/libpeas/extension-set.c
+++ b/tests/libpeas/extension-set.c
@@ -110,6 +110,32 @@ test_extension_set_create_valid (PeasEngine *engine)
}
static void
+test_extension_set_create_invalid (PeasEngine *engine)
+{
+ PeasExtensionSet *extension_set;
+
+ testing_util_push_log_hook ("*assertion `G_TYPE_IS_INTERFACE (*)' failed");
+ testing_util_push_log_hook ("*type 'PeasActivatable' has no property named 'invalid-property'");
+
+ /* Invalid GType */
+ extension_set = peas_extension_set_new (engine, G_TYPE_INVALID, NULL);
+ g_assert (!PEAS_IS_EXTENSION_SET (extension_set));
+
+
+ /* GObject but not a GInterface */
+ extension_set = peas_extension_set_new (engine, G_TYPE_OBJECT, NULL);
+ g_assert (!PEAS_IS_EXTENSION_SET (extension_set));
+
+
+ /* Interface does not have an 'invalid-property' property */
+ extension_set = peas_extension_set_new (engine,
+ PEAS_TYPE_ACTIVATABLE,
+ "invalid-property", "does-not-exist",
+ NULL);
+ g_assert (!PEAS_IS_EXTENSION_SET (extension_set));
+}
+
+static void
test_extension_set_activate (PeasEngine *engine)
{
gint i, active;
@@ -252,6 +278,7 @@ main (int argc,
test_setup, test_runner, test_teardown)
TEST ("create-valid", create_valid);
+ TEST ("create-invalid", create_invalid);
TEST ("activate", activate);
TEST ("deactivate", deactivate);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]