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

Side by Side Diff: tests/MallocPixelRefTest.cpp

Issue 544233002: "NULL !=" = NULL (Closed) Base URL: https://skia.googlesource.com/skia.git@are
Patch Set: rebase Created 6 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/LListTest.cpp ('k') | tests/PathTest.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 "SkData.h" 8 #include "SkData.h"
9 #include "SkMallocPixelRef.h" 9 #include "SkMallocPixelRef.h"
10 #include "Test.h" 10 #include "Test.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 SkAutoMalloc memory(size); 57 SkAutoMalloc memory(size);
58 SkAutoTUnref<SkMallocPixelRef> pr( 58 SkAutoTUnref<SkMallocPixelRef> pr(
59 SkMallocPixelRef::NewDirect(info, memory.get(), rowBytes, NULL)); 59 SkMallocPixelRef::NewDirect(info, memory.get(), rowBytes, NULL));
60 REPORTER_ASSERT(reporter, pr.get() != NULL); 60 REPORTER_ASSERT(reporter, pr.get() != NULL);
61 REPORTER_ASSERT(reporter, memory.get() == pr->pixels()); 61 REPORTER_ASSERT(reporter, memory.get() == pr->pixels());
62 } 62 }
63 { 63 {
64 SkAutoTUnref<SkMallocPixelRef> pr( 64 SkAutoTUnref<SkMallocPixelRef> pr(
65 SkMallocPixelRef::NewAllocate(info, rowBytes, NULL)); 65 SkMallocPixelRef::NewAllocate(info, rowBytes, NULL));
66 REPORTER_ASSERT(reporter, pr.get() != NULL); 66 REPORTER_ASSERT(reporter, pr.get() != NULL);
67 REPORTER_ASSERT(reporter, NULL != pr->pixels()); 67 REPORTER_ASSERT(reporter, pr->pixels());
68 } 68 }
69 { 69 {
70 void* addr = static_cast<void*>(new uint8_t[size]); 70 void* addr = static_cast<void*>(new uint8_t[size]);
71 SkAutoTUnref<SkMallocPixelRef> pr( 71 SkAutoTUnref<SkMallocPixelRef> pr(
72 SkMallocPixelRef::NewWithProc(info, rowBytes, NULL, addr, 72 SkMallocPixelRef::NewWithProc(info, rowBytes, NULL, addr,
73 delete_uint8_proc, NULL)); 73 delete_uint8_proc, NULL));
74 REPORTER_ASSERT(reporter, pr.get() != NULL); 74 REPORTER_ASSERT(reporter, pr.get() != NULL);
75 REPORTER_ASSERT(reporter, addr == pr->pixels()); 75 REPORTER_ASSERT(reporter, addr == pr->pixels());
76 } 76 }
77 { 77 {
(...skipping 26 matching lines...) Expand all
104 SkData* dataPtr = data.get(); 104 SkData* dataPtr = data.get();
105 REPORTER_ASSERT(reporter, dataPtr->unique()); 105 REPORTER_ASSERT(reporter, dataPtr->unique());
106 SkAutoTUnref<SkMallocPixelRef> pr( 106 SkAutoTUnref<SkMallocPixelRef> pr(
107 SkMallocPixelRef::NewWithData(info, rowBytes, NULL, data.get())); 107 SkMallocPixelRef::NewWithData(info, rowBytes, NULL, data.get()));
108 REPORTER_ASSERT(reporter, !(dataPtr->unique())); 108 REPORTER_ASSERT(reporter, !(dataPtr->unique()));
109 data.reset(NULL); 109 data.reset(NULL);
110 REPORTER_ASSERT(reporter, dataPtr->unique()); 110 REPORTER_ASSERT(reporter, dataPtr->unique());
111 REPORTER_ASSERT(reporter, dataPtr->data() == pr->pixels()); 111 REPORTER_ASSERT(reporter, dataPtr->data() == pr->pixels());
112 } 112 }
113 } 113 }
OLDNEW
« no previous file with comments | « tests/LListTest.cpp ('k') | tests/PathTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698