From a63a851afb2e5083cab3874853dd9363147a8aea Mon Sep 17 00:00:00 2001 From: "reed@google.com" Date: Mon, 2 Jul 2012 20:29:00 +0000 Subject: update test for new NewFromCString behavior git-svn-id: http://skia.googlecode.com/svn/trunk@4431 2bbb7eff-a529-9590-31e7-b0007b416f81 --- tests/DataRefTest.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests/DataRefTest.cpp') diff --git a/tests/DataRefTest.cpp b/tests/DataRefTest.cpp index 0b72c4a93a..dc7f42407f 100644 --- a/tests/DataRefTest.cpp +++ b/tests/DataRefTest.cpp @@ -30,13 +30,14 @@ static void test_cstring(skiatest::Reporter* reporter) { const char str[] = "Hello world"; size_t len = strlen(str); - SkAutoTUnref r0(SkData::NewWithCopy(str, len)); + SkAutoTUnref r0(SkData::NewWithCopy(str, len + 1)); SkAutoTUnref r1(SkData::NewWithCString(str)); REPORTER_ASSERT(reporter, r0->equals(r1)); SkAutoTUnref r2(SkData::NewWithCString(NULL)); - REPORTER_ASSERT(reporter, r2->isEmpty()); + REPORTER_ASSERT(reporter, 1 == r2->size()); + REPORTER_ASSERT(reporter, 0 == *r2->bytes()); } static void TestDataRef(skiatest::Reporter* reporter) { -- cgit v1.2.3