blob: 77eaa89d7b2bd5e3b5389ed720ce24440f7965d7 [file] [log] [blame]
mtklein5a744b72015-09-14 11:11:17 -07001/*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
mtklein0bd57b22014-11-18 09:32:36 -08008#include "Test.h"
9#include "SkVarAlloc.h"
10
11DEF_TEST(VarAlloc, r) {
mtklein59dba142014-12-12 08:41:23 -080012 SkVarAlloc va(4/*start allocating at 16B*/);
mtklein5a744b72015-09-14 11:11:17 -070013 char* p = va.alloc(128);
mtklein0bd57b22014-11-18 09:32:36 -080014 sk_bzero(p, 128); // Just checking this is safe.
15
smcgruerb83205a2015-03-16 14:45:00 -070016#if !defined(SK_BUILD_FOR_ANDROID) && !defined(__UCLIBC__)
17 // This method will always return 0 on Android and UCLIBC platforms.
mtklein0bd57b22014-11-18 09:32:36 -080018 REPORTER_ASSERT(r, va.approxBytesAllocated() >= 128);
19#endif
20}