From 5595af1b2ebe6590e98641464d43d22281a7f295 Mon Sep 17 00:00:00 2001 From: "reed@google.com" Date: Fri, 21 Dec 2012 15:36:33 +0000 Subject: unify how we handle externally-provided storage in SkWriter32, with the goal of simplifying the logic in reserve() so it can be inlined/accelerated. Review URL: https://codereview.appspot.com/6962048 git-svn-id: http://skia.googlecode.com/svn/trunk@6923 2bbb7eff-a529-9590-31e7-b0007b416f81 --- tests/Writer32Test.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'tests/Writer32Test.cpp') diff --git a/tests/Writer32Test.cpp b/tests/Writer32Test.cpp index 4715f7a613..bcdc559407 100644 --- a/tests/Writer32Test.cpp +++ b/tests/Writer32Test.cpp @@ -173,7 +173,6 @@ static void Tests(skiatest::Reporter* reporter) { // dynamic allocator { SkWriter32 writer(256 * 4); - REPORTER_ASSERT(reporter, NULL == writer.getSingleBlock()); test1(reporter, &writer); writer.reset(); @@ -183,13 +182,11 @@ static void Tests(skiatest::Reporter* reporter) { testWritePad(reporter, &writer); } - // single-block + // storage-block { SkWriter32 writer(0); uint32_t storage[256]; - REPORTER_ASSERT(reporter, NULL == writer.getSingleBlock()); writer.reset(storage, sizeof(storage)); - REPORTER_ASSERT(reporter, (void*)storage == writer.getSingleBlock()); test1(reporter, &writer); writer.reset(storage, sizeof(storage)); @@ -197,6 +194,11 @@ static void Tests(skiatest::Reporter* reporter) { writer.reset(storage, sizeof(storage)); testWritePad(reporter, &writer); + + // try overflowing the storage-block + uint32_t smallStorage[8]; + writer.reset(smallStorage, sizeof(smallStorage)); + test2(reporter, &writer); } // small storage -- cgit v1.2.3