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

Side by Side Diff: tests/ImageDecodingTest.cpp

Issue 132403008: Remove unnamed namespace usage from tests/ (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: 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
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 "Test.h" 8 #include "Test.h"
9 #include "TestClassDef.h" 9 #include "TestClassDef.h"
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 #endif // SK_DEBUG 234 #endif // SK_DEBUG
235 235
236 DEF_TEST(ImageDecoding, reporter) { 236 DEF_TEST(ImageDecoding, reporter) {
237 test_unpremul(reporter); 237 test_unpremul(reporter);
238 #ifdef SK_DEBUG 238 #ifdef SK_DEBUG
239 test_stream_life(); 239 test_stream_life();
240 test_row_proc_choice(); 240 test_row_proc_choice();
241 #endif 241 #endif
242 } 242 }
243 243
244 ////////////////////////////////////////////////////////////////////////////////
245 namespace {
246 // expected output for 8x8 bitmap 244 // expected output for 8x8 bitmap
247 const int kExpectedWidth = 8; 245 static const int kExpectedWidth = 8;
248 const int kExpectedHeight = 8; 246 static const int kExpectedHeight = 8;
249 const SkColor kExpectedPixels[] = { 247 static const SkColor kExpectedPixels[] = {
250 0xffbba570, 0xff395f5d, 0xffe25c39, 0xff197666, 248 0xffbba570, 0xff395f5d, 0xffe25c39, 0xff197666,
251 0xff3cba27, 0xffdefcb0, 0xffc13874, 0xfffa0093, 249 0xff3cba27, 0xffdefcb0, 0xffc13874, 0xfffa0093,
252 0xffbda60e, 0xffc01db6, 0xff2bd688, 0xff9362d4, 250 0xffbda60e, 0xffc01db6, 0xff2bd688, 0xff9362d4,
253 0xffc641b2, 0xffa5cede, 0xff606eba, 0xff8f4bf3, 251 0xffc641b2, 0xffa5cede, 0xff606eba, 0xff8f4bf3,
254 0xff3bf742, 0xff8f02a8, 0xff5509df, 0xffc7027e, 252 0xff3bf742, 0xff8f02a8, 0xff5509df, 0xffc7027e,
255 0xff24aa8a, 0xff886c96, 0xff625481, 0xff403689, 253 0xff24aa8a, 0xff886c96, 0xff625481, 0xff403689,
256 0xffc52152, 0xff78ccd6, 0xffdcb4ab, 0xff09d27d, 254 0xffc52152, 0xff78ccd6, 0xffdcb4ab, 0xff09d27d,
257 0xffca00f3, 0xff605d47, 0xff446fb2, 0xff576e46, 255 0xffca00f3, 0xff605d47, 0xff446fb2, 0xff576e46,
258 0xff273df9, 0xffb41a83, 0xfff812c3, 0xffccab67, 256 0xff273df9, 0xffb41a83, 0xfff812c3, 0xffccab67,
259 0xff034218, 0xff7db9a7, 0xff821048, 0xfffe4ab4, 257 0xff034218, 0xff7db9a7, 0xff821048, 0xfffe4ab4,
260 0xff6fac98, 0xff941d27, 0xff5fe411, 0xfffbb283, 258 0xff6fac98, 0xff941d27, 0xff5fe411, 0xfffbb283,
261 0xffd86e99, 0xff169162, 0xff71128c, 0xff39cab4, 259 0xffd86e99, 0xff169162, 0xff71128c, 0xff39cab4,
262 0xffa7fe63, 0xff4c956b, 0xffbc22e0, 0xffb272e4, 260 0xffa7fe63, 0xff4c956b, 0xffbc22e0, 0xffb272e4,
263 0xff129f4a, 0xffe34513, 0xff3d3742, 0xffbd190a, 261 0xff129f4a, 0xffe34513, 0xff3d3742, 0xffbd190a,
264 0xffb07222, 0xff2e23f8, 0xfff089d9, 0xffb35738, 262 0xffb07222, 0xff2e23f8, 0xfff089d9, 0xffb35738,
265 0xffa86022, 0xff3340fe, 0xff95fe71, 0xff6a71df 263 0xffa86022, 0xff3340fe, 0xff95fe71, 0xff6a71df
266 }; 264 };
267 SK_COMPILE_ASSERT((kExpectedWidth * kExpectedHeight) 265 SK_COMPILE_ASSERT((kExpectedWidth * kExpectedHeight)
268 == SK_ARRAY_COUNT(kExpectedPixels), array_size_mismatch); 266 == SK_ARRAY_COUNT(kExpectedPixels), array_size_mismatch);
269 } // namespace
270 267
271 DEF_TEST(WebP, reporter) { 268 DEF_TEST(WebP, reporter) {
272 const unsigned char encodedWebP[] = { 269 const unsigned char encodedWebP[] = {
273 0x52, 0x49, 0x46, 0x46, 0x2c, 0x01, 0x00, 0x00, 0x57, 0x45, 0x42, 0x50, 270 0x52, 0x49, 0x46, 0x46, 0x2c, 0x01, 0x00, 0x00, 0x57, 0x45, 0x42, 0x50,
274 0x56, 0x50, 0x38, 0x4c, 0x20, 0x01, 0x00, 0x00, 0x2f, 0x07, 0xc0, 0x01, 271 0x56, 0x50, 0x38, 0x4c, 0x20, 0x01, 0x00, 0x00, 0x2f, 0x07, 0xc0, 0x01,
275 0x00, 0xff, 0x01, 0x45, 0x03, 0x00, 0xe2, 0xd5, 0xae, 0x60, 0x2b, 0xad, 272 0x00, 0xff, 0x01, 0x45, 0x03, 0x00, 0xe2, 0xd5, 0xae, 0x60, 0x2b, 0xad,
276 0xd9, 0x68, 0x76, 0xb6, 0x8d, 0x6a, 0x1d, 0xc0, 0xe6, 0x19, 0xd6, 0x16, 273 0xd9, 0x68, 0x76, 0xb6, 0x8d, 0x6a, 0x1d, 0xc0, 0xe6, 0x19, 0xd6, 0x16,
277 0xb7, 0xb4, 0xef, 0xcf, 0xc3, 0x15, 0x6c, 0xb3, 0xbd, 0x77, 0x0d, 0x85, 274 0xb7, 0xb4, 0xef, 0xcf, 0xc3, 0x15, 0x6c, 0xb3, 0xbd, 0x77, 0x0d, 0x85,
278 0x6d, 0x1b, 0xa9, 0xb1, 0x2b, 0xdc, 0x3d, 0x83, 0xdb, 0x00, 0x00, 0xc8, 275 0x6d, 0x1b, 0xa9, 0xb1, 0x2b, 0xdc, 0x3d, 0x83, 0xdb, 0x00, 0x00, 0xc8,
279 0x26, 0xe5, 0x01, 0x99, 0x8a, 0xd5, 0xdd, 0xfc, 0x82, 0xcd, 0xcd, 0x9a, 276 0x26, 0xe5, 0x01, 0x99, 0x8a, 0xd5, 0xdd, 0xfc, 0x82, 0xcd, 0xcd, 0x9a,
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 } 573 }
577 SkDecodingImageGenerator::Options options(scaleList[i], 574 SkDecodingImageGenerator::Options options(scaleList[i],
578 ditherList[j]); 575 ditherList[j]);
579 test_options(reporter, options, encodedStream, encodedData, 576 test_options(reporter, options, encodedStream, encodedData,
580 useDataList[m], path); 577 useDataList[m], path);
581 } 578 }
582 } 579 }
583 } 580 }
584 } 581 }
585 } 582 }
586 ////////////////////////////////////////////////////////////////////////////////
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698