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

Side by Side Diff: tests/Reader32Test.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/ReadWriteAlphaTest.cpp ('k') | tests/RecordDrawTest.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 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 "SkReader32.h" 8 #include "SkReader32.h"
9 #include "Test.h" 9 #include "Test.h"
10 10
(...skipping 17 matching lines...) Expand all
28 REPORTER_ASSERT(reporter, 0 == reader.offset()); 28 REPORTER_ASSERT(reporter, 0 == reader.offset());
29 REPORTER_ASSERT(reporter, 0 == reader.available()); 29 REPORTER_ASSERT(reporter, 0 == reader.available());
30 REPORTER_ASSERT(reporter, !reader.isAvailable(1)); 30 REPORTER_ASSERT(reporter, !reader.isAvailable(1));
31 assert_eof(reporter, reader); 31 assert_eof(reporter, reader);
32 assert_start(reporter, reader); 32 assert_start(reporter, reader);
33 } 33 }
34 34
35 DEF_TEST(Reader32, reporter) { 35 DEF_TEST(Reader32, reporter) {
36 SkReader32 reader; 36 SkReader32 reader;
37 assert_empty(reporter, reader); 37 assert_empty(reporter, reader);
38 REPORTER_ASSERT(reporter, NULL == reader.base()); 38 REPORTER_ASSERT(reporter, nullptr == reader.base());
39 REPORTER_ASSERT(reporter, NULL == reader.peek()); 39 REPORTER_ASSERT(reporter, nullptr == reader.peek());
40 40
41 size_t i; 41 size_t i;
42 42
43 const int32_t data[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; 43 const int32_t data[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
44 const SkScalar data2[] = { 0, SK_Scalar1, -SK_Scalar1, SK_Scalar1/2 }; 44 const SkScalar data2[] = { 0, SK_Scalar1, -SK_Scalar1, SK_Scalar1/2 };
45 const size_t bufsize = sizeof(data) > sizeof(data2) ? 45 const size_t bufsize = sizeof(data) > sizeof(data2) ?
46 sizeof(data) : sizeof(data2); 46 sizeof(data) : sizeof(data2);
47 char buffer[bufsize]; 47 char buffer[bufsize];
48 48
49 reader.setMemory(data, sizeof(data)); 49 reader.setMemory(data, sizeof(data));
(...skipping 17 matching lines...) Expand all
67 REPORTER_ASSERT(reporter, (const void*)data2 == reader.base()); 67 REPORTER_ASSERT(reporter, (const void*)data2 == reader.base());
68 REPORTER_ASSERT(reporter, (const void*)&data2[i] == reader.peek()); 68 REPORTER_ASSERT(reporter, (const void*)&data2[i] == reader.peek());
69 REPORTER_ASSERT(reporter, data2[i] == reader.readScalar()); 69 REPORTER_ASSERT(reporter, data2[i] == reader.readScalar());
70 } 70 }
71 assert_eof(reporter, reader); 71 assert_eof(reporter, reader);
72 reader.rewind(); 72 reader.rewind();
73 assert_start(reporter, reader); 73 assert_start(reporter, reader);
74 reader.read(buffer, sizeof(data2)); 74 reader.read(buffer, sizeof(data2));
75 REPORTER_ASSERT(reporter, !memcmp(data2, buffer, sizeof(data2))); 75 REPORTER_ASSERT(reporter, !memcmp(data2, buffer, sizeof(data2)));
76 76
77 reader.setMemory(NULL, 0); 77 reader.setMemory(nullptr, 0);
78 assert_empty(reporter, reader); 78 assert_empty(reporter, reader);
79 REPORTER_ASSERT(reporter, NULL == reader.base()); 79 REPORTER_ASSERT(reporter, nullptr == reader.base());
80 REPORTER_ASSERT(reporter, NULL == reader.peek()); 80 REPORTER_ASSERT(reporter, nullptr == reader.peek());
81 } 81 }
OLDNEW
« no previous file with comments | « tests/ReadWriteAlphaTest.cpp ('k') | tests/RecordDrawTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698