aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/SkBase64Test.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-02-01 15:45:23 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-02-01 15:45:23 +0000
commit7017288811091427c15da5f97a14ac85a6585ec4 (patch)
treeb4c91592f577c52cc002a12d29167405a946ace6 /tests/SkBase64Test.cpp
parent78319ced5030af0318b20a406d886926e6d36a21 (diff)
Fix valgrind issue in SkBase64Test.cpp
Diffstat (limited to 'tests/SkBase64Test.cpp')
-rw-r--r--tests/SkBase64Test.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/SkBase64Test.cpp b/tests/SkBase64Test.cpp
index aba9691106..217e2ca56d 100644
--- a/tests/SkBase64Test.cpp
+++ b/tests/SkBase64Test.cpp
@@ -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));