blob: 18e421480d299ddf8397cb6fc020a093d6aa259f [file] [log] [blame]
#include "Test.h"
#include "SkVarAlloc.h"
DEF_TEST(VarAlloc, r) {
SkVarAlloc va(4/*start allocating at 16B*/);
char* p = va.alloc(128, SK_MALLOC_THROW);
sk_bzero(p, 128); // Just checking this is safe.
#ifndef SK_BUILD_FOR_ANDROID
// This method will always return 0 on Android.
REPORTER_ASSERT(r, va.approxBytesAllocated() >= 128);
#endif
}