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

Side by Side Diff: tests/PathTest.cpp

Issue 22875037: My clang now doesn't complain about !"foo". (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 4 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/ClampRangeTest.cpp ('k') | tools/flags/SkCommandLineFlags.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "Test.h" 8 #include "Test.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkPaint.h" 10 #include "SkPaint.h"
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 REPORTER_ASSERT(reporter, pts[0] == srcPts[0]); 561 REPORTER_ASSERT(reporter, pts[0] == srcPts[0]);
562 srcPts++; 562 srcPts++;
563 firstTime = false; 563 firstTime = false;
564 break; 564 break;
565 case SkPath::kLine_Verb: 565 case SkPath::kLine_Verb:
566 REPORTER_ASSERT(reporter, !firstTime); 566 REPORTER_ASSERT(reporter, !firstTime);
567 REPORTER_ASSERT(reporter, pts[1] == srcPts[0]); 567 REPORTER_ASSERT(reporter, pts[1] == srcPts[0]);
568 srcPts++; 568 srcPts++;
569 break; 569 break;
570 case SkPath::kQuad_Verb: 570 case SkPath::kQuad_Verb:
571 REPORTER_ASSERT(reporter, !"unexpected quad verb"); 571 REPORTER_ASSERT_MESSAGE(reporter, false, "unexpected quad verb") ;
572 break; 572 break;
573 case SkPath::kConic_Verb: 573 case SkPath::kConic_Verb:
574 REPORTER_ASSERT(reporter, !"unexpected conic verb"); 574 REPORTER_ASSERT_MESSAGE(reporter, false, "unexpected conic verb" );
575 break; 575 break;
576 case SkPath::kCubic_Verb: 576 case SkPath::kCubic_Verb:
577 REPORTER_ASSERT(reporter, !"unexpected cubic verb"); 577 REPORTER_ASSERT_MESSAGE(reporter, false, "unexpected cubic verb" );
578 break; 578 break;
579 case SkPath::kClose_Verb: 579 case SkPath::kClose_Verb:
580 REPORTER_ASSERT(reporter, !firstTime); 580 REPORTER_ASSERT(reporter, !firstTime);
581 REPORTER_ASSERT(reporter, !foundClose); 581 REPORTER_ASSERT(reporter, !foundClose);
582 REPORTER_ASSERT(reporter, expectClose); 582 REPORTER_ASSERT(reporter, expectClose);
583 foundClose = true; 583 foundClose = true;
584 break; 584 break;
585 case SkPath::kDone_Verb: 585 case SkPath::kDone_Verb:
586 goto DONE; 586 goto DONE;
587 } 587 }
(...skipping 1522 matching lines...) Expand 10 before | Expand all | Expand 10 after
2110 expectedPts[numPoints + 2]); 2110 expectedPts[numPoints + 2]);
2111 numPoints += 3; 2111 numPoints += 3;
2112 lastWasClose = false; 2112 lastWasClose = false;
2113 break; 2113 break;
2114 case SkPath::kClose_Verb: 2114 case SkPath::kClose_Verb:
2115 p.close(); 2115 p.close();
2116 haveMoveTo = false; 2116 haveMoveTo = false;
2117 lastWasClose = true; 2117 lastWasClose = true;
2118 break; 2118 break;
2119 default: 2119 default:
2120 SkASSERT(!"unexpected verb"); 2120 SkDEBUGFAIL("unexpected verb");
2121 } 2121 }
2122 expectedVerbs[numIterVerbs++] = nextVerb; 2122 expectedVerbs[numIterVerbs++] = nextVerb;
2123 } 2123 }
2124 2124
2125 iter.setPath(p); 2125 iter.setPath(p);
2126 numVerbs = numIterVerbs; 2126 numVerbs = numIterVerbs;
2127 numIterVerbs = 0; 2127 numIterVerbs = 0;
2128 int numIterPts = 0; 2128 int numIterPts = 0;
2129 SkPoint lastMoveTo; 2129 SkPoint lastMoveTo;
2130 SkPoint lastPt; 2130 SkPoint lastPt;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
2163 REPORTER_ASSERT(reporter, pts[2] == expectedPts[numIterPts + 1]); 2163 REPORTER_ASSERT(reporter, pts[2] == expectedPts[numIterPts + 1]);
2164 REPORTER_ASSERT(reporter, pts[3] == expectedPts[numIterPts + 2]); 2164 REPORTER_ASSERT(reporter, pts[3] == expectedPts[numIterPts + 2]);
2165 lastPt = pts[3]; 2165 lastPt = pts[3];
2166 numIterPts += 3; 2166 numIterPts += 3;
2167 break; 2167 break;
2168 case SkPath::kClose_Verb: 2168 case SkPath::kClose_Verb:
2169 REPORTER_ASSERT(reporter, pts[0] == lastMoveTo); 2169 REPORTER_ASSERT(reporter, pts[0] == lastMoveTo);
2170 lastPt = lastMoveTo; 2170 lastPt = lastMoveTo;
2171 break; 2171 break;
2172 default: 2172 default:
2173 SkASSERT(!"unexpected verb"); 2173 SkDEBUGFAIL("unexpected verb");
2174 } 2174 }
2175 } 2175 }
2176 REPORTER_ASSERT(reporter, numIterPts == numPoints); 2176 REPORTER_ASSERT(reporter, numIterPts == numPoints);
2177 REPORTER_ASSERT(reporter, numIterVerbs == numVerbs); 2177 REPORTER_ASSERT(reporter, numIterVerbs == numVerbs);
2178 } 2178 }
2179 } 2179 }
2180 2180
2181 static void check_for_circle(skiatest::Reporter* reporter, 2181 static void check_for_circle(skiatest::Reporter* reporter,
2182 const SkPath& path, 2182 const SkPath& path,
2183 bool expectedCircle, 2183 bool expectedCircle,
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
2549 test_clipped_cubic(); 2549 test_clipped_cubic();
2550 test_crbug_170666(); 2550 test_crbug_170666();
2551 test_bad_cubic_crbug229478(); 2551 test_bad_cubic_crbug229478();
2552 test_bad_cubic_crbug234190(); 2552 test_bad_cubic_crbug234190();
2553 test_android_specific_behavior(reporter); 2553 test_android_specific_behavior(reporter);
2554 test_path_close_issue1474(reporter); 2554 test_path_close_issue1474(reporter);
2555 } 2555 }
2556 2556
2557 #include "TestClassDef.h" 2557 #include "TestClassDef.h"
2558 DEFINE_TESTCLASS("Path", PathTestClass, TestPath) 2558 DEFINE_TESTCLASS("Path", PathTestClass, TestPath)
OLDNEW
« no previous file with comments | « tests/ClampRangeTest.cpp ('k') | tools/flags/SkCommandLineFlags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698