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

Side by Side Diff: tests/StreamTest.cpp

Issue 1733113002: Unit Tests: eliminate stray SkDebugf()s. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « tests/SrcOverTest.cpp ('k') | tests/Test.h » ('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 2011 Google Inc. 2 * Copyright 2011 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 "Resources.h" 8 #include "Resources.h"
9 #include "SkData.h" 9 #include "SkData.h"
10 #include "SkFrontBufferedStream.h" 10 #include "SkFrontBufferedStream.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 for (i = 0; i < SK_ARRAY_COUNT(sizes); ++i) { 157 for (i = 0; i < SK_ARRAY_COUNT(sizes); ++i) {
158 bool success = wstream.writePackedUInt(sizes[i]); 158 bool success = wstream.writePackedUInt(sizes[i]);
159 REPORTER_ASSERT(reporter, success); 159 REPORTER_ASSERT(reporter, success);
160 } 160 }
161 wstream.flush(); 161 wstream.flush();
162 162
163 SkMemoryStream rstream(buffer, sizeof(buffer)); 163 SkMemoryStream rstream(buffer, sizeof(buffer));
164 for (i = 0; i < SK_ARRAY_COUNT(sizes); ++i) { 164 for (i = 0; i < SK_ARRAY_COUNT(sizes); ++i) {
165 size_t n = rstream.readPackedUInt(); 165 size_t n = rstream.readPackedUInt();
166 if (sizes[i] != n) { 166 if (sizes[i] != n) {
167 SkDebugf("-- %d: sizes:%x n:%x\n", i, sizes[i], n); 167 ERRORF(reporter, "sizes:%x != n:%x\n", i, sizes[i], n);
168 } 168 }
169 REPORTER_ASSERT(reporter, sizes[i] == n);
170 } 169 }
171 } 170 }
172 171
173 // Test that setting an SkMemoryStream to a nullptr data does not result in a cr ash when calling 172 // Test that setting an SkMemoryStream to a nullptr data does not result in a cr ash when calling
174 // methods that access fData. 173 // methods that access fData.
175 static void TestDereferencingData(SkMemoryStream* memStream) { 174 static void TestDereferencingData(SkMemoryStream* memStream) {
176 memStream->read(nullptr, 0); 175 memStream->read(nullptr, 0);
177 memStream->getMemoryBase(); 176 memStream->getMemoryBase();
178 SkAutoDataUnref data(memStream->copyToData()); 177 SkAutoDataUnref data(memStream->copyToData());
179 } 178 }
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 SkMemoryStream smartStream(src.get(), (size_t)N); 428 SkMemoryStream smartStream(src.get(), (size_t)N);
430 stream_copy_test(reporter, src, N, &smartStream); 429 stream_copy_test(reporter, src, N, &smartStream);
431 } 430 }
432 431
433 DEF_TEST(StreamEmptyStreamMemoryBase, r) { 432 DEF_TEST(StreamEmptyStreamMemoryBase, r) {
434 SkDynamicMemoryWStream tmp; 433 SkDynamicMemoryWStream tmp;
435 SkAutoTDelete<SkStreamAsset> asset(tmp.detachAsStream()); 434 SkAutoTDelete<SkStreamAsset> asset(tmp.detachAsStream());
436 REPORTER_ASSERT(r, nullptr == asset->getMemoryBase()); 435 REPORTER_ASSERT(r, nullptr == asset->getMemoryBase());
437 } 436 }
438 437
OLDNEW
« no previous file with comments | « tests/SrcOverTest.cpp ('k') | tests/Test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698