Skip to content

Commit

Permalink
test: support gdk-pixbuf 2.31.0 or later
Browse files Browse the repository at this point in the history
gdk-pixbuf 2.31.0 introduces pixel-bytes property.

GitHub: fix #19

Reported by mtasaka. Thanks!!!
  • Loading branch information
kou committed Jan 15, 2015
1 parent 4827a6b commit 1c1c3e6
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion test/gdkcutter-pixbuf/test-gdkcut-pixbuf.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* Copyright (C) 2009-2011 Kouhei Sutou <[email protected]>
* Copyright (C) 2009-2015 Kouhei Sutou <[email protected]>
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
Expand All @@ -23,6 +23,11 @@
#include <gdkcutter-pixbuf/gdkcut-pixbuf.h>
#include "../lib/cuttest-utils.h"

#if (GDK_PIXBUF_MAJOR > 2 || \
(GDK_PIXBUF_MAJOR == 2 && GDK_PIXBUF_MINOR >= 31))
# define HAVE_PIXEL_BYTES
#endif

void test_equal_property(void);
void test_equal_content(void);
void test_equal_content_threshold(void);
Expand Down Expand Up @@ -136,6 +141,10 @@ test_inspect (void)
"height=<100>, "
"rowstride=<400>, "
"pixels=<((gpointer) %p)>"
#ifdef HAVE_PIXEL_BYTES
", "
"pixel-bytes=<NULL>"
#endif
">",
pixbuf1,
gdk_pixbuf_get_pixels(pixbuf1));
Expand All @@ -152,6 +161,10 @@ test_inspect (void)
"height=<50>, "
"rowstride=<152>, "
"pixels=<((gpointer) %p)>"
#ifdef HAVE_PIXEL_BYTES
", "
"pixel-bytes=<NULL>"
#endif
">",
pixbuf2,
gdk_pixbuf_get_pixels(pixbuf2));
Expand Down

0 comments on commit 1c1c3e6

Please sign in to comment.