blob: 18e421480d299ddf8397cb6fc020a093d6aa259f [file] [log] [blame]
mtklein0bd57b22014-11-18 09:32:36 -08001#include "Test.h"
2#include "SkVarAlloc.h"
3
4DEF_TEST(VarAlloc, r) {
mtklein59dba142014-12-12 08:41:23 -08005 SkVarAlloc va(4/*start allocating at 16B*/);
mtklein0bd57b22014-11-18 09:32:36 -08006 char* p = va.alloc(128, SK_MALLOC_THROW);
7 sk_bzero(p, 128); // Just checking this is safe.
8
9#ifndef SK_BUILD_FOR_ANDROID
10 // This method will always return 0 on Android.
11 REPORTER_ASSERT(r, va.approxBytesAllocated() >= 128);
12#endif
13}