]> gitweb.factorcode.org Git - factor.git/blob - basis/images/loader/gtk/gtk-tests.factor
799c14faebe259e07aca63119ff01b0cd2d61dd6
[factor.git] / basis / images / loader / gtk / gtk-tests.factor
1 USING: accessors arrays continuations gdk.pixbuf.ffi glib.ffi gobject.ffi
2 images.loader images.loader.gtk images.loader.gtk.private io
3 io.encodings.binary io.files kernel tools.test ;
4 IN: images.loader.gtk.tests
5
6 : open-png-image ( -- image )
7     "vocab:images/testing/png/basi0g01.png" load-image ;
8
9 [ t ] [
10     open-png-image [ dim>> ] [
11         image>GdkPixbuf &g_object_unref
12         [ gdk_pixbuf_get_width ] [ gdk_pixbuf_get_height ] bi 2array
13     ] bi =
14 ] unit-test
15
16 [ t ] [
17     [
18         open-png-image image>GdkPixbuf &g_object_unref
19         "frob" GdkPixbuf>byte-array
20     ] [ g-error? ] recover
21 ] unit-test