[gnome-software] trivial: Add a missing vfunc name
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] trivial: Add a missing vfunc name
- Date: Wed, 28 Jun 2017 19:56:53 +0000 (UTC)
commit aaf48af12757ff975959e4ca7374adcd8da815f3
Author: Richard Hughes <richard hughsie com>
Date: Wed Jun 28 20:09:45 2017 +0100
trivial: Add a missing vfunc name
I have no idea how this was missed; add a unit test so it can't happen again.
lib/gs-plugin.c | 2 ++
lib/gs-self-test.c | 11 ++++++++---
2 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/lib/gs-plugin.c b/lib/gs-plugin.c
index 6995ec1..6c098f1 100644
--- a/lib/gs-plugin.c
+++ b/lib/gs-plugin.c
@@ -1722,6 +1722,8 @@ gs_plugin_action_to_function_name (GsPluginAction action)
return "gs_plugin_add_distro_upgrades";
if (action == GS_PLUGIN_ACTION_GET_SOURCES)
return "gs_plugin_add_sources";
+ if (action == GS_PLUGIN_ACTION_GET_UNVOTED_REVIEWS)
+ return "gs_plugin_add_unvoted_reviews";
if (action == GS_PLUGIN_ACTION_GET_INSTALLED)
return "gs_plugin_add_installed";
if (action == GS_PLUGIN_ACTION_GET_FEATURED)
diff --git a/lib/gs-self-test.c b/lib/gs-self-test.c
index 2206d70..42ebfbe 100644
--- a/lib/gs-self-test.c
+++ b/lib/gs-self-test.c
@@ -209,14 +209,19 @@ gs_plugin_func (void)
GsAppList *list_dup;
GsAppList *list_remove;
GsApp *app;
- guint i;
/* check enums converted */
- for (i = 0; i < GS_PLUGIN_ACTION_LAST; i++) {
+ for (guint i = 0; i < GS_PLUGIN_ACTION_LAST; i++) {
const gchar *tmp = gs_plugin_action_to_string (i);
- g_assert (tmp != NULL);
+ if (tmp == NULL)
+ g_critical ("failed to convert %u", i);
g_assert_cmpint (gs_plugin_action_from_string (tmp), ==, i);
}
+ for (guint i = 1; i < GS_PLUGIN_ACTION_LAST; i++) {
+ const gchar *tmp = gs_plugin_action_to_function_name (i);
+ if (tmp == NULL)
+ g_critical ("failed to convert %u", i);
+ }
/* add a couple of duplicate IDs */
app = gs_app_new ("a");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]