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

Side by Side Diff: tests/StreamTest.cpp

Issue 1283193008: Fix stack overuse error (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-18 (Tuesday) 18:28:43 EDT Created 5 years, 4 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 | « no previous file | no next file » | 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 "Resources.h" 8 #include "Resources.h"
9 #include "SkData.h" 9 #include "SkData.h"
10 #include "SkFrontBufferedStream.h" 10 #include "SkFrontBufferedStream.h"
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 ERRORF(reporter, "SkStreamCopy incorrect size"); 374 ERRORF(reporter, "SkStreamCopy incorrect size");
375 return; 375 return;
376 } 376 }
377 if (0 != memcmp(data->data(), srcData, N)) { 377 if (0 != memcmp(data->data(), srcData, N)) {
378 ERRORF(reporter, "SkStreamCopy bad copy"); 378 ERRORF(reporter, "SkStreamCopy bad copy");
379 } 379 }
380 } 380 }
381 381
382 DEF_TEST(StreamCopy, reporter) { 382 DEF_TEST(StreamCopy, reporter) {
383 SkRandom random(123456); 383 SkRandom random(123456);
384 static const size_t N = 10000; 384 static const int N = 10000;
385 uint8_t src[N]; 385 SkAutoTMalloc<uint8_t> src((size_t)N);
386 for (size_t j = 0; j < N; ++j) { 386 for (int j = 0; j < N; ++j) {
387 src[j] = random.nextU() & 0xff; 387 src[j] = random.nextU() & 0xff;
388 } 388 }
389 // SkStreamCopy had two code paths; this test both. 389 // SkStreamCopy had two code paths; this test both.
390 DumbStream dumbStream(src, N); 390 DumbStream dumbStream(src.get(), (size_t)N);
391 stream_copy_test(reporter, src, N, &dumbStream); 391 stream_copy_test(reporter, src, N, &dumbStream);
392 SkMemoryStream smartStream(src, N); 392 SkMemoryStream smartStream(src.get(), (size_t)N);
393 stream_copy_test(reporter, src, N, &smartStream); 393 stream_copy_test(reporter, src, N, &smartStream);
394 394
395 } 395 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698