1 /*
2 * Copyright (C) 2021–2022 Beijing OSWare Technology Co., Ltd
3 * This file contains confidential and proprietary information of
4 * OSWare Technology Co., Ltd
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19 #include <gtest/gtest.h>
20 #include "hdf_uhdf_test.h"
21
22 using namespace testing::ext;
23
24 // pal mipi dsi test case number
25 enum MipiDsiTestCmd {
26 MIPI_DSI_TEST_SET_CFG = 0,
27 MIPI_DSI_TEST_GET_CFG = 1,
28 MIPI_DSI_TEST_TX_RX = 2,
29 MIPI_DSI_TEST_TO_LP_TO_HS = 3,
30 MIPI_DSI_TEST_ENTER_ULPS_EXIT_ULPS = 4,
31 MIPI_DSI_TEST_POWER_CONTROL = 5,
32 MIPI_DSI_TEST_MAX = 6,
33 };
34
35 class HdfLiteMipiDsiTest : public testing::Test {
36 public:
37 static void SetUpTestCase();
38 static void TearDownTestCase();
39 void SetUp();
40 void TearDown();
41 };
42
SetUpTestCase()43 void HdfLiteMipiDsiTest::SetUpTestCase()
44 {
45 HdfTestOpenService();
46 }
47
TearDownTestCase()48 void HdfLiteMipiDsiTest::TearDownTestCase()
49 {
50 HdfTestCloseService();
51 }
52
SetUp()53 void HdfLiteMipiDsiTest::SetUp()
54 {
55 }
56
TearDown()57 void HdfLiteMipiDsiTest::TearDown()
58 {
59 }
60
MipiDsiTest(enum MipiDsiTestCmd cmd)61 static void MipiDsiTest(enum MipiDsiTestCmd cmd)
62 {
63 struct HdfTestMsg msg = {TEST_PAL_MIPI_DSI_TYPE, (uint8_t)cmd, -1};
64 EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
65 }
66
67 /**
68 * @tc.name: MipiDsiSetCfgTest001
69 * @tc.desc: mipi dsi function test
70 * @tc.type: FUNC
71 * @tc.require: AR000F868F
72 */
73 HWTEST_F(HdfLiteMipiDsiTest, MipiDsiSetCfgTest001, TestSize.Level1)
74 {
75 MipiDsiTest(MIPI_DSI_TEST_SET_CFG);
76 }
77
78 /**
79 * @tc.name: MipiDsiGetCfgTest001
80 * @tc.desc: mipi dsi function test
81 * @tc.type: FUNC
82 * @tc.require: AR000F868F
83 */
84 HWTEST_F(HdfLiteMipiDsiTest, MipiDsiGetCfgTest001, TestSize.Level1)
85 {
86 MipiDsiTest(MIPI_DSI_TEST_GET_CFG);
87 }
88
89 /**
90 * @tc.name: MipiDsiTxRxTest001
91 * @tc.desc: mipi dsi function test
92 * @tc.type: FUNC
93 * @tc.require: AR000F868F
94 */
95 HWTEST_F(HdfLiteMipiDsiTest, MipiDsiTxRxTest001, TestSize.Level1)
96 {
97 MipiDsiTest(MIPI_DSI_TEST_TX_RX);
98 }
99
100 /**
101 * @tc.name: MipiDsiLpHsTest001
102 * @tc.desc: mipi dsi function test
103 * @tc.type: FUNC
104 * @tc.require: AR000F868F
105 */
106 HWTEST_F(HdfLiteMipiDsiTest, MipiDsiLpHsTest001, TestSize.Level1)
107 {
108 MipiDsiTest(MIPI_DSI_TEST_TO_LP_TO_HS);
109 }
110
111