Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(613)

Unified Diff: tests/PointTest.cpp

Issue 785933003: change SkPoint::setLength to set itself to (0,0) if it starting length is degenerate (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkPoint.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PointTest.cpp
diff --git a/tests/PointTest.cpp b/tests/PointTest.cpp
index fed443a02e7d050fc0b0b1d752c4abe8ed58875e..08ce7208eb007d25ce93696aa29cd75cb5b7cc37 100644
--- a/tests/PointTest.cpp
+++ b/tests/PointTest.cpp
@@ -108,13 +108,13 @@ static void test_overflow(skiatest::Reporter* reporter) {
// report failure if we try to normalize them.
static void test_underflow(skiatest::Reporter* reporter) {
SkPoint pt = { 1.0e-37f, 1.0e-37f };
- SkPoint copy = pt;
+ const SkPoint empty = { 0, 0 };
REPORTER_ASSERT(reporter, 0 == SkPoint::Normalize(&pt));
- REPORTER_ASSERT(reporter, pt == copy); // pt is unchanged
+ REPORTER_ASSERT(reporter, pt == empty);
REPORTER_ASSERT(reporter, !pt.setLength(SK_Scalar1));
- REPORTER_ASSERT(reporter, pt == copy); // pt is unchanged
+ REPORTER_ASSERT(reporter, pt == empty);
}
DEF_TEST(Point, reporter) {
« no previous file with comments | « src/core/SkPoint.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698