| Index: tests/PathTest.cpp
|
| ===================================================================
|
| --- tests/PathTest.cpp (revision 9702)
|
| +++ tests/PathTest.cpp (working copy)
|
| @@ -2327,12 +2327,9 @@
|
| REPORTER_ASSERT(reporter, path.isOval(NULL));
|
| }
|
|
|
| -static void TestPath(skiatest::Reporter* reporter) {
|
| - SkTSize<SkScalar>::Make(3,4);
|
| +static void test_empty(skiatest::Reporter* reporter, const SkPath& p) {
|
| + SkPath empty;
|
|
|
| - SkPath p, p2;
|
| - SkRect bounds, bounds2;
|
| -
|
| REPORTER_ASSERT(reporter, p.isEmpty());
|
| REPORTER_ASSERT(reporter, 0 == p.countPoints());
|
| REPORTER_ASSERT(reporter, 0 == p.countVerbs());
|
| @@ -2340,9 +2337,17 @@
|
| REPORTER_ASSERT(reporter, p.isConvex());
|
| REPORTER_ASSERT(reporter, p.getFillType() == SkPath::kWinding_FillType);
|
| REPORTER_ASSERT(reporter, !p.isInverseFillType());
|
| - REPORTER_ASSERT(reporter, p == p2);
|
| - REPORTER_ASSERT(reporter, !(p != p2));
|
| + REPORTER_ASSERT(reporter, p == empty);
|
| + REPORTER_ASSERT(reporter, !(p != empty));
|
| +}
|
|
|
| +static void TestPath(skiatest::Reporter* reporter) {
|
| + SkTSize<SkScalar>::Make(3,4);
|
| +
|
| + SkPath p, empty;
|
| + SkRect bounds, bounds2;
|
| + test_empty(reporter, p);
|
| +
|
| REPORTER_ASSERT(reporter, p.getBounds().isEmpty());
|
|
|
| bounds.set(0, 0, SK_Scalar1, SK_Scalar1);
|
| @@ -2354,22 +2359,23 @@
|
| REPORTER_ASSERT(reporter, !p.isEmpty());
|
|
|
| p.reset();
|
| - REPORTER_ASSERT(reporter, 0 == p.getSegmentMasks());
|
| - REPORTER_ASSERT(reporter, p.isEmpty());
|
| + test_empty(reporter, p);
|
|
|
| p.addOval(bounds);
|
| check_convex_bounds(reporter, p, bounds);
|
| REPORTER_ASSERT(reporter, !p.isEmpty());
|
|
|
| - p.reset();
|
| + p.rewind();
|
| + test_empty(reporter, p);
|
| +
|
| p.addRect(bounds);
|
| check_convex_bounds(reporter, p, bounds);
|
| // we have only lines
|
| REPORTER_ASSERT(reporter, SkPath::kLine_SegmentMask == p.getSegmentMasks());
|
| REPORTER_ASSERT(reporter, !p.isEmpty());
|
|
|
| - REPORTER_ASSERT(reporter, p != p2);
|
| - REPORTER_ASSERT(reporter, !(p == p2));
|
| + REPORTER_ASSERT(reporter, p != empty);
|
| + REPORTER_ASSERT(reporter, !(p == empty));
|
|
|
| // do getPoints and getVerbs return the right result
|
| REPORTER_ASSERT(reporter, p.getPoints(NULL, 0) == 4);
|
|
|