[libpeas] Add a test for peas_extension_set_foreach()



commit d431344374b98390ca5b0d772f5ce2ba24a77036
Author: Garrett Regier <garrettregier gmail com>
Date:   Sun Aug 28 00:12:41 2011 -0700

    Add a test for peas_extension_set_foreach()

 tests/libpeas/extension-set.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/tests/libpeas/extension-set.c b/tests/libpeas/extension-set.c
index 6106bd0..0dd9d06 100644
--- a/tests/libpeas/extension-set.c
+++ b/tests/libpeas/extension-set.c
@@ -264,6 +264,28 @@ test_extension_set_call_invalid (PeasEngine *engine)
   g_object_unref (extension_set);
 }
 
+static void
+test_extension_set_foreach (PeasEngine *engine)
+{
+  PeasExtensionSet *extension_set;
+  gint active;
+
+  test_extension_set_activate (engine);
+
+  extension_set = peas_extension_set_new (engine,
+                                          PEAS_TYPE_ACTIVATABLE,
+                                          "object", NULL,
+                                          NULL);
+
+  peas_extension_set_foreach (extension_set,
+                              (PeasExtensionSetForeachFunc) extension_added_cb,
+                              &active);
+
+  g_assert_cmpint (active, ==, G_N_ELEMENTS (loadable_plugins));
+
+  g_object_unref (extension_set);
+}
+
 int
 main (int    argc,
       char **argv)
@@ -288,6 +310,8 @@ main (int    argc,
   TEST ("call-valid", call_valid);
   TEST ("call-invalid", call_invalid);
 
+  TEST ("foreach", foreach);
+
 #undef TEST
 
   return testing_run_tests ();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]