diff options
| author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-11-14 19:29:14 +0000 |
|---|---|---|
| committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-11-14 19:29:14 +0000 |
| commit | ffdb018dae05f1688c6c036299f8c8a0f28342e5 (patch) | |
| tree | fde42b587c37f7a0deb352fa0dfd0c7d7c4d8377 /tests/PathTest.cpp | |
| parent | eac52bdb6c275a50832c4bba3a439d7fbf7f7807 (diff) | |
add test for bounds (disabled as it fails)
git-svn-id: http://skia.googlecode.com/svn/trunk@2677 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests/PathTest.cpp')
| -rw-r--r-- | tests/PathTest.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp index e2ecdcb4b7..b8693290df 100644 --- a/tests/PathTest.cpp +++ b/tests/PathTest.cpp @@ -13,6 +13,31 @@ #include "SkSize.h" #include "SkWriter32.h" +static void add_rect(SkPath* path, const SkRect& r) { + path->moveTo(r.fLeft, r.fTop); + path->lineTo(r.fRight, r.fTop); + path->lineTo(r.fRight, r.fBottom); + path->lineTo(r.fLeft, r.fBottom); + path->close(); +} + +static void test_bounds(skiatest::Reporter* reporter) { + static const SkRect rects[] = { + { 10, 160, 610, 160 }, + { 610, 160, 610, 199 }, + { 10, 198, 610, 199 }, + { 10, 160, 10, 199 }, + }; + + SkPath path0, path1; + for (size_t i = 0; i < SK_ARRAY_COUNT(rects); ++i) { + path0.addRect(rects[i]); + add_rect(&path1, rects[i]); + } + + REPORTER_ASSERT(reporter, path0.getBounds() == path1.getBounds()); +} + static void stroke_cubic(const SkPoint pts[4]) { SkPath path; path.moveTo(pts[0]); @@ -592,6 +617,7 @@ void TestPath(skiatest::Reporter* reporter) { test_flattening(reporter); test_transform(reporter); +// test_bounds(reporter); } #include "TestClassDef.h" |
