]> gitweb.factorcode.org Git - factor.git/blob - basis/images/loader/gtk/gtk-tests.factor
factor: rename [ ] [ ] unit-test -> { } [ ] unit-test using a refactoring tool!
[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