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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/StreamTest.cpp
diff --git a/tests/StreamTest.cpp b/tests/StreamTest.cpp
index 78c0e506db47cc77725f8a2b29cf72440bc65c79..08adf142c10313bb0f1b4983556db9ec025387a4 100644
--- a/tests/StreamTest.cpp
+++ b/tests/StreamTest.cpp
@@ -381,15 +381,15 @@ static void stream_copy_test(skiatest::Reporter* reporter,
DEF_TEST(StreamCopy, reporter) {
SkRandom random(123456);
- static const size_t N = 10000;
- uint8_t src[N];
- for (size_t j = 0; j < N; ++j) {
+ static const int N = 10000;
+ SkAutoTMalloc<uint8_t> src((size_t)N);
+ for (int j = 0; j < N; ++j) {
src[j] = random.nextU() & 0xff;
}
// SkStreamCopy had two code paths; this test both.
- DumbStream dumbStream(src, N);
+ DumbStream dumbStream(src.get(), (size_t)N);
stream_copy_test(reporter, src, N, &dumbStream);
- SkMemoryStream smartStream(src, N);
+ SkMemoryStream smartStream(src.get(), (size_t)N);
stream_copy_test(reporter, src, N, &smartStream);
}
« 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