From: junov@chromium.org Date: Mon, 10 Dec 2012 21:24:38 +0000 (+0000) Subject: Fixing logic error in deferred canvas unittest. X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~14090 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=41e850f07454172dbe1504f2c1190a6fa5f0cf95;p=platform%2Fupstream%2FlibSkiaSharp.git Fixing logic error in deferred canvas unittest. Fixing an inverted test condition. The tested feature is not broken, but the test was passing the inverted test because code just above was missing a restore call, which was affecting the test. Review URL: https://codereview.appspot.com/6921044 git-svn-id: http://skia.googlecode.com/svn/trunk@6745 2bbb7eff-a529-9590-31e7-b0007b416f81 --- diff --git a/tests/DeferredCanvasTest.cpp b/tests/DeferredCanvasTest.cpp index 6cc3b08..d527ea3 100644 --- a/tests/DeferredCanvasTest.cpp +++ b/tests/DeferredCanvasTest.cpp @@ -163,6 +163,7 @@ static void TestDeferredCanvasFreshFrame(skiatest::Reporter* reporter) { paint.setStyle(SkPaint::kFill_Style); paint.setAlpha(255); canvas.drawRect(fullRect, paint); + canvas.restore(); REPORTER_ASSERT(reporter, !canvas.isFreshFrame()); } @@ -182,7 +183,7 @@ static void TestDeferredCanvasFreshFrame(skiatest::Reporter* reporter) { paint.setAlpha( 100 ); paint.setXfermodeMode(SkXfermode::kSrc_Mode); canvas.drawRect(fullRect, paint); - REPORTER_ASSERT(reporter, !canvas.isFreshFrame()); + REPORTER_ASSERT(reporter, canvas.isFreshFrame()); } }