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 #include "mesh_unittest.h"
17 #include "mesh.h"
18 
19 using namespace testing;
20 using namespace testing::ext;
21 
22 namespace OHOS {
23 namespace Rosen {
24 /**
25  * @tc.name: Use001
26  * @tc.desc: Generate the data required for Mesh based on a fixed array
27  * @tc.type: FUNC
28  * @tc.require:
29  * @tc.author:
30  */
31 HWTEST_F(MeshUnittest, Use001, TestSize.Level1)
32 {
33     GTEST_LOG_(INFO) << "MeshUnittest Use001 start";
34     /**
35      * @tc.steps: step1. Create a Filter pointer
36      */
37     auto mesh = std::make_shared<Mesh>();
38     bool testResult = mesh != nullptr;
39     EXPECT_TRUE(testResult);
40     /**
41      * @tc.steps: step2. Call Use to use the mesh
42      */
43     EXPECT_TRUE(mesh->VAO_ >= 0);
44     mesh->Use();
45 }
46 
47 /**
48  * @tc.name:Delete001
49  * @tc.desc: Delete data that has been used and is no longer needed
50  * @tc.type: FUNC
51  * @tc.require:
52  * @tc.author:
53  */
54 HWTEST_F(MeshUnittest, Delete001, TestSize.Level1)
55 {
56     GTEST_LOG_(INFO) << "MeshUnittestDelete001 start";
57     /**
58      * @tc.steps: step1. Create a Filter pointer
59      */
60     auto mesh = std::make_shared<Mesh>();
61     bool testResult = mesh != nullptr;
62     EXPECT_TRUE(testResult);
63     /**
64      * @tc.steps: step2. Call Delete to delete data
65      */
66     EXPECT_TRUE(mesh->VAO_ >= 0);
67     mesh->Use();
68     mesh->Delete();
69 }
70 } // namespace Rosen
71 } // namespace OHOS
72