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

Side by Side Diff: tests/DiscardableMemoryTest.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/DiscardableMemoryPoolTest.cpp ('k') | tests/DrawBitmapRectTest.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 2013 Google Inc. 2 * Copyright 2013 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 "SkDiscardableMemory.h" 8 #include "SkDiscardableMemory.h"
9 9
10 #include "Test.h" 10 #include "Test.h"
11 11
12 DEF_TEST(DiscardableMemory, reporter) { 12 DEF_TEST(DiscardableMemory, reporter) {
13 const char testString[] = "HELLO, WORLD!"; 13 const char testString[] = "HELLO, WORLD!";
14 const size_t len = sizeof(testString); 14 const size_t len = sizeof(testString);
15 SkAutoTDelete<SkDiscardableMemory> dm(SkDiscardableMemory::Create(len)); 15 SkAutoTDelete<SkDiscardableMemory> dm(SkDiscardableMemory::Create(len));
16 REPORTER_ASSERT(reporter, dm.get() != NULL); 16 REPORTER_ASSERT(reporter, dm.get() != nullptr);
17 if (NULL == dm.get()) { 17 if (nullptr == dm.get()) {
18 return; 18 return;
19 } 19 }
20 void* ptr = dm->data(); 20 void* ptr = dm->data();
21 REPORTER_ASSERT(reporter, ptr != NULL); 21 REPORTER_ASSERT(reporter, ptr != nullptr);
22 memcpy(ptr, testString, sizeof(testString)); 22 memcpy(ptr, testString, sizeof(testString));
23 dm->unlock(); 23 dm->unlock();
24 bool success = dm->lock(); 24 bool success = dm->lock();
25 REPORTER_ASSERT(reporter, success); 25 REPORTER_ASSERT(reporter, success);
26 if (!success) { 26 if (!success) {
27 return; 27 return;
28 } 28 }
29 ptr = dm->data(); 29 ptr = dm->data();
30 REPORTER_ASSERT(reporter, 0 == memcmp(ptr, testString, len)); 30 REPORTER_ASSERT(reporter, 0 == memcmp(ptr, testString, len));
31 dm->unlock(); 31 dm->unlock();
32 } 32 }
OLDNEW
« no previous file with comments | « tests/DiscardableMemoryPoolTest.cpp ('k') | tests/DrawBitmapRectTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698