aboutsummaryrefslogtreecommitdiff
path: root/tests/test-loader.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-loader.c')
-rw-r--r--tests/test-loader.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/tests/test-loader.c b/tests/test-loader.c
index b567733..2140294 100644
--- a/tests/test-loader.c
+++ b/tests/test-loader.c
@@ -100,8 +100,8 @@ void destroy_cb (gpointer data, GObject * object);
void
entry_change_cb (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer data)
{
- gpointer * valuestore = (gpointer *)data;
- *valuestore = entry;
+ IndicatorObjectEntry *other_entry = data;
+ other_entry->name_hint = entry->name_hint;
return;
}
@@ -117,11 +117,16 @@ test_loader_filename_dummy_signaler (void)
IndicatorObject * object = indicator_object_new_from_file(BUILD_DIR "/.libs/libdummy-indicator-signaler.so");
g_assert(object != NULL);
- gpointer added_value = NULL, removed_value = NULL, moved_value = NULL;
+ IndicatorObjectEntry *added_entry, *moved_entry, *removed_entry;
+ IndicatorObjectEntry entries[3];
- g_signal_connect(G_OBJECT(object), INDICATOR_OBJECT_SIGNAL_ENTRY_ADDED, G_CALLBACK(entry_change_cb), &added_value);
- g_signal_connect(G_OBJECT(object), INDICATOR_OBJECT_SIGNAL_ENTRY_REMOVED, G_CALLBACK(entry_change_cb), &removed_value);
- g_signal_connect(G_OBJECT(object), INDICATOR_OBJECT_SIGNAL_ENTRY_MOVED, G_CALLBACK(entry_move_cb), &moved_value);
+ added_entry = &entries[0];
+ moved_entry = &entries[1];
+ removed_entry = &entries[2];
+
+ g_signal_connect_after(G_OBJECT(object), INDICATOR_OBJECT_SIGNAL_ENTRY_ADDED, G_CALLBACK(entry_change_cb), added_entry);
+ g_signal_connect_after(G_OBJECT(object), INDICATOR_OBJECT_SIGNAL_ENTRY_MOVED, G_CALLBACK(entry_move_cb), moved_entry);
+ g_signal_connect_after(G_OBJECT(object), INDICATOR_OBJECT_SIGNAL_ENTRY_REMOVED, G_CALLBACK(entry_change_cb), removed_entry);
GList * list = indicator_object_get_entries(object);
g_assert(list != NULL);
@@ -131,9 +136,9 @@ test_loader_filename_dummy_signaler (void)
g_main_context_iteration(NULL, TRUE);
}
- g_assert(GPOINTER_TO_UINT(added_value) == 5);
- g_assert(GPOINTER_TO_UINT(removed_value) == 5);
- g_assert(GPOINTER_TO_UINT(moved_value) == 5);
+ g_assert(g_strcmp0(added_entry->name_hint, "added") == 0);
+ g_assert(g_strcmp0(removed_entry->name_hint, "removed") == 0);
+ g_assert(g_strcmp0(moved_entry->name_hint, "moved") == 0);
g_object_unref(object);