From 96fcdcc219d2a0d3579719b84b28bede76efba64 Mon Sep 17 00:00:00 2001 From: halcanary Date: Thu, 27 Aug 2015 07:41:13 -0700 Subject: Style Change: NULL->nullptr DOCS_PREVIEW= https://skia.org/?cl=1316233002 Review URL: https://codereview.chromium.org/1316233002 --- tests/MallocPixelRefTest.cpp | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'tests/MallocPixelRefTest.cpp') diff --git a/tests/MallocPixelRefTest.cpp b/tests/MallocPixelRefTest.cpp index e267d6f72c..2e6c07d103 100644 --- a/tests/MallocPixelRefTest.cpp +++ b/tests/MallocPixelRefTest.cpp @@ -25,71 +25,71 @@ DEF_TEST(MallocPixelRef, reporter) { SkImageInfo info = SkImageInfo::MakeN32Premul(10, 13); { SkAutoTUnref pr( - SkMallocPixelRef::NewAllocate(info, info.minRowBytes() - 1, NULL)); + SkMallocPixelRef::NewAllocate(info, info.minRowBytes() - 1, nullptr)); // rowbytes too small. - REPORTER_ASSERT(reporter, NULL == pr.get()); + REPORTER_ASSERT(reporter, nullptr == pr.get()); } { size_t rowBytes = info.minRowBytes() - 1; size_t size = info.getSafeSize(rowBytes); SkAutoDataUnref data(SkData::NewUninitialized(size)); SkAutoTUnref pr( - SkMallocPixelRef::NewWithData(info, rowBytes, NULL, data)); + SkMallocPixelRef::NewWithData(info, rowBytes, nullptr, data)); // rowbytes too small. - REPORTER_ASSERT(reporter, NULL == pr.get()); + REPORTER_ASSERT(reporter, nullptr == pr.get()); } { size_t rowBytes = info.minRowBytes() + 2; size_t size = info.getSafeSize(rowBytes) - 1; SkAutoDataUnref data(SkData::NewUninitialized(size)); SkAutoTUnref pr( - SkMallocPixelRef::NewWithData(info, rowBytes, NULL, data)); + SkMallocPixelRef::NewWithData(info, rowBytes, nullptr, data)); // data too small. - REPORTER_ASSERT(reporter, NULL == pr.get()); + REPORTER_ASSERT(reporter, nullptr == pr.get()); } size_t rowBytes = info.minRowBytes() + 7; size_t size = info.getSafeSize(rowBytes) + 9; { SkAutoMalloc memory(size); SkAutoTUnref pr( - SkMallocPixelRef::NewDirect(info, memory.get(), rowBytes, NULL)); - REPORTER_ASSERT(reporter, pr.get() != NULL); + SkMallocPixelRef::NewDirect(info, memory.get(), rowBytes, nullptr)); + REPORTER_ASSERT(reporter, pr.get() != nullptr); REPORTER_ASSERT(reporter, memory.get() == pr->pixels()); } { SkAutoTUnref pr( - SkMallocPixelRef::NewAllocate(info, rowBytes, NULL)); - REPORTER_ASSERT(reporter, pr.get() != NULL); + SkMallocPixelRef::NewAllocate(info, rowBytes, nullptr)); + REPORTER_ASSERT(reporter, pr.get() != nullptr); REPORTER_ASSERT(reporter, pr->pixels()); } { void* addr = static_cast(new uint8_t[size]); SkAutoTUnref pr( - SkMallocPixelRef::NewWithProc(info, rowBytes, NULL, addr, - delete_uint8_proc, NULL)); - REPORTER_ASSERT(reporter, pr.get() != NULL); + SkMallocPixelRef::NewWithProc(info, rowBytes, nullptr, addr, + delete_uint8_proc, nullptr)); + REPORTER_ASSERT(reporter, pr.get() != nullptr); REPORTER_ASSERT(reporter, addr == pr->pixels()); } { int x = 0; SkAutoMalloc memory(size); SkAutoTUnref pr( - SkMallocPixelRef::NewWithProc(info, rowBytes, NULL, + SkMallocPixelRef::NewWithProc(info, rowBytes, nullptr, memory.get(), set_to_one_proc, static_cast(&x))); - REPORTER_ASSERT(reporter, pr.get() != NULL); + REPORTER_ASSERT(reporter, pr.get() != nullptr); REPORTER_ASSERT(reporter, memory.get() == pr->pixels()); REPORTER_ASSERT(reporter, 0 == x); - pr.reset(NULL); + pr.reset(nullptr); // make sure that set_to_one_proc was called. REPORTER_ASSERT(reporter, 1 == x); } { void* addr = static_cast(new uint8_t[size]); - REPORTER_ASSERT(reporter, addr != NULL); + REPORTER_ASSERT(reporter, addr != nullptr); SkAutoTUnref pr( - SkMallocPixelRef::NewWithProc(info, rowBytes, NULL, addr, - delete_uint8_proc, NULL)); + SkMallocPixelRef::NewWithProc(info, rowBytes, nullptr, addr, + delete_uint8_proc, nullptr)); REPORTER_ASSERT(reporter, addr == pr->pixels()); } { @@ -97,9 +97,9 @@ DEF_TEST(MallocPixelRef, reporter) { SkData* dataPtr = data.get(); REPORTER_ASSERT(reporter, dataPtr->unique()); SkAutoTUnref pr( - SkMallocPixelRef::NewWithData(info, rowBytes, NULL, data.get())); + SkMallocPixelRef::NewWithData(info, rowBytes, nullptr, data.get())); REPORTER_ASSERT(reporter, !(dataPtr->unique())); - data.reset(NULL); + data.reset(nullptr); REPORTER_ASSERT(reporter, dataPtr->unique()); REPORTER_ASSERT(reporter, dataPtr->data() == pr->pixels()); } -- cgit v1.2.3