]>
git.saurik.com Git - wxWidgets.git/blob - tests/testimage.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: tests/testimage.h
3 // Purpose: Unit test helpers for dealing with wxImage.
4 // Author: Vadim Zeitlin
5 // Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
6 // Licence: wxWindows licence
7 ///////////////////////////////////////////////////////////////////////////////
9 #ifndef _WX_TESTS_TESTIMAGE_H_
10 #define _WX_TESTS_TESTIMAGE_H_
17 struct assertion_traits
<wxImage
>
19 static bool equal(const wxImage
& i1
, const wxImage
& i2
)
21 if ( i1
.GetWidth() != i2
.GetWidth() )
24 if ( i1
.GetHeight() != i2
.GetHeight() )
27 return memcmp(i1
.GetData(), i2
.GetData(),
28 i1
.GetWidth()*i1
.GetHeight()*3) == 0;
31 static std::string
toString(const wxImage
& image
)
33 return wxString::Format("image of size %d*%d with%s alpha",
36 image
.HasAlpha() ? "" : "out")
43 #endif // _WX_TESTS_TESTIMAGE_H_