Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Unified Diff: tests/SkBase64Test.cpp

Issue 152153002: Fix valgrind issue in SkBase64Test.cpp (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/SkBase64Test.cpp
===================================================================
--- tests/SkBase64Test.cpp (revision 13274)
+++ tests/SkBase64Test.cpp (working copy)
@@ -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) {
tfarina 2014/02/01 15:46:21 does pre-increment makes any difference here, or w
robertphillips 2014/02/01 15:50:24 In this case it doesn't make any performance diffe
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';
tfarina 2014/02/01 15:46:21 looks like I removed this when I used SkAutoMalloc
robertphillips 2014/02/01 15:50:24 Yep - np. The recent noise on the valgrind bot hid
SkBase64 tryMe;
tryMe.decode(src.get(), encodeLength);
REPORTER_ASSERT(reporter, (strcmp((const char*) (all + offset), tryMe.getData()) == 0));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698