aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2014-11-18 07:24:14 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-11-18 07:24:14 -0800
commitf27f1bcce50c8f95aea8469684a70b70c9baee09 (patch)
treeceaedeb444f73bbddc13d09cc783bec800d54444 /tests
parent9b1dd15d6d90bf623679f4e9b81b29fe9ab82807 (diff)
SkVarAlloc::approxBytesAllocated()
This is what I was getting at on the other CL. BUG=skia: Review URL: https://codereview.chromium.org/730193003
Diffstat (limited to 'tests')
-rw-r--r--tests/VarAllocTest.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/VarAllocTest.cpp b/tests/VarAllocTest.cpp
new file mode 100644
index 0000000000..21534b29e0
--- /dev/null
+++ b/tests/VarAllocTest.cpp
@@ -0,0 +1,9 @@
+#include "Test.h"
+#include "SkVarAlloc.h"
+
+DEF_TEST(VarAlloc, r) {
+ SkVarAlloc va;
+ char* p = va.alloc(128, SK_MALLOC_THROW);
+ sk_bzero(p, 128); // Just checking this is safe.
+ REPORTER_ASSERT(r, va.approxBytesAllocated() >= 128);
+}