aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2014-12-12 15:11:17 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-12-12 15:11:18 -0800
commit9880607151ca7c2dc6b1a4b9756938bd71913ab5 (patch)
tree2f1cd6ca7cb985a7d9e21e9dd250bf8115f278e8 /tests
parentb927c3cbff0688954fa66a39a6dd5ef85f0b5d48 (diff)
Even more win64 warning fixes
Diffstat (limited to 'tests')
-rw-r--r--tests/ImageCacheTest.cpp2
-rw-r--r--tests/PackBitsTest.cpp10
-rw-r--r--tests/PathTest.cpp30
-rw-r--r--tests/ScalarTest.cpp2
-rw-r--r--tests/ToUnicodeTest.cpp2
5 files changed, 23 insertions, 23 deletions
diff --git a/tests/ImageCacheTest.cpp b/tests/ImageCacheTest.cpp
index eaf3f2811f..c34f9d97e9 100644
--- a/tests/ImageCacheTest.cpp
+++ b/tests/ImageCacheTest.cpp
@@ -56,7 +56,7 @@ static void test_cache(skiatest::Reporter* reporter, SkResourceCache& cache, boo
if (testPurge) {
// stress test, should trigger purges
- for (size_t i = 0; i < COUNT * 100; ++i) {
+ for (int i = 0; i < COUNT * 100; ++i) {
TestingKey key(i);
cache.add(SkNEW_ARGS(TestingRec, (key, i)));
}
diff --git a/tests/PackBitsTest.cpp b/tests/PackBitsTest.cpp
index 2af4f1867d..ce4e8be467 100644
--- a/tests/PackBitsTest.cpp
+++ b/tests/PackBitsTest.cpp
@@ -43,7 +43,7 @@ static void test_pack16(skiatest::Reporter* reporter) {
}
for (int n = 1000; n; n--) {
- size_t size = 50;
+ int size = 50;
uint16_t src[100], src2[100];
uint8_t dst[200];
rand_fill(src, size);
@@ -52,7 +52,7 @@ static void test_pack16(skiatest::Reporter* reporter) {
size_t maxSize = SkPackBits::ComputeMaxSize16(size);
REPORTER_ASSERT(reporter, maxSize >= dstSize);
- size_t srcCount = SkPackBits::Unpack16(dst, dstSize, src2);
+ int srcCount = SkPackBits::Unpack16(dst, dstSize, src2);
REPORTER_ASSERT(reporter, size == srcCount);
bool match = memcmp(src, src2, size * sizeof(uint16_t)) == 0;
REPORTER_ASSERT(reporter, match);
@@ -96,7 +96,7 @@ static void test_pack8(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, match);
}
- for (size_t size = 1; size <= 512; size += 1) {
+ for (uint32_t size = 1; size <= 512; size += 1) {
for (int n = 100; n; n--) {
uint8_t src[600], src2[600];
uint8_t dst[600];
@@ -112,8 +112,8 @@ static void test_pack8(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, match);
for (int j = 0; j < 100; j++) {
- size_t skip = gRand.nextU() % size;
- size_t write = gRand.nextU() % size;
+ uint32_t skip = gRand.nextU() % size;
+ uint32_t write = gRand.nextU() % size;
if (skip + write > size) {
write = size - skip;
}
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp
index d09f8a2b30..1a74682e54 100644
--- a/tests/PathTest.cpp
+++ b/tests/PathTest.cpp
@@ -787,7 +787,7 @@ static void test_addPoly(skiatest::Reporter* reporter) {
for (int doClose = 0; doClose <= 1; ++doClose) {
for (size_t count = 1; count <= SK_ARRAY_COUNT(pts); ++count) {
SkPath path;
- path.addPoly(pts, count, SkToBool(doClose));
+ path.addPoly(pts, SkToInt(count), SkToBool(doClose));
test_poly(reporter, path, pts, SkToBool(doClose));
}
}
@@ -1706,7 +1706,7 @@ static void test_isRect(skiatest::Reporter* reporter) {
struct IsRectTest {
SkPoint *fPoints;
- size_t fPointCount;
+ int fPointCount;
bool fClose;
bool fIsRect;
} tests[] = {
@@ -1748,7 +1748,7 @@ static void test_isRect(skiatest::Reporter* reporter) {
};
const size_t testCount = SK_ARRAY_COUNT(tests);
- size_t index;
+ int index;
for (size_t testIndex = 0; testIndex < testCount; ++testIndex) {
SkPath path;
path.moveTo(tests[testIndex].fPoints[0].fX, tests[testIndex].fPoints[0].fY);
@@ -1803,7 +1803,7 @@ static void test_isRect(skiatest::Reporter* reporter) {
// fail, close then line
SkPath path1;
path1.moveTo(r1[0].fX, r1[0].fY);
- for (index = 1; index < SK_ARRAY_COUNT(r1); ++index) {
+ for (index = 1; index < SkToInt(SK_ARRAY_COUNT(r1)); ++index) {
path1.lineTo(r1[index].fX, r1[index].fY);
}
path1.close();
@@ -1813,7 +1813,7 @@ static void test_isRect(skiatest::Reporter* reporter) {
// fail, move in the middle
path1.reset();
path1.moveTo(r1[0].fX, r1[0].fY);
- for (index = 1; index < SK_ARRAY_COUNT(r1); ++index) {
+ for (index = 1; index < SkToInt(SK_ARRAY_COUNT(r1)); ++index) {
if (index == 2) {
path1.moveTo(1, .5f);
}
@@ -1824,7 +1824,7 @@ static void test_isRect(skiatest::Reporter* reporter) {
// fail, move on the edge
path1.reset();
- for (index = 1; index < SK_ARRAY_COUNT(r1); ++index) {
+ for (index = 1; index < SkToInt(SK_ARRAY_COUNT(r1)); ++index) {
path1.moveTo(r1[index - 1].fX, r1[index - 1].fY);
path1.lineTo(r1[index].fX, r1[index].fY);
}
@@ -1834,7 +1834,7 @@ static void test_isRect(skiatest::Reporter* reporter) {
// fail, quad
path1.reset();
path1.moveTo(r1[0].fX, r1[0].fY);
- for (index = 1; index < SK_ARRAY_COUNT(r1); ++index) {
+ for (index = 1; index < SkToInt(SK_ARRAY_COUNT(r1)); ++index) {
if (index == 2) {
path1.quadTo(1, .5f, 1, .5f);
}
@@ -1846,7 +1846,7 @@ static void test_isRect(skiatest::Reporter* reporter) {
// fail, cubic
path1.reset();
path1.moveTo(r1[0].fX, r1[0].fY);
- for (index = 1; index < SK_ARRAY_COUNT(r1); ++index) {
+ for (index = 1; index < SkToInt(SK_ARRAY_COUNT(r1)); ++index) {
if (index == 2) {
path1.cubicTo(1, .5f, 1, .5f, 1, .5f);
}
@@ -1889,7 +1889,7 @@ static void test_isNestedRects(skiatest::Reporter* reporter) {
struct IsNestedRectTest {
SkPoint *fPoints;
- size_t fPointCount;
+ int fPointCount;
SkPath::Direction fDirection;
bool fClose;
bool fIsNestedRect; // nests with path.addRect(-1, -1, 2, 2);
@@ -1923,7 +1923,7 @@ static void test_isNestedRects(skiatest::Reporter* reporter) {
};
const size_t testCount = SK_ARRAY_COUNT(tests);
- size_t index;
+ int index;
for (int rectFirst = 0; rectFirst <= 1; ++rectFirst) {
for (size_t testIndex = 0; testIndex < testCount; ++testIndex) {
SkPath path;
@@ -1968,7 +1968,7 @@ static void test_isNestedRects(skiatest::Reporter* reporter) {
path1.addRect(-1, -1, 2, 2, SkPath::kCW_Direction);
}
path1.moveTo(r1[0].fX, r1[0].fY);
- for (index = 1; index < SK_ARRAY_COUNT(r1); ++index) {
+ for (index = 1; index < SkToInt(SK_ARRAY_COUNT(r1)); ++index) {
path1.lineTo(r1[index].fX, r1[index].fY);
}
path1.close();
@@ -1984,7 +1984,7 @@ static void test_isNestedRects(skiatest::Reporter* reporter) {
path1.addRect(-1, -1, 2, 2, SkPath::kCW_Direction);
}
path1.moveTo(r1[0].fX, r1[0].fY);
- for (index = 1; index < SK_ARRAY_COUNT(r1); ++index) {
+ for (index = 1; index < SkToInt(SK_ARRAY_COUNT(r1)); ++index) {
if (index == 2) {
path1.moveTo(1, .5f);
}
@@ -2001,7 +2001,7 @@ static void test_isNestedRects(skiatest::Reporter* reporter) {
if (rectFirst) {
path1.addRect(-1, -1, 2, 2, SkPath::kCW_Direction);
}
- for (index = 1; index < SK_ARRAY_COUNT(r1); ++index) {
+ for (index = 1; index < SkToInt(SK_ARRAY_COUNT(r1)); ++index) {
path1.moveTo(r1[index - 1].fX, r1[index - 1].fY);
path1.lineTo(r1[index].fX, r1[index].fY);
}
@@ -2017,7 +2017,7 @@ static void test_isNestedRects(skiatest::Reporter* reporter) {
path1.addRect(-1, -1, 2, 2, SkPath::kCW_Direction);
}
path1.moveTo(r1[0].fX, r1[0].fY);
- for (index = 1; index < SK_ARRAY_COUNT(r1); ++index) {
+ for (index = 1; index < SkToInt(SK_ARRAY_COUNT(r1)); ++index) {
if (index == 2) {
path1.quadTo(1, .5f, 1, .5f);
}
@@ -2035,7 +2035,7 @@ static void test_isNestedRects(skiatest::Reporter* reporter) {
path1.addRect(-1, -1, 2, 2, SkPath::kCW_Direction);
}
path1.moveTo(r1[0].fX, r1[0].fY);
- for (index = 1; index < SK_ARRAY_COUNT(r1); ++index) {
+ for (index = 1; index < SkToInt(SK_ARRAY_COUNT(r1)); ++index) {
if (index == 2) {
path1.cubicTo(1, .5f, 1, .5f, 1, .5f);
}
diff --git a/tests/ScalarTest.cpp b/tests/ScalarTest.cpp
index b6f71d19bc..f2f924e4ff 100644
--- a/tests/ScalarTest.cpp
+++ b/tests/ScalarTest.cpp
@@ -54,7 +54,7 @@ static void test_isRectFinite(skiatest::Reporter* reporter) {
static const struct {
const SkPoint* fPts;
- size_t fCount;
+ int fCount;
bool fIsFinite;
} gSets[] = {
{ gF0, SK_ARRAY_COUNT(gF0), true },
diff --git a/tests/ToUnicodeTest.cpp b/tests/ToUnicodeTest.cpp
index 919ba11f58..33fcc80ef7 100644
--- a/tests/ToUnicodeTest.cpp
+++ b/tests/ToUnicodeTest.cpp
@@ -149,7 +149,7 @@ endbfrange\n";
// I n s t a l
// Glyph id 2c 51 56 57 44 4f
// Unicode 49 6e 73 74 61 6c
- for (size_t i = 0; i < 100; ++i) {
+ for (SkUnichar i = 0; i < 100; ++i) {
glyphToUnicode.push(i + 29);
}