• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025-2025 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 #include "camera_hdi_const_unittest.h"
16 #include "camera_hdi_const.h"
17 #include "gtest/gtest.h"
18 
19 using namespace OHOS::CameraStandard;
20 using namespace testing::ext;
21 
22 namespace OHOS {
23 namespace CameraStandard {
SetUpTestCase(void)24 void CameraHdiConstUnitTest::SetUpTestCase(void)
25 {}
26 
TearDownTestCase(void)27 void CameraHdiConstUnitTest::TearDownTestCase(void)
28 {}
29 
SetUp(void)30 void CameraHdiConstUnitTest::SetUp(void)
31 {}
32 
TearDown(void)33 void CameraHdiConstUnitTest::TearDown(void)
34 {}
35 /*
36  * Feature: GetVersionId
37  * Function: Test GetVersionId functionality
38  * SubFunction: NA
39  * FunctionPoints: NA
40  * EnvConditions: NA
41  * CaseDescription: Test GetVersionId.
42  */
43 HWTEST_F(CameraHdiConstUnitTest, Get_Version_Id_Compare_001, TestSize.Level0)
44 {
45     EXPECT_TRUE(GetVersionId(1, 1) < GetVersionId(1, 2));
46     EXPECT_TRUE(GetVersionId(1, 1) == GetVersionId(1, 1));
47     EXPECT_TRUE(GetVersionId(1, 1) > GetVersionId(1, 0));
48     EXPECT_TRUE(GetVersionId(2, 1) > GetVersionId(1, 2));
49     EXPECT_TRUE(GetVersionId(2, 1) > GetVersionId(1, 1));
50     EXPECT_TRUE(GetVersionId(2, 1) > GetVersionId(1, 0));
51 
52     EXPECT_TRUE(HDI_VERSION_ID_1_1 < GetVersionId(1, 2));
53     EXPECT_TRUE(HDI_VERSION_ID_1_1 == GetVersionId(1, 1));
54     EXPECT_TRUE(HDI_VERSION_ID_1_1 > GetVersionId(1, 0));
55     EXPECT_TRUE(GetVersionId(2, 1) > HDI_VERSION_ID_1_2);
56     EXPECT_TRUE(GetVersionId(2, 1) > HDI_VERSION_ID_1_1);
57     EXPECT_TRUE(GetVersionId(2, 1) > HDI_VERSION_ID_1_0);
58 }
59 }  // namespace CameraStandard
60 }  // namespace OHOS