mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-04 02:06:18 +01:00
Fix compiler warning about uninitialized variable in desktop-app-info test
It would always be initialized but initialize it to NULL to silence the compiler, and also check that it is not NULL anymore when we expect it to contain a valid value. ../gio/tests/desktop-app-info.c: In function ‘test_fallback’: ../gio/tests/desktop-app-info.c:191:18: warning: ‘app’ may be used uninitialized in this function [-Wmaybe-uninitialized] g_assert_true (g_app_info_equal (info1, app)); ^~~~~~~~~~~~~~~~
This commit is contained in:
parent
b4a5157f95
commit
bd75dffc00
@ -155,7 +155,7 @@ test_default (void)
|
|||||||
static void
|
static void
|
||||||
test_fallback (void)
|
test_fallback (void)
|
||||||
{
|
{
|
||||||
GAppInfo *info1, *info2, *app;
|
GAppInfo *info1, *info2, *app = NULL;
|
||||||
GList *apps, *recomm, *fallback, *list, *l, *m;
|
GList *apps, *recomm, *fallback, *list, *l, *m;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
gint old_length;
|
gint old_length;
|
||||||
@ -188,6 +188,7 @@ test_fallback (void)
|
|||||||
if (g_app_info_equal (info1, app))
|
if (g_app_info_equal (info1, app))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
g_assert_nonnull (app);
|
||||||
g_assert_true (g_app_info_equal (info1, app));
|
g_assert_true (g_app_info_equal (info1, app));
|
||||||
|
|
||||||
/* and that Test2 is among the fallback apps */
|
/* and that Test2 is among the fallback apps */
|
||||||
|
Loading…
Reference in New Issue
Block a user