• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16// @ts-ignore
17import {HeapBean} from "../../../dist/trace/bean/HeapBean.js"
18
19describe('HeapBean Test', ()=>{
20    let heapBean = new HeapBean();
21
22    it('HeapBeanTest01', function () {
23        heapBean = {
24            MoudleName: "MoudleName",
25            AllocationFunction: "AllocationFunction",
26            Allocations: 0,
27            Deallocations: 0,
28            AllocationSize: 0,
29            DeAllocationSize: 0,
30            Total: 0,
31            RemainingSize: 0,
32            depth: 0,
33        }
34        expect(heapBean).not.toBeUndefined()
35        expect(heapBean).toMatchInlineSnapshot({
36  MoudleName: expect.any(String),
37  AllocationFunction: expect.any(String),
38  Allocations: expect.any(Number),
39  Deallocations: expect.any(Number),
40  AllocationSize: expect.any(Number),
41  DeAllocationSize: expect.any(Number),
42  Total: expect.any(Number),
43  RemainingSize: expect.any(Number),
44  depth: expect.any(Number) }, `
45Object {
46  "AllocationFunction": Any<String>,
47  "AllocationSize": Any<Number>,
48  "Allocations": Any<Number>,
49  "DeAllocationSize": Any<Number>,
50  "Deallocations": Any<Number>,
51  "MoudleName": Any<String>,
52  "RemainingSize": Any<Number>,
53  "Total": Any<Number>,
54  "depth": Any<Number>,
55}
56`)
57    });
58})