diff options
author | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-07-10 17:30:58 +0000 |
---|---|---|
committer | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-07-10 17:30:58 +0000 |
commit | 59f46b81f8bdd1b524f5cc43bc27603f9604c71a (patch) | |
tree | c074f4d76c87c4ab67e32405327a0c10201ed7e8 /tests | |
parent | 676e66096c60615bac52f365111596de5c4ca8a6 (diff) |
Fixed Windows compiler complaints
http://codereview.appspot.com/6392044
git-svn-id: http://skia.googlecode.com/svn/trunk@4511 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests')
-rw-r--r-- | tests/FlateTest.cpp | 8 | ||||
-rw-r--r-- | tests/PDFPrimitivesTest.cpp | 14 | ||||
-rw-r--r-- | tests/PathMeasureTest.cpp | 6 | ||||
-rw-r--r-- | tests/ToUnicode.cpp | 4 |
4 files changed, 17 insertions, 15 deletions
diff --git a/tests/FlateTest.cpp b/tests/FlateTest.cpp index 8697df9f5a..446e41242d 100644 --- a/tests/FlateTest.cpp +++ b/tests/FlateTest.cpp @@ -72,14 +72,16 @@ static void TestFlate(skiatest::Reporter* reporter, SkMemoryStream* testStream, inputSize = testStream->getLength(); if (inputSize == 0) inputSize = testStream->read(NULL, SkZeroSizeMemStream::kGetSizeKey); - REPORTER_ASSERT(reporter, data1.size() == inputSize); + REPORTER_ASSERT(reporter, data1->size() == inputSize); REPORTER_ASSERT(reporter, memcmp(testStream->getMemoryBase(), - data1.data(), data1.size()) == 0); + data1->data(), + data1->size()) == 0); // Check that the uncompressed data matches the source data. SkAutoDataUnref data2(uncompressed.copyToData()); REPORTER_ASSERT(reporter, testData.getLength() == uncompressed.getOffset()); - REPORTER_ASSERT(reporter, memcmp(testData.getMemoryBase(), data2.data(), + REPORTER_ASSERT(reporter, memcmp(testData.getMemoryBase(), + data2->data(), testData.getLength()) == 0); } diff --git a/tests/PDFPrimitivesTest.cpp b/tests/PDFPrimitivesTest.cpp index 2423d561d5..ea3093f60f 100644 --- a/tests/PDFPrimitivesTest.cpp +++ b/tests/PDFPrimitivesTest.cpp @@ -38,10 +38,10 @@ private: static bool stream_equals(const SkDynamicMemoryWStream& stream, size_t offset, const void* buffer, size_t len) { SkAutoDataUnref data(stream.copyToData()); - if (offset + len > data.size()) { + if (offset + len > data->size()) { return false; } - return memcmp(data.bytes() + offset, buffer, len) == 0; + return memcmp(data->bytes() + offset, buffer, len) == 0; } static void CheckObjectOutput(skiatest::Reporter* reporter, SkPDFObject* obj, @@ -128,19 +128,19 @@ static void TestPDFStream(skiatest::Reporter* reporter) { expectedResult1.writeText("\nendstream"); SkAutoDataUnref expectedResultData1(expectedResult1.copyToData()); CheckObjectOutput(reporter, stream.get(), - (const char*) expectedResultData1.data(), - expectedResultData1.size(), true, false); + (const char*) expectedResultData1->data(), + expectedResultData1->size(), true, false); // Then again with compression. SkDynamicMemoryWStream expectedResult2; expectedResult2.writeText("<</Filter /FlateDecode\n/Length 116\n" ">> stream\n"); - expectedResult2.write(compressedData.data(), compressedData.size()); + expectedResult2.write(compressedData->data(), compressedData->size()); expectedResult2.writeText("\nendstream"); SkAutoDataUnref expectedResultData2(expectedResult2.copyToData()); CheckObjectOutput(reporter, stream.get(), - (const char*) expectedResultData2.data(), - expectedResultData2.size(), true, true); + (const char*) expectedResultData2->data(), + expectedResultData2->size(), true, true); } } diff --git a/tests/PathMeasureTest.cpp b/tests/PathMeasureTest.cpp index ee78c6b6f0..9d153c25bd 100644 --- a/tests/PathMeasureTest.cpp +++ b/tests/PathMeasureTest.cpp @@ -152,14 +152,14 @@ static void TestPathMeasure(skiatest::Reporter* reporter) { REPORTER_ASSERT(reporter, position.fY == 0); REPORTER_ASSERT(reporter, tangent.fX == SK_Scalar1); REPORTER_ASSERT(reporter, tangent.fY == 0); - REPORTER_ASSERT(reporter, meas.getPosTan(SK_Scalar1 * 2.5f, &position, &tangent)); + REPORTER_ASSERT(reporter, meas.getPosTan(SkFloatToScalar(2.5f), &position, &tangent)); REPORTER_ASSERT(reporter, SkScalarNearlyEqual(position.fX, SK_Scalar1, SkFloatToScalar(0.0001f))); REPORTER_ASSERT(reporter, - SkScalarNearlyEqual(position.fY, SK_Scalar1 * 1.5f)); + SkScalarNearlyEqual(position.fY, SkFloatToScalar(1.5f))); REPORTER_ASSERT(reporter, tangent.fX == 0); REPORTER_ASSERT(reporter, tangent.fY == SK_Scalar1); - REPORTER_ASSERT(reporter, meas.getPosTan(SK_Scalar1 * 4.5f, &position, &tangent)); + REPORTER_ASSERT(reporter, meas.getPosTan(SkFloatToScalar(4.5f), &position, &tangent)); REPORTER_ASSERT(reporter, SkScalarNearlyEqual(position.fX, SkFloatToScalar(2.5f), diff --git a/tests/ToUnicode.cpp b/tests/ToUnicode.cpp index 99e9ef6ed5..ea9e258ac3 100644 --- a/tests/ToUnicode.cpp +++ b/tests/ToUnicode.cpp @@ -16,13 +16,13 @@ static bool stream_equals(const SkDynamicMemoryWStream& stream, size_t offset, const char* buffer, size_t len) { SkAutoDataUnref data(stream.copyToData()); - if (offset + len > data.size()) { + if (offset + len > data->size()) { return false; } if (len != strlen(buffer)) { return false; } - return memcmp(data.bytes() + offset, buffer, len) == 0; + return memcmp(data->bytes() + offset, buffer, len) == 0; } void append_cmap_sections(const SkTDArray<SkUnichar>& glyphToUnicode, |