ocarina/tests/gui/playlist.c

40 lines
987 B
C

/*
* Copyright 2016 (c) Anna Schumaker.
*/
#define TEST_NEED_AUDIO
#include <gui/builder.h>
#include <gui/playlist.h>
#include <tests/gui.h>
#include <tests/test.h>
static void test_playlist_sidebar()
{
GtkTreeSelection *selection;
GtkTreeView *treeview;
GtkTreeModel *model;
GtkTreePath *path;
GtkTreeIter iter;
int argc = 0;
gtk_init(&argc, NULL);
gui_builder_init("share/ocarina/ocarina6.glade");
gui_playlist_init();
treeview = GTK_TREE_VIEW(gui_builder_widget("o_playlist_view"));
selection = gtk_tree_view_get_selection(treeview);
model = GTK_TREE_MODEL(gui_builder_object("o_playlist_store"));
test_equal(gtk_tree_model_get_iter_first(model, &iter), true);
path = gtk_tree_model_get_path(model, &iter);
gtk_tree_view_set_cursor(treeview, path, NULL, false);
gtk_tree_path_free(path);
test_equal(gtk_tree_selection_count_selected_rows(selection), 0);
gui_builder_deinit();
}
DECLARE_UNIT_TESTS(
UNIT_TEST("Playlist Sidebar", test_playlist_sidebar),
);