2 * Copyright 2014 Google Inc.
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
12 DEF_TEST(SkBase64, reporter) {
14 for (int index = 0; index < 256; ++index) {
15 all[index] = (signed char) (index + 1);
18 for (int offset = 0; offset < 6; ++offset) {
19 size_t length = 256 - offset;
20 size_t encodeLength = SkBase64::Encode(all + offset, length, NULL);
21 SkAutoTMalloc<char> src(encodeLength + 1);
22 SkBase64::Encode(all + offset, length, src.get());
23 src[encodeLength] = '\0';
25 tryMe.decode(src.get(), encodeLength);
26 REPORTER_ASSERT(reporter, (strcmp((const char*) (all + offset), tryMe.getData()) == 0));
27 delete[] tryMe.getData();