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

Unified Diff: tests/StreamTest.cpp

Issue 1374493002: SkStream: don't segfault on empty asset getMemoryBase(). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 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 | « src/core/SkStream.cpp ('k') | 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 d307f513183e4c520005c3e569cb936eb9a509d9..838a8a4d0f1ed285a81be7aa0d12a9a99e373834 100644
--- a/tests/StreamTest.cpp
+++ b/tests/StreamTest.cpp
@@ -391,5 +391,11 @@ DEF_TEST(StreamCopy, reporter) {
stream_copy_test(reporter, src, N, &dumbStream);
SkMemoryStream smartStream(src.get(), (size_t)N);
stream_copy_test(reporter, src, N, &smartStream);
+}
+DEF_TEST(StreamEmptyStreamMemoryBase, r) {
+ SkDynamicMemoryWStream tmp;
+ SkAutoTDelete<SkStreamAsset> asset(tmp.detachAsStream());
+ REPORTER_ASSERT(r, nullptr == asset->getMemoryBase());
}
+
« no previous file with comments | « src/core/SkStream.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698