2021-03-26 01:22:23 +00:00
|
|
|
#include <gdk-pixbuf/gdk-pixbuf.h>
|
|
|
|
|
2021-03-28 00:44:18 +00:00
|
|
|
static void
|
|
|
|
test_format (gconstpointer d)
|
2021-03-26 01:22:23 +00:00
|
|
|
{
|
2021-03-28 00:44:18 +00:00
|
|
|
const char *f = d;
|
2021-03-26 01:22:23 +00:00
|
|
|
GSList *formats;
|
2021-03-28 00:44:18 +00:00
|
|
|
gboolean found;
|
2021-03-26 01:22:23 +00:00
|
|
|
|
2021-03-28 00:44:18 +00:00
|
|
|
found = FALSE;
|
2021-03-26 01:22:23 +00:00
|
|
|
|
|
|
|
formats = gdk_pixbuf_get_formats ();
|
|
|
|
|
2021-03-28 00:44:18 +00:00
|
|
|
for (GSList *l = formats; l && !found; l = l->next)
|
2021-03-26 01:22:23 +00:00
|
|
|
{
|
|
|
|
GdkPixbufFormat *format = l->data;
|
2021-03-27 23:56:36 +00:00
|
|
|
char *name;
|
2021-03-26 01:22:23 +00:00
|
|
|
|
|
|
|
name = gdk_pixbuf_format_get_name (format);
|
|
|
|
|
2021-03-28 00:44:18 +00:00
|
|
|
if (strcmp (name, f) == 0)
|
|
|
|
found = TRUE;
|
2021-03-27 23:56:36 +00:00
|
|
|
|
|
|
|
g_free (name);
|
2021-03-26 01:22:23 +00:00
|
|
|
}
|
|
|
|
|
2021-03-28 00:44:18 +00:00
|
|
|
g_slist_free (formats);
|
|
|
|
|
|
|
|
g_assert_true (found);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
main (int argc, char *argv[])
|
|
|
|
{
|
2021-04-13 01:22:04 +00:00
|
|
|
(g_test_init) (&argc, &argv, NULL);
|
2021-03-28 00:44:18 +00:00
|
|
|
|
|
|
|
g_test_add_data_func ("/pixbuf/format/png", "png", test_format);
|
|
|
|
g_test_add_data_func ("/pixbuf/format/jpeg", "jpeg", test_format);
|
2021-03-26 01:22:23 +00:00
|
|
|
|
2021-03-28 00:44:18 +00:00
|
|
|
return g_test_run ();
|
2021-03-26 01:22:23 +00:00
|
|
|
}
|