Fix valgrind issue in SkBase64Test.cpp
https://codereview.chromium.org/152153002/ git-svn-id: http://skia.googlecode.com/svn/trunk@13276 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
78319ced50
commit
7017288811
@ -11,15 +11,16 @@
|
||||
|
||||
DEF_TEST(SkBase64Test, reporter) {
|
||||
char all[256];
|
||||
for (int index = 0; index < 256; index++) {
|
||||
for (int index = 0; index < 256; ++index) {
|
||||
all[index] = (signed char) (index + 1);
|
||||
}
|
||||
|
||||
for (int offset = 0; offset < 6; offset++) {
|
||||
for (int offset = 0; offset < 6; ++offset) {
|
||||
size_t length = 256 - offset;
|
||||
size_t encodeLength = SkBase64::Encode(all + offset, length, NULL);
|
||||
SkAutoTMalloc<char> src(encodeLength + 1);
|
||||
SkBase64::Encode(all + offset, length, src.get());
|
||||
src[encodeLength] = '\0';
|
||||
SkBase64 tryMe;
|
||||
tryMe.decode(src.get(), encodeLength);
|
||||
REPORTER_ASSERT(reporter, (strcmp((const char*) (all + offset), tryMe.getData()) == 0));
|
||||
|
Loading…
Reference in New Issue
Block a user