gui/treeview: Add a test for the row-activated signal

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
Anna Schumaker 2016-09-03 10:19:34 -04:00
parent 7fbef057bf
commit 155b9c3ee6
1 changed files with 17 additions and 0 deletions

View File

@ -74,6 +74,22 @@ void test_treeview_init()
gtk_tree_path_free(path);
}
void test_treeview_select()
{
GtkTreePath *path;
gui_treeview_set_playlist(playlist_get(PL_SYSTEM, "Collection"));
g_assert(gui_model_get_playlist() ==
playlist_get(PL_SYSTEM, "Collection"));
g_assert_cmpuint(audio_cur_track()->tr_track, !=, 2);
path = gui_filter_path_from_index(1);
g_assert_nonnull(path);
gtk_tree_view_row_activated(gui_treeview(), path, NULL);
g_assert_cmpuint(audio_cur_track()->tr_track, ==, 2);
gtk_tree_path_free(path);
}
void test_treeview_sort()
{
GtkTreeViewColumn *col;
@ -209,6 +225,7 @@ int main(int argc, char **argv)
g_test_init(&argc, &argv, NULL);
g_test_add_func("/Gui/Treeview/Init", test_treeview_init);
g_test_add_func("/Gui/Treeview/Select", test_treeview_select);
g_test_add_func("/Gui/Treeview/Sort", test_treeview_sort);
g_test_add_func("/Gui/Treeview/Columns", test_treeview_columns);
ret = g_test_run();