add tests for how empty regions should behave in intersects() and contains()
Review URL: https://codereview.appspot.com/6134053

git-svn-id: http://skia.googlecode.com/svn/trunk@3795 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tests/RegionTest.cpp b/tests/RegionTest.cpp
index c1efe98..e85fca7 100644
--- a/tests/RegionTest.cpp
+++ b/tests/RegionTest.cpp
@@ -9,6 +9,23 @@
 #include "SkRegion.h"
 #include "SkRandom.h"
 
+static void test_empties(skiatest::Reporter* reporter) {
+    SkRegion valid(SkIRect::MakeWH(10, 10));
+    SkRegion empty, empty2;
+
+    REPORTER_ASSERT(reporter, empty.isEmpty());
+    REPORTER_ASSERT(reporter, !valid.isEmpty());
+
+    // test intersects
+    REPORTER_ASSERT(reporter, !empty.intersects(empty2));
+    REPORTER_ASSERT(reporter, !valid.intersects(empty));
+
+    // test contains
+    REPORTER_ASSERT(reporter, !empty.contains(empty2));
+    REPORTER_ASSERT(reporter, !valid.contains(empty));
+    REPORTER_ASSERT(reporter, !empty.contains(valid));
+}
+
 enum {
     W = 256,
     H = 256
@@ -125,6 +142,7 @@
     
     test_proc(reporter, contains_proc);
     test_proc(reporter, intersects_proc);
+    test_empties(reporter);
 }
 
 #include "TestClassDef.h"