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

Side by Side Diff: tests/DataRefTest.cpp

Issue 1691383002: Make SkRWBuffer destruct safely (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 | « src/core/SkRWBuffer.cpp ('k') | no next file » | 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 "SkData.h" 8 #include "SkData.h"
9 #include "SkDataTable.h" 9 #include "SkDataTable.h"
10 #include "SkOSFile.h" 10 #include "SkOSFile.h"
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 321
322 SkAutoTUnref<SkROBuffer> roBuffer(buffer.newRBufferSnapshot()); 322 SkAutoTUnref<SkROBuffer> roBuffer(buffer.newRBufferSnapshot());
323 SkROBuffer::Iter iter(roBuffer); 323 SkROBuffer::Iter iter(roBuffer);
324 REPORTER_ASSERT(r, iter.data()); 324 REPORTER_ASSERT(r, iter.data());
325 REPORTER_ASSERT(r, iter.size() == 26); 325 REPORTER_ASSERT(r, iter.size() == 26);
326 326
327 // There is only one block in this buffer. 327 // There is only one block in this buffer.
328 REPORTER_ASSERT(r, !iter.next()); 328 REPORTER_ASSERT(r, !iter.next());
329 REPORTER_ASSERT(r, 0 == iter.size()); 329 REPORTER_ASSERT(r, 0 == iter.size());
330 } 330 }
331
332 // Tests that it is safe to destruct an SkRWBuffer without appending
333 // anything to it.
334 DEF_TEST(RWBuffer_noAppend, r) {
335 SkRWBuffer buffer;
336 REPORTER_ASSERT(r, 0 == buffer.size());
337 }
OLDNEW
« no previous file with comments | « src/core/SkRWBuffer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698