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

Side by Side Diff: tests/SkBase64Test.cpp

Issue 805543002: DM warning-free on win64 (Closed) Base URL: https://skia.googlesource.com/skia.git@w64
Patch Set: Created 6 years 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 unified diff | Download patch
« no previous file with comments | « tests/PaintTest.cpp ('k') | tests/Writer32Test.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkBase64.h" 8 #include "SkBase64.h"
9 9
10 #include "Test.h" 10 #include "Test.h"
11 11
12 DEF_TEST(SkBase64, reporter) { 12 DEF_TEST(SkBase64, reporter) {
13 char all[256]; 13 char all[256];
14 for (int index = 0; index < 256; ++index) { 14 for (int index = 0; index < 256; ++index) {
15 all[index] = (signed char) (index + 1); 15 all[index] = (signed char) (index + 1);
16 } 16 }
17 17
18 for (int offset = 0; offset < 6; ++offset) { 18 for (int offset = 0; offset < 6; ++offset) {
19 size_t length = 256 - offset; 19 size_t length = 256 - offset;
20 size_t encodeLength = SkBase64::Encode(all + offset, length, NULL); 20 size_t encodeLength = SkBase64::Encode(all + offset, length, NULL);
21 SkAutoTMalloc<char> src(encodeLength + 1); 21 SkAutoTMalloc<char> src(encodeLength + 1);
22 SkBase64::Encode(all + offset, length, src.get()); 22 SkBase64::Encode(all + offset, length, src.get());
23 src[encodeLength] = '\0'; 23 src[SkToInt(encodeLength)] = '\0';
24 SkBase64 tryMe; 24 SkBase64 tryMe;
25 tryMe.decode(src.get(), encodeLength); 25 tryMe.decode(src.get(), encodeLength);
26 REPORTER_ASSERT(reporter, (strcmp((const char*) (all + offset), tryMe.ge tData()) == 0)); 26 REPORTER_ASSERT(reporter, (strcmp((const char*) (all + offset), tryMe.ge tData()) == 0));
27 delete[] tryMe.getData(); 27 delete[] tryMe.getData();
28 } 28 }
29 } 29 }
OLDNEW
« no previous file with comments | « tests/PaintTest.cpp ('k') | tests/Writer32Test.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698