[gnome-software] trivial: Test removing duplicates when some apps have no app ID
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] trivial: Test removing duplicates when some apps have no app ID
- Date: Mon, 16 Jan 2017 19:14:15 +0000 (UTC)
commit 301f44224493e693faed5dc9e816ca03a5ea054a
Author: Kalev Lember <klember redhat com>
Date: Mon Jan 16 20:12:26 2017 +0100
trivial: Test removing duplicates when some apps have no app ID
src/gs-self-test.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-self-test.c b/src/gs-self-test.c
index f667db3..36a9de9 100644
--- a/src/gs-self-test.c
+++ b/src/gs-self-test.c
@@ -215,6 +215,23 @@ gs_plugin_func (void)
g_assert_cmpint (gs_app_list_length (list_remove), ==, 1);
g_object_unref (list_remove);
+ /* test removing duplicates when some apps have no app ID */
+ list_remove = gs_app_list_new ();
+ app = gs_app_new (NULL);
+ gs_app_list_add (list_remove, app);
+ g_object_unref (app);
+ app = gs_app_new (NULL);
+ gs_app_list_add (list_remove, app);
+ g_object_unref (app);
+ app = gs_app_new (NULL);
+ gs_app_list_add (list_remove, app);
+ gs_app_set_id (app, "e");
+ g_object_unref (app);
+ g_assert_cmpint (gs_app_list_length (list_remove), ==, 3);
+ gs_app_list_filter_duplicates (list_remove, GS_APP_LIST_FILTER_FLAG_NONE);
+ g_assert_cmpint (gs_app_list_length (list_remove), ==, 3);
+ g_object_unref (list_remove);
+
/* remove lazy-loaded app */
list_remove = gs_app_list_new ();
app = gs_app_new (NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]