]>
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
7 // Copyright: (c) 2004 wxWindows
8 ///////////////////////////////////////////////////////////////////////////////
10 // ----------------------------------------------------------------------------
12 // ----------------------------------------------------------------------------
21 #include "wx/gdicmn.h"
24 // ----------------------------------------------------------------------------
26 // ----------------------------------------------------------------------------
28 class SizeTestCase
: public CppUnit::TestCase
34 CPPUNIT_TEST_SUITE( SizeTestCase
);
35 CPPUNIT_TEST( Operators
);
36 CPPUNIT_TEST_SUITE_END();
40 DECLARE_NO_COPY_CLASS(SizeTestCase
)
43 // register in the unnamed registry so that these tests are run by default
44 CPPUNIT_TEST_SUITE_REGISTRATION( SizeTestCase
);
46 // also include in it's own registry so that these tests can be run alone
47 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( SizeTestCase
, "SizeTestCase" );
49 void SizeTestCase::Operators()
56 CPPUNIT_ASSERT( s3
.GetWidth()==4 && s3
.GetHeight()==6 );
58 CPPUNIT_ASSERT( s3
.GetWidth()==2 && s3
.GetHeight()==2 );
60 CPPUNIT_ASSERT( s3
.GetWidth()==2 && s3
.GetHeight()==4 );
62 CPPUNIT_ASSERT( s3
.GetWidth()==1 && s3
.GetHeight()==2 );
65 CPPUNIT_ASSERT( s3
!= s1
);
67 CPPUNIT_ASSERT( s3
== s1
);
69 CPPUNIT_ASSERT( s3
.GetWidth()==4 && s3
.GetHeight()==6 );
71 CPPUNIT_ASSERT( s3
== s1
);
73 CPPUNIT_ASSERT( s3
.GetWidth()==2 && s3
.GetHeight()==4 );
75 CPPUNIT_ASSERT( s3
== s1
);