diff options
Diffstat (limited to 'tests/libpeas')
-rw-r--r-- | tests/libpeas/engine.c | 28 | ||||
-rw-r--r-- | tests/libpeas/extension-set.c | 28 | ||||
-rw-r--r-- | tests/libpeas/introspection/introspection-abstract.c | 6 | ||||
-rw-r--r-- | tests/libpeas/introspection/introspection-abstract.h | 4 | ||||
-rw-r--r-- | tests/libpeas/introspection/introspection-callable.c | 8 | ||||
-rw-r--r-- | tests/libpeas/introspection/introspection-callable.h | 16 | ||||
-rw-r--r-- | tests/libpeas/introspection/introspection-prerequisite.c | 2 | ||||
-rw-r--r-- | tests/libpeas/plugin-info.c | 6 | ||||
-rw-r--r-- | tests/libpeas/plugins/extension-c/extension-c-plugin.c | 8 | ||||
-rw-r--r-- | tests/libpeas/testing/testing-extension.c | 52 | ||||
-rw-r--r-- | tests/libpeas/testing/testing-extension.h | 9 | ||||
-rw-r--r-- | tests/libpeas/testing/testing.c | 4 | ||||
-rw-r--r-- | tests/libpeas/testing/testing.h | 4 |
13 files changed, 86 insertions, 89 deletions
diff --git a/tests/libpeas/engine.c b/tests/libpeas/engine.c index cf8a3be..3b3985f 100644 --- a/tests/libpeas/engine.c +++ b/tests/libpeas/engine.c @@ -266,8 +266,8 @@ list_index (GListModel *model, static void test_engine_plugin_list (PeasEngine *engine) { - const gchar * const *dependencies; - gint builtin_index, loadable_index, two_deps_index; + const char * const *dependencies; + int builtin_index, loadable_index, two_deps_index; PeasPluginInfo *builtin_info, *loadable_info, *two_deps_info; builtin_info = peas_engine_get_plugin_info (engine, "builtin"); @@ -296,7 +296,7 @@ test_engine_plugin_list (PeasEngine *engine) static void load_plugin_cb (PeasEngine *engine, PeasPluginInfo *info, - gint *loaded) + int *loaded) { /* PeasEngine:load is not stopped if loading fails */ if (peas_plugin_info_is_loaded (info)) @@ -306,7 +306,7 @@ load_plugin_cb (PeasEngine *engine, static void unload_plugin_cb (PeasEngine *engine, PeasPluginInfo *info, - gint *loaded) + int *loaded) { --(*loaded); } @@ -314,7 +314,7 @@ unload_plugin_cb (PeasEngine *engine, static void notify_loaded_plugins_cb (PeasEngine *engine, GParamSpec *pspec, - gchar ***loaded_plugins) + char ***loaded_plugins) { if (*loaded_plugins != NULL) g_strfreev (*loaded_plugins); @@ -326,9 +326,9 @@ static void test_engine_loaded_plugins (PeasEngine *engine) { PeasPluginInfo *info; - gint loaded = 0; - gchar **load_plugins; - gchar **loaded_plugins = NULL; + int loaded = 0; + char **load_plugins; + char **loaded_plugins = NULL; testing_util_push_log_hook ("Could not find plugin 'does-not-exist'*"); @@ -361,8 +361,8 @@ test_engine_loaded_plugins (PeasEngine *engine) g_assert (loaded_plugins != NULL); g_assert (loaded_plugins[0] == NULL); - load_plugins = g_new0 (gchar *, 1); - peas_engine_set_loaded_plugins (engine, (const gchar **) load_plugins); + load_plugins = g_new0 (char *, 1); + peas_engine_set_loaded_plugins (engine, (const char **) load_plugins); g_strfreev (load_plugins); g_assert_cmpint (loaded, ==, 0); @@ -371,9 +371,9 @@ test_engine_loaded_plugins (PeasEngine *engine) /* Load a plugin */ - load_plugins = g_new0 (gchar *, 2); + load_plugins = g_new0 (char *, 2); load_plugins[0] = g_strdup ("loadable"); - peas_engine_set_loaded_plugins (engine, (const gchar **) load_plugins); + peas_engine_set_loaded_plugins (engine, (const char **) load_plugins); g_strfreev (load_plugins); g_assert_cmpint (loaded, ==, 1); @@ -383,9 +383,9 @@ test_engine_loaded_plugins (PeasEngine *engine) /* Try to load an unavailable plugin */ - load_plugins = g_new0 (gchar *, 2); + load_plugins = g_new0 (char *, 2); load_plugins[0] = g_strdup ("unavailable"); - peas_engine_set_loaded_plugins (engine, (const gchar **) load_plugins); + peas_engine_set_loaded_plugins (engine, (const char **) load_plugins); g_strfreev (load_plugins); g_assert_cmpint (loaded, ==, 0); diff --git a/tests/libpeas/extension-set.c b/tests/libpeas/extension-set.c index 60cec72..9f3a48e 100644 --- a/tests/libpeas/extension-set.c +++ b/tests/libpeas/extension-set.c @@ -40,7 +40,7 @@ struct _TestFixture { }; /* Have dependencies before the plugin that requires them */ -static const gchar *loadable_plugins[] = { +static const char *loadable_plugins[] = { "loadable", "has-dep", "self-dep" }; @@ -48,7 +48,7 @@ static void extension_added_cb (PeasExtensionSet *extension_set, PeasPluginInfo *info, GObject *extension, - gint *active) + int *active) { ++(*active); } @@ -57,16 +57,16 @@ static void extension_removed_cb (PeasExtensionSet *extension_set, PeasPluginInfo *info, GObject *extension, - gint *active) + int *active) { --(*active); } static PeasExtensionSet * testing_extension_set_new (PeasEngine *engine, - gint *active) + int *active) { - gint i; + int i; PeasPluginInfo *info; PeasExtensionSet *extension_set; @@ -77,7 +77,7 @@ testing_extension_set_new (PeasEngine *engine, if (active == NULL) { - active = g_new (gint, 1); + active = g_new (int, 1); g_object_set_data_full (G_OBJECT (extension_set), "testing-extension-set-active", active, g_free); @@ -167,7 +167,7 @@ test_extension_set_create_valid_with_properties (PeasEngine *engine) GValue prop_value = G_VALUE_INIT; GObject *obj; GObject *obj_cmp = NULL; - const gchar *prop_names[1] = { "object" }; + const char *prop_names[1] = { "object" }; obj = g_object_new (G_TYPE_OBJECT, NULL); g_value_init (&prop_value, G_TYPE_OBJECT); @@ -227,8 +227,8 @@ test_extension_set_create_invalid_with_properties (PeasEngine *engine) { PeasExtensionSet *extension_set; GValue prop_values[2] = { G_VALUE_INIT }; - const gchar *prop_names[2] = { "object", NULL }; - const gchar *prop_names_not_exist[1] = { "aleb" }; + const char *prop_names[2] = { "object", NULL }; + const char *prop_names_not_exist[1] = { "aleb" }; guint n_elements; testing_util_push_log_hook ("*property name*should not be NULL."); @@ -281,7 +281,7 @@ test_extension_set_create_invalid_with_properties (PeasEngine *engine) static void test_extension_set_extension_added (PeasEngine *engine) { - gint active; + int active; PeasExtensionSet *extension_set; /* This will check that an extension is added @@ -301,7 +301,7 @@ test_extension_set_extension_added (PeasEngine *engine) static void test_extension_set_extension_removed (PeasEngine *engine) { - gint i, active; + int i, active; PeasPluginInfo *info; PeasExtensionSet *extension_set; @@ -352,7 +352,7 @@ test_extension_set_get_extension (PeasEngine *engine) static void test_extension_set_foreach (PeasEngine *engine) { - gint count = 0; + int count = 0; PeasExtensionSet *extension_set; extension_set = testing_extension_set_new (engine, NULL); @@ -369,10 +369,10 @@ test_extension_set_foreach (PeasEngine *engine) static void ordering_cb (PeasExtensionSet *set, PeasPluginInfo *info, - GObject *extension, + GObject *extension, GList **order) { - const gchar *order_module_name = (const gchar *) (*order)->data; + const char *order_module_name = (const char *) (*order)->data; g_assert_cmpstr (order_module_name, ==, peas_plugin_info_get_module_name (info)); diff --git a/tests/libpeas/introspection/introspection-abstract.c b/tests/libpeas/introspection/introspection-abstract.c index 73bd4cb..8eb9da9 100644 --- a/tests/libpeas/introspection/introspection-abstract.c +++ b/tests/libpeas/introspection/introspection-abstract.c @@ -26,7 +26,7 @@ #include "introspection-abstract.h" typedef struct { - gint value; + int value; } IntrospectionAbstractPrivate; G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (IntrospectionAbstract, @@ -110,7 +110,7 @@ introspection_abstract_init (IntrospectionAbstract *prereq) { } -gint +int introspection_abstract_get_value (IntrospectionAbstract *abstract) { IntrospectionAbstractPrivate *priv = GET_PRIV (abstract); @@ -122,7 +122,7 @@ introspection_abstract_get_value (IntrospectionAbstract *abstract) void introspection_abstract_set_value (IntrospectionAbstract *abstract, - gint value) + int value) { IntrospectionAbstractPrivate *priv = GET_PRIV (abstract); diff --git a/tests/libpeas/introspection/introspection-abstract.h b/tests/libpeas/introspection/introspection-abstract.h index 3f6a2f5..3f41d1f 100644 --- a/tests/libpeas/introspection/introspection-abstract.h +++ b/tests/libpeas/introspection/introspection-abstract.h @@ -57,10 +57,10 @@ GType introspection_abstract_get_type (void) G_GNUC_CONST; PEAS_TEST_EXPORT -gint introspection_abstract_get_value (IntrospectionAbstract *abstract); +int introspection_abstract_get_value (IntrospectionAbstract *abstract); PEAS_TEST_EXPORT void introspection_abstract_set_value (IntrospectionAbstract *abstract, - gint value); + int value); G_END_DECLS diff --git a/tests/libpeas/introspection/introspection-callable.c b/tests/libpeas/introspection/introspection-callable.c index 0fdd18f..c818186 100644 --- a/tests/libpeas/introspection/introspection-callable.c +++ b/tests/libpeas/introspection/introspection-callable.c @@ -38,7 +38,7 @@ introspection_callable_default_init (IntrospectionCallableInterface *iface) * * Returns: (transfer full): */ -gchar * +char * introspection_callable_call_with_return (IntrospectionCallable *callable) { IntrospectionCallableInterface *iface; @@ -96,9 +96,9 @@ introspection_callable_call_single_arg (IntrospectionCallable *callable, */ void introspection_callable_call_multi_args (IntrospectionCallable *callable, - gint in, - gint *out, - gint *inout) + int in, + int *out, + int *inout) { IntrospectionCallableInterface *iface; diff --git a/tests/libpeas/introspection/introspection-callable.h b/tests/libpeas/introspection/introspection-callable.h index 2a880c4..eb63765 100644 --- a/tests/libpeas/introspection/introspection-callable.h +++ b/tests/libpeas/introspection/introspection-callable.h @@ -45,14 +45,14 @@ struct _IntrospectionCallableInterface { GTypeInterface g_iface; /* Virtual public methods */ - gchar *(*call_with_return) (IntrospectionCallable *callable); + char *(*call_with_return) (IntrospectionCallable *callable); void (*call_no_args) (IntrospectionCallable *callable); void (*call_single_arg) (IntrospectionCallable *callable, gboolean *called); void (*call_multi_args) (IntrospectionCallable *callable, - gint in, - gint *out, - gint *inout); + int in, + int *out, + int *inout); /* libpeas must have an invoker to implement an interface's vfunc */ void (*no_invoker_) (IntrospectionCallable *callable); @@ -65,7 +65,7 @@ PEAS_TEST_EXPORT GType introspection_callable_get_type (void) G_GNUC_CONST; PEAS_TEST_EXPORT -gchar *introspection_callable_call_with_return (IntrospectionCallable *callable); +char *introspection_callable_call_with_return (IntrospectionCallable *callable); PEAS_TEST_EXPORT @@ -77,8 +77,8 @@ void introspection_callable_call_single_arg (IntrospectionCallable *cal PEAS_TEST_EXPORT void introspection_callable_call_multi_args (IntrospectionCallable *callable, - gint in, - gint *out, - gint *inout); + int in, + int *out, + int *inout); G_END_DECLS diff --git a/tests/libpeas/introspection/introspection-prerequisite.c b/tests/libpeas/introspection/introspection-prerequisite.c index 1e3ef57..50925bf 100644 --- a/tests/libpeas/introspection/introspection-prerequisite.c +++ b/tests/libpeas/introspection/introspection-prerequisite.c @@ -26,7 +26,7 @@ #include "introspection-prerequisite.h" typedef struct { - gint value; + int value; } IntrospectionPrerequisitePrivate; G_DEFINE_TYPE_WITH_PRIVATE (IntrospectionPrerequisite, diff --git a/tests/libpeas/plugin-info.c b/tests/libpeas/plugin-info.c index 8253811..98f124d 100644 --- a/tests/libpeas/plugin-info.c +++ b/tests/libpeas/plugin-info.c @@ -62,7 +62,7 @@ test_plugin_info_verify_full_info (PeasEngine *engine) { PeasPluginInfo *info; GError *error = NULL; - const gchar * const *authors; + const char * const *authors; info = peas_engine_get_plugin_info (engine, "full-info"); @@ -112,7 +112,7 @@ test_plugin_info_verify_min_info (PeasEngine *engine) { PeasPluginInfo *info; GError *error = NULL; - const gchar * const *authors; + const char * const *authors; info = peas_engine_get_plugin_info (engine, "min-info"); @@ -173,7 +173,7 @@ static void test_plugin_info_os_dependant_help (PeasEngine *engine) { PeasPluginInfo *info; - const gchar *help; + const char *help; info = peas_engine_get_plugin_info (engine, "os-dependant-help"); diff --git a/tests/libpeas/plugins/extension-c/extension-c-plugin.c b/tests/libpeas/plugins/extension-c/extension-c-plugin.c index 758c3de..eba036d 100644 --- a/tests/libpeas/plugins/extension-c/extension-c-plugin.c +++ b/tests/libpeas/plugins/extension-c/extension-c-plugin.c @@ -88,7 +88,7 @@ testing_extension_c_plugin_call_no_args (IntrospectionCallable *callable) { } -static gchar * +static char * testing_extension_c_plugin_call_with_return (IntrospectionCallable *callable) { return g_strdup ("Hello, World!"); @@ -103,9 +103,9 @@ testing_extension_c_plugin_call_single_arg (IntrospectionCallable *callable, static void testing_extension_c_plugin_call_multi_args (IntrospectionCallable *callable, - gint in, - gint *out, - gint *inout) + int in, + int *out, + int *inout) { *out = *inout; *inout = in; diff --git a/tests/libpeas/testing/testing-extension.c b/tests/libpeas/testing/testing-extension.c index d4790d5..dcf4d52 100644 --- a/tests/libpeas/testing/testing-extension.c +++ b/tests/libpeas/testing/testing-extension.c @@ -47,8 +47,8 @@ struct _TestFixture { PeasPluginInfo *info; }; -static gchar *loader = NULL; -static gchar *extension_plugin = NULL; +static char *loader = NULL; +static char *extension_plugin = NULL; static void test_setup (TestFixture *fixture, @@ -82,7 +82,7 @@ static void test_extension_garbage_collect (PeasEngine *engine, PeasPluginInfo *info) { - gchar **loaded_plugins; + char **loaded_plugins; peas_engine_garbage_collect (engine); @@ -169,7 +169,7 @@ test_extension_create_valid_with_properties (PeasEngine *engine, GObject *extension; IntrospectionAbstract *abstract; GValue prop_values[1] = { G_VALUE_INIT }; - const gchar *prop_names[1] = { "abstract-property" }; + const char *prop_names[1] = { "abstract-property" }; g_assert (peas_engine_load_plugin (engine, info)); @@ -236,9 +236,9 @@ test_extension_create_invalid_with_properties (PeasEngine *engine, { GObject *extension; GValue prop_values[1] = { G_VALUE_INIT }; - const gchar *prop_names[1] = { NULL }; + const char *prop_names[1] = { NULL }; GValue prop_values2[1] = { G_VALUE_INIT }; - const gchar *prop_names2[1] = { "does-not-exist" }; + const char *prop_names2[1] = { "does-not-exist" }; g_value_init (&prop_values[0], G_TYPE_STRING); g_value_set_string (&prop_values[0], "foo"); @@ -301,7 +301,7 @@ test_extension_create_with_prerequisite (PeasEngine *engine, PeasPluginInfo *info) { GObject *extension; - gint prerequisite_property = -1; + int prerequisite_property = -1; extension = peas_engine_create_extension (engine, info, INTROSPECTION_TYPE_HAS_PREREQUISITE, @@ -323,7 +323,7 @@ static void test_extension_reload (PeasEngine *engine, PeasPluginInfo *info) { - gint i; + int i; for (i = 0; i < 3; ++i) { @@ -398,11 +398,11 @@ test_extension_abstract (PeasEngine *engine, g_object_unref (extension); } -static gint +static int run_in_multiple_threads (GFunc func, gpointer user_data) { - gint i, n_threads; + int i, n_threads; GThreadPool *pool; GError *error = NULL; @@ -428,7 +428,7 @@ static void multiple_threads_loaders_in_thread (guint nth_thread, gboolean use_nonglobal_loaders) { - gint i, j; + int i, j; PeasEngine *engine; PeasPluginInfo *info; GObject *extension; @@ -479,7 +479,7 @@ static void multiple_threads_callbacks_in_thread (guint nth_thread, IntrospectionActivatable *activatable) { - gint i; + int i; for (i = 0; i < 100; ++i) introspection_activatable_update_state (activatable); @@ -490,7 +490,7 @@ test_extension_multiple_threads_callbacks (PeasEngine *engine, PeasPluginInfo *info) { GObject *extension; - gint n_threads, update_count; + int n_threads, update_count; extension = peas_engine_create_extension (engine, info, INTROSPECTION_TYPE_ACTIVATABLE, @@ -507,26 +507,26 @@ test_extension_multiple_threads_callbacks (PeasEngine *engine, #define _EXTENSION_TEST(loader, path, ftest) \ G_STMT_START { \ - gchar *full_path = g_strdup_printf (EXTENSION_TEST_NAME (%s, "%s"), \ - loader, path); \ -\ - g_test_add (full_path, TestFixture, \ - (gpointer) test_extension_##ftest, \ - test_setup, test_runner, test_teardown); \ -\ - g_free (full_path); \ + char *full_path = g_strdup_printf (EXTENSION_TEST_NAME (%s, "%s"), \ + loader, path); \ + \ + g_test_add (full_path, TestFixture, \ + (gpointer) test_extension_##ftest, \ + test_setup, test_runner, test_teardown); \ + \ + g_free (full_path); \ } G_STMT_END void -testing_extension_basic (const gchar *loader_) +testing_extension_basic (const char *loader_) { - gint i, j; - gchar *loader_name; + int i, j; + char *loader_name; PeasEngine *engine; loader = g_strdup (loader_); - loader_name = g_new0 (gchar, strlen (loader) + 1); + loader_name = g_new0 (char, strlen (loader) + 1); for (i = 0, j = 0; loader[i] != '\0'; ++i) { if (loader[i] != '.') @@ -581,7 +581,7 @@ testing_extension_basic (const gchar *loader_) } void -testing_extension_add (const gchar *path, +testing_extension_add (const char *path, GTestDataFunc func) { g_test_add (path, TestFixture, (gpointer) func, diff --git a/tests/libpeas/testing/testing-extension.h b/tests/libpeas/testing/testing-extension.h index ef9ce30..ded89e1 100644 --- a/tests/libpeas/testing/testing-extension.h +++ b/tests/libpeas/testing/testing-extension.h @@ -30,15 +30,12 @@ G_BEGIN_DECLS PEAS_TEST_EXPORT -void testing_extension_basic (const gchar *loader); - +void testing_extension_basic (const char *loader); PEAS_TEST_EXPORT -void testing_extension_add (const gchar *path, +void testing_extension_add (const char *path, GTestDataFunc func); - - PEAS_TEST_EXPORT -int testing_extension_run_tests (void); +int testing_extension_run_tests (void); #define testing_extension_all(loader) \ testing_extension_basic (loader); diff --git a/tests/libpeas/testing/testing.c b/tests/libpeas/testing/testing.c index 083b8a2..3bfa99e 100644 --- a/tests/libpeas/testing/testing.c +++ b/tests/libpeas/testing/testing.c @@ -32,8 +32,8 @@ #include "testing.h" void -testing_init (gint *argc, - gchar ***argv) +testing_init (int *argc, + char ***argv) { GError *error = NULL; static gboolean initialized = FALSE; diff --git a/tests/libpeas/testing/testing.h b/tests/libpeas/testing/testing.h index 73a5b95..ea05b60 100644 --- a/tests/libpeas/testing/testing.h +++ b/tests/libpeas/testing/testing.h @@ -29,8 +29,8 @@ G_BEGIN_DECLS PEAS_TEST_EXPORT -void testing_init (gint *argc, - gchar ***argv); +void testing_init (int *argc, + char ***argv); PEAS_TEST_EXPORT PeasEngine *testing_engine_new_full (gboolean nonglobal_loaders); |