]>
git.saurik.com Git - wxWidgets.git/blob - tests/geometry/size.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: tests/geometry/size.cpp
3 // Purpose: wxSize unit test
4 // Author: Wlodzimierz ABX Skiba
6 // Copyright: (c) 2004 wxWindows
7 ///////////////////////////////////////////////////////////////////////////////
9 // ----------------------------------------------------------------------------
11 // ----------------------------------------------------------------------------
20 #include "wx/gdicmn.h"
23 // ----------------------------------------------------------------------------
25 // ----------------------------------------------------------------------------
27 class SizeTestCase
: public CppUnit::TestCase
33 CPPUNIT_TEST_SUITE( SizeTestCase
);
34 CPPUNIT_TEST( Operators
);
35 CPPUNIT_TEST_SUITE_END();
39 DECLARE_NO_COPY_CLASS(SizeTestCase
)
42 // register in the unnamed registry so that these tests are run by default
43 CPPUNIT_TEST_SUITE_REGISTRATION( SizeTestCase
);
45 // also include in its own registry so that these tests can be run alone
46 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( SizeTestCase
, "SizeTestCase" );
48 void SizeTestCase::Operators()
55 CPPUNIT_ASSERT( s3
.GetWidth()==4 && s3
.GetHeight()==6 );
57 CPPUNIT_ASSERT( s3
.GetWidth()==2 && s3
.GetHeight()==2 );
59 CPPUNIT_ASSERT( s3
.GetWidth()==2 && s3
.GetHeight()==4 );
61 CPPUNIT_ASSERT( s3
.GetWidth()==2 && s3
.GetHeight()==4 );
63 CPPUNIT_ASSERT( s3
.GetWidth()==1 && s3
.GetHeight()==2 );
66 CPPUNIT_ASSERT( s3
!= s1
);
68 CPPUNIT_ASSERT( s3
== s1
);
70 CPPUNIT_ASSERT( s3
.GetWidth()==4 && s3
.GetHeight()==6 );
72 CPPUNIT_ASSERT( s3
== s1
);
74 CPPUNIT_ASSERT( s3
.GetWidth()==2 && s3
.GetHeight()==4 );
76 CPPUNIT_ASSERT( s3
== s1
);