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

Side by Side Diff: tests/ARGBImageEncoderTest.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/AAClipTest.cpp ('k') | tests/AndroidPaintTest.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 2012 Google Inc. 2 * Copyright 2012 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 "SkImageEncoder.h" 8 #include "SkImageEncoder.h"
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
11 #include "SkCanvas.h" 11 #include "SkCanvas.h"
12 #include "SkStream.h" 12 #include "SkStream.h"
13 #include "Test.h" 13 #include "Test.h"
14 #include "TestClassDef.h"
15 14
16 static SkBitmap::Config configs[] = { 15 static SkBitmap::Config configs[] = {
17 SkBitmap::kRGB_565_Config, 16 SkBitmap::kRGB_565_Config,
18 SkBitmap::kARGB_8888_Config, 17 SkBitmap::kARGB_8888_Config,
19 }; 18 };
20 19
21 DEF_TEST(ARGBImageEncoder, reporter) { 20 DEF_TEST(ARGBImageEncoder, reporter) {
22 // Bytes we expect to get: 21 // Bytes we expect to get:
23 const int kWidth = 3; 22 const int kWidth = 3;
24 const int kHeight = 5; 23 const int kHeight = 5;
(...skipping 29 matching lines...) Expand all
54 SkAutoMalloc pixelBufferManager(bufferSize); 53 SkAutoMalloc pixelBufferManager(bufferSize);
55 char *pixelBuffer = static_cast<char *>(pixelBufferManager.get()); 54 char *pixelBuffer = static_cast<char *>(pixelBufferManager.get());
56 SkMemoryWStream out(pixelBuffer, bufferSize); 55 SkMemoryWStream out(pixelBuffer, bufferSize);
57 REPORTER_ASSERT(reporter, enc->encodeStream(&out, bitmap, SkImageEncoder ::kDefaultQuality)); 56 REPORTER_ASSERT(reporter, enc->encodeStream(&out, bitmap, SkImageEncoder ::kDefaultQuality));
58 57
59 // Confirm we got the expected results. 58 // Confirm we got the expected results.
60 REPORTER_ASSERT(reporter, bufferSize == sizeof(comparisonBuffer)); 59 REPORTER_ASSERT(reporter, bufferSize == sizeof(comparisonBuffer));
61 REPORTER_ASSERT(reporter, memcmp(pixelBuffer, comparisonBuffer, bufferSi ze) == 0); 60 REPORTER_ASSERT(reporter, memcmp(pixelBuffer, comparisonBuffer, bufferSi ze) == 0);
62 } 61 }
63 } 62 }
OLDNEW
« no previous file with comments | « tests/AAClipTest.cpp ('k') | tests/AndroidPaintTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698