]>
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
6 // Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
7 // Licence: wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_TESTS_TESTIMAGE_H_
11 #define _WX_TESTS_TESTIMAGE_H_
18 struct assertion_traits
<wxImage
>
20 static bool equal(const wxImage
& i1
, const wxImage
& i2
)
22 if ( i1
.GetWidth() != i2
.GetWidth() )
25 if ( i1
.GetHeight() != i2
.GetHeight() )
28 return memcmp(i1
.GetData(), i2
.GetData(),
29 i1
.GetWidth()*i1
.GetHeight()*3) == 0;
32 static std::string
toString(const wxImage
& image
)
34 return wxString::Format("image of size %d*%d with%s alpha",
37 image
.HasAlpha() ? "" : "out")
44 #endif // _WX_TESTS_TESTIMAGE_H_