xref: /aosp_15_r20/external/skia/tests/MemoryTest.cpp (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1  /*
2  * Copyright 2013 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 "include/private/base/SkMalloc.h"
9 #include "tests/Test.h"
10 #include <cstddef>
11 
DEF_TEST(memory_calloc,reporter)12 DEF_TEST(memory_calloc, reporter) {
13     const size_t kNum = 200;
14     char* zeros = (char*)sk_calloc_throw(kNum*sizeof(char));
15 
16     for (size_t i = 0; i < kNum; i++) {
17         REPORTER_ASSERT(reporter, 0 == zeros[i]);
18     }
19     sk_free(zeros);
20 }
21