+void RectTestCase::CentreIn()
+{
+ typedef wxRect R;
+
+ CPPUNIT_ASSERT_EQUAL( R(45, 45, 10, 10),
+ R(0, 0, 10, 10).CentreIn(R(0, 0, 100, 100)));
+
+ CPPUNIT_ASSERT_EQUAL( R(-5, -5, 20, 20),
+ R(0, 0, 20, 20).CentreIn(R(0, 0, 10, 10)));
+}
+
+void RectTestCase::InflateDeflate()
+{
+ // This is the rectangle from the example in the documentation of wxRect::Inflate().
+ const wxRect r1(10, 10, 20, 40);
+
+ CPPUNIT_ASSERT(r1.Inflate( 10, 10)==wxRect( 0, 0, 40, 60));
+ CPPUNIT_ASSERT(r1.Inflate( 20, 30)==wxRect(-10, -20, 60, 100));
+ CPPUNIT_ASSERT(r1.Inflate(-10, -10)==wxRect( 20, 20, 0, 20));
+ CPPUNIT_ASSERT(r1.Inflate(-15, -15)==wxRect( 20, 25, 0, 10));
+
+ CPPUNIT_ASSERT(r1.Inflate( 10, 10)==r1.Deflate(-10, -10));
+ CPPUNIT_ASSERT(r1.Inflate( 20, 30)==r1.Deflate(-20, -30));
+ CPPUNIT_ASSERT(r1.Inflate(-10, -10)==r1.Deflate( 10, 10));
+ CPPUNIT_ASSERT(r1.Inflate(-15, -15)==r1.Deflate( 15, 15));
+}
+