58 lines
1.3 KiB
C
58 lines
1.3 KiB
C
/*
|
|
* Copyright 2016 (c) Anna Schumaker.
|
|
*/
|
|
#include <core/core.h>
|
|
#include <core/idle.h>
|
|
#include <gui/artwork.h>
|
|
#include <gui/filter.h>
|
|
#include <gui/model.h>
|
|
#include <gui/playlist.h>
|
|
#include <gui/sidebar.h>
|
|
#include <gui/treeview.h>
|
|
|
|
struct core_init_data init_data = {
|
|
.playlist_ops = &playlist_ops,
|
|
};
|
|
|
|
static void test_artwork(void)
|
|
{
|
|
const gchar *name;
|
|
GtkIconSize size;
|
|
|
|
g_assert_true(GTK_IS_IMAGE(gui_artwork()));
|
|
|
|
gtk_image_get_icon_name(gui_artwork(), &name, &size);
|
|
g_assert_cmpuint(gtk_image_get_storage_type(gui_artwork()), ==,
|
|
GTK_IMAGE_ICON_NAME);
|
|
g_assert_cmpstr(name, ==, "image-missing");
|
|
g_assert_cmpuint(size, ==, GTK_ICON_SIZE_DIALOG);
|
|
g_assert_false(gtk_widget_is_sensitive(GTK_WIDGET(gui_artwork())));
|
|
}
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
int ret;
|
|
|
|
gtk_init(&argc, NULL);
|
|
core_init(&argc, NULL, &init_data);
|
|
gui_builder_init("share/ocarina/ocarina.ui");
|
|
gui_model_init();
|
|
gui_filter_init();
|
|
gui_treeview_init();
|
|
gui_sidebar_init();
|
|
gui_playlist_init();
|
|
gui_pl_library_add("tests/Music/Hyrule Symphony");
|
|
while (idle_run_task()) {}
|
|
|
|
g_test_init(&argc, &argv, NULL);
|
|
g_test_add_func("/Gui/Artwork", test_artwork);
|
|
ret = g_test_run();
|
|
|
|
core_deinit();
|
|
gui_treeview_deinit();
|
|
gui_filter_deinit();
|
|
gui_model_deinit();
|
|
gui_builder_deinit();
|
|
return ret;
|
|
}
|