diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-06-23 21:48:04 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-06-23 21:48:04 +0000 |
commit | 70442a6cf73c9a822df23961f5e16dc3abc18f26 (patch) | |
tree | 13b2045326fadb9be3a5d9c78b4f6b3a7f2f30b1 /tests/StreamTest.cpp | |
parent | 9df621da5024dda2ffd77cfa6e6c0a0f68e4aa86 (diff) |
add copyToData() to dyanamicwstream
git-svn-id: http://skia.googlecode.com/svn/trunk@1695 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests/StreamTest.cpp')
-rw-r--r-- | tests/StreamTest.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/StreamTest.cpp b/tests/StreamTest.cpp index e62f2ed5a0..9aaa8b484f 100644 --- a/tests/StreamTest.cpp +++ b/tests/StreamTest.cpp @@ -1,6 +1,7 @@ #include "Test.h" #include "SkRandom.h" #include "SkStream.h" +#include "SkDataRef.h" #define MAX_SIZE (256 * 1024) @@ -82,6 +83,13 @@ static void TestWStream(skiatest::Reporter* reporter) { REPORTER_ASSERT(reporter, memcmp(&dst[i * 26], s, 26) == 0); } REPORTER_ASSERT(reporter, memcmp(dst, ds.getStream(), 100*26) == 0); + + { + SkDataRef* data = ds.copyToData(); + REPORTER_ASSERT(reporter, 100 * 26 == data->size()); + REPORTER_ASSERT(reporter, memcmp(dst, data->data(), data->size()) == 0); + data->unref(); + } delete[] dst; } |