Home | History | Annotate | Download | only in tests
      1 /*
      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 
      8 #include "Test.h"
      9 #include "SkVarAlloc.h"
     10 
     11 DEF_TEST(VarAlloc, r) {
     12     SkVarAlloc va(4/*start allocating at 16B*/);
     13     char* p = va.alloc(128);
     14     sk_bzero(p, 128);  // Just checking this is safe.
     15 
     16 #if !defined(SK_BUILD_FOR_ANDROID) && !defined(__UCLIBC__)
     17     // This method will always return 0 on Android and UCLIBC platforms.
     18     REPORTER_ASSERT(r, va.approxBytesAllocated() >= 128);
     19 #endif
     20 }
     21