From 260000266444e0fe6e349f63b2a772c5cddc0942 Mon Sep 17 00:00:00 2001 From: "tc@google.com" Date: Wed, 1 Jul 2009 01:33:52 +0000 Subject: Enable some skia unittests on linux and mac. This enables the ImageOperations.* and SkiaUtils.* test_shell_tests on linux and mac. Review URL: http://codereview.chromium.org/151097 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19701 0039d316-1c4b-4281-b951-d872f2087c98 --- skia/ext/image_operations_unittest.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'skia/ext') diff --git a/skia/ext/image_operations_unittest.cc b/skia/ext/image_operations_unittest.cc index 3699685..b422371 100644 --- a/skia/ext/image_operations_unittest.cc +++ b/skia/ext/image_operations_unittest.cc @@ -178,13 +178,13 @@ TEST(ImageOperations, CreateBlendedBitmap) { for (int y = 0; y < src_h; y++) { for (int x = 0; x < src_w; x++) { int i = y * src_w + x; - EXPECT_EQ((255 + ((255 - i) % 255)) / 2, + EXPECT_EQ(static_cast((255 + ((255 - i) % 255)) / 2), SkColorGetA(*blended.getAddr32(x, y))); - EXPECT_EQ(i % 255 / 2, + EXPECT_EQ(static_cast(i % 255 / 2), SkColorGetR(*blended.getAddr32(x, y))); - EXPECT_EQ(((i * 2) % 255 + (i * 4) % 255) / 2, + EXPECT_EQ((static_cast((i * 2) % 255 + (i * 4) % 255) / 2), SkColorGetG(*blended.getAddr32(x, y))); - EXPECT_EQ(i % 255 / 2, + EXPECT_EQ(static_cast(i % 255 / 2), SkColorGetB(*blended.getAddr32(x, y))); } } @@ -223,7 +223,7 @@ TEST(ImageOperations, CreateMaskedBitmap) { SkColor masked_pixel = *masked.getAddr32(x, y); // Test that the alpha is equal. - int alpha = (alpha_pixel & 0xff000000) >> SK_A32_SHIFT; + unsigned int alpha = (alpha_pixel & 0xff000000) >> SK_A32_SHIFT; EXPECT_EQ(alpha, (masked_pixel & 0xff000000) >> SK_A32_SHIFT); // Test that the colors are right - SkBitmaps have premultiplied alpha, @@ -511,4 +511,4 @@ TEST(ImageOperations, DownsampleByTwoUntilSize) { // The result should be divided in half 100x43 -> 50x22 -> 25x11 EXPECT_EQ(25, result.width()); EXPECT_EQ(11, result.height()); -} \ No newline at end of file +} -- cgit v1.1