diff options
author | Mike Reed <reed@google.com> | 2018-04-11 14:30:17 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-04-11 19:40:57 +0000 |
commit | 1f275851ecd6981aebf2349b1c21a52cd106bd8f (patch) | |
tree | 73e488622f149d7fdbe1244329363a8646fb27a0 /tests/InfRectTest.cpp | |
parent | f441cfc5dfec7afe8f2d67785bb88b696f393f4c (diff) |
remove unused/dumb methods from SkRect
Bug: skia:
Change-Id: I407dc94256a347c7a9343b75a5af43c4294891d3
Reviewed-on: https://skia-review.googlesource.com/119360
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Yuqian Li <liyuqian@google.com>
Diffstat (limited to 'tests/InfRectTest.cpp')
-rw-r--r-- | tests/InfRectTest.cpp | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/tests/InfRectTest.cpp b/tests/InfRectTest.cpp index 3da0e5e902..966f67f8f4 100644 --- a/tests/InfRectTest.cpp +++ b/tests/InfRectTest.cpp @@ -13,39 +13,6 @@ static float make_zero() { return sk_float_sin(0); } -struct RectCenter { - SkIRect fRect; - SkIPoint fCenter; -}; - -static void test_center(skiatest::Reporter* reporter) { - static const RectCenter gData[] = { - { { 0, 0, 0, 0 }, { 0, 0 } }, - { { 0, 0, 1, 1 }, { 0, 0 } }, - { { -1, -1, 0, 0 }, { -1, -1 } }, - { { 0, 0, 10, 7 }, { 5, 3 } }, - { { 0, 0, 11, 6 }, { 5, 3 } }, - }; - for (size_t index = 0; index < SK_ARRAY_COUNT(gData); ++index) { - REPORTER_ASSERT(reporter, - gData[index].fRect.centerX() == gData[index].fCenter.x()); - REPORTER_ASSERT(reporter, - gData[index].fRect.centerY() == gData[index].fCenter.y()); - } - - SkRandom rand; - for (int i = 0; i < 10000; ++i) { - SkIRect r; - - r.set(rand.nextS() >> 2, rand.nextS() >> 2, - rand.nextS() >> 2, rand.nextS() >> 2); - int cx = r.centerX(); - int cy = r.centerY(); - REPORTER_ASSERT(reporter, ((r.left() + r.right()) >> 1) == cx); - REPORTER_ASSERT(reporter, ((r.top() + r.bottom()) >> 1) == cy); - } -} - static void check_invalid(skiatest::Reporter* reporter, SkScalar l, SkScalar t, SkScalar r, SkScalar b) { SkRect rect; @@ -74,8 +41,6 @@ DEF_TEST(InfRect, reporter) { check_invalid(reporter, small, invalid[i], big, big); check_invalid(reporter, invalid[i], small, big, big); } - - test_center(reporter); } // need tests for SkStrSearch |