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

Side by Side Diff: tests/CachedDataTest.cpp

Issue 1316233002: Style Change: NULL->nullptr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-27 (Thursday) 10:25:06 EDT Created 5 years, 3 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/CTest.cpp ('k') | tests/CachedDecodingPixelRefTest.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 "SkCachedData.h" 8 #include "SkCachedData.h"
9 #include "SkDiscardableMemoryPool.h" 9 #include "SkDiscardableMemoryPool.h"
10 #include "Test.h" 10 #include "Test.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 * Thus, among other things, we test the end-of-life behavior when the client i s the last owner 71 * Thus, among other things, we test the end-of-life behavior when the client i s the last owner
72 * and when the cache is. 72 * and when the cache is.
73 */ 73 */
74 DEF_TEST(CachedData, reporter) { 74 DEF_TEST(CachedData, reporter) {
75 SkAutoTUnref<SkDiscardableMemoryPool> pool(SkDiscardableMemoryPool::Create(1 000)); 75 SkAutoTUnref<SkDiscardableMemoryPool> pool(SkDiscardableMemoryPool::Create(1 000));
76 76
77 for (int useDiscardable = 0; useDiscardable <= 1; ++useDiscardable) { 77 for (int useDiscardable = 0; useDiscardable <= 1; ++useDiscardable) {
78 const size_t size = 100; 78 const size_t size = 100;
79 79
80 // test with client as last owner 80 // test with client as last owner
81 SkCachedData* data = test_locking(reporter, size, useDiscardable ? pool. get() : NULL); 81 SkCachedData* data = test_locking(reporter, size, useDiscardable ? pool. get() : nullptr);
82 check_data(reporter, data, 2, kInCache, kLocked); 82 check_data(reporter, data, 2, kInCache, kLocked);
83 data->detachFromCacheAndUnref(); 83 data->detachFromCacheAndUnref();
84 check_data(reporter, data, 1, kNotInCache, kLocked); 84 check_data(reporter, data, 1, kNotInCache, kLocked);
85 data->unref(); 85 data->unref();
86 86
87 // test with cache as last owner 87 // test with cache as last owner
88 data = test_locking(reporter, size, useDiscardable ? pool.get() : NULL); 88 data = test_locking(reporter, size, useDiscardable ? pool.get() : nullpt r);
89 check_data(reporter, data, 2, kInCache, kLocked); 89 check_data(reporter, data, 2, kInCache, kLocked);
90 data->unref(); 90 data->unref();
91 check_data(reporter, data, 1, kInCache, kUnlocked); 91 check_data(reporter, data, 1, kInCache, kUnlocked);
92 data->detachFromCacheAndUnref(); 92 data->detachFromCacheAndUnref();
93 } 93 }
94 } 94 }
95 95
OLDNEW
« no previous file with comments | « tests/CTest.cpp ('k') | tests/CachedDecodingPixelRefTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698