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

Unified Diff: tests/MemoryTest.cpp

Issue 24251008: Add sk_calloc. Remove SkMemory_stdlib, which seems unused. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: use sk_out_of_memory Created 7 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/ports/SkMemory_mozalloc.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/MemoryTest.cpp
diff --git a/tests/MemoryTest.cpp b/tests/MemoryTest.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..4c3216b83b9af1f803ac96827c097c1c9ef0bba1
--- /dev/null
+++ b/tests/MemoryTest.cpp
@@ -0,0 +1,12 @@
+#include "Test.h"
+#include "TestClassDef.h"
+
+DEF_TEST(memory_calloc, reporter) {
+ const size_t kNum = 200;
+ char* zeros = (char*)sk_calloc_throw(kNum*sizeof(char));
+
+ for (size_t i = 0; i < kNum; i++) {
+ REPORTER_ASSERT(reporter, 0 == zeros[i]);
+ }
+ sk_free(zeros);
+}
« no previous file with comments | « src/ports/SkMemory_mozalloc.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698