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

Side by Side Diff: tests/BitmapTest.cpp

Issue 138563004: Move macros from TestClassDef.h to Test.h (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: upload Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « tests/BitmapHeapTest.cpp ('k') | tests/BlitRowTest.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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 9
10 #include "Test.h" 10 #include "Test.h"
11 #include "TestClassDef.h"
12 11
13 static void test_bigwidth(skiatest::Reporter* reporter) { 12 static void test_bigwidth(skiatest::Reporter* reporter) {
14 SkBitmap bm; 13 SkBitmap bm;
15 int width = 1 << 29; // *4 will be the high-bit of 32bit int 14 int width = 1 << 29; // *4 will be the high-bit of 32bit int
16 15
17 REPORTER_ASSERT(reporter, bm.setConfig(SkBitmap::kA8_Config, width, 1)); 16 REPORTER_ASSERT(reporter, bm.setConfig(SkBitmap::kA8_Config, width, 1));
18 REPORTER_ASSERT(reporter, bm.setConfig(SkBitmap::kRGB_565_Config, width, 1)) ; 17 REPORTER_ASSERT(reporter, bm.setConfig(SkBitmap::kRGB_565_Config, width, 1)) ;
19 18
20 // for a 4-byte config, this width will compute a rowbytes of 0x80000000, 19 // for a 4-byte config, this width will compute a rowbytes of 0x80000000,
21 // which does not fit in a int32_t. setConfig should detect this, and fail. 20 // which does not fit in a int32_t. setConfig should detect this, and fail.
(...skipping 17 matching lines...) Expand all
39 REPORTER_ASSERT(reporter, setConf); 38 REPORTER_ASSERT(reporter, setConf);
40 if (setConf) { 39 if (setConf) {
41 REPORTER_ASSERT(reporter, bm.allocPixels(NULL)); 40 REPORTER_ASSERT(reporter, bm.allocPixels(NULL));
42 } 41 }
43 REPORTER_ASSERT(reporter, SkToBool(width & height) != bm.empty()); 42 REPORTER_ASSERT(reporter, SkToBool(width & height) != bm.empty());
44 } 43 }
45 } 44 }
46 45
47 test_bigwidth(reporter); 46 test_bigwidth(reporter);
48 } 47 }
OLDNEW
« no previous file with comments | « tests/BitmapHeapTest.cpp ('k') | tests/BlitRowTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698