]> git.saurik.com Git - wxWidgets.git/blobdiff - tests/geometry/region.cpp
Improve drawing of the tree item buttons in the generic renderer.
[wxWidgets.git] / tests / geometry / region.cpp
index f6ae795e17dfea868f843470b59058f1d9176e21..edceb66eeab12177ea093de71f3075d5e50962b8 100644 (file)
@@ -3,7 +3,6 @@
 // Purpose:     wxRegion unit test
 // Author:      Vadim Zeitlin
 // Created:     2011-10-12
-// RCS-ID:      $Id$
 // Copyright:   (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -67,9 +66,11 @@ public:
 private:
     CPPUNIT_TEST_SUITE( RegionTestCase );
         CPPUNIT_TEST( Validity );
+        CPPUNIT_TEST( Intersect );
     CPPUNIT_TEST_SUITE_END();
 
     void Validity();
+    void Intersect();
 
     wxDECLARE_NO_COPY_CLASS(RegionTestCase);
 };
@@ -112,3 +113,27 @@ void RegionTestCase::Validity()
         r
     );
 }
+
+void RegionTestCase::Intersect()
+{
+    const wxPoint points1[] = {
+        wxPoint(310, 392),
+        wxPoint(270, 392),
+        wxPoint(270, 421),
+        wxPoint(310, 421)
+    };
+
+    wxRegion region1(WXSIZEOF(points1), points1);
+
+    const wxPoint points2[] = {
+        wxPoint(54, 104),
+        wxPoint(85,  82),
+        wxPoint(68,  58),
+        wxPoint(37,  80)
+    };
+
+    wxRegion region2(4,points2);
+
+    CPPUNIT_ASSERT( region1.Intersect(region2) );
+    CPPUNIT_ASSERT( region1.IsEmpty() );
+}