• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020-2022 Huawei Device Co., Ltd.
3  *
4  * HDF is dual licensed: you can use it either under the terms of
5  * the GPL, or the BSD license, at your option.
6  * See the LICENSE file in the root of this repository for complete details.
7  */
8 
9 #ifndef HDF_MAIN_TEST_H
10 #define HDF_MAIN_TEST_H
11 
12 #include "hdf_object.h"
13 #include "hdf_device_desc.h"
14 
15 typedef struct {
16     uint16_t cmd;   // submodule command
17     uint8_t subCmd; // test case command
18     int8_t result;
19 } HdfTestMsg;
20 
21 typedef int32_t (*TestFunc)(HdfTestMsg *);
22 typedef int32_t (*TestCaseFunc)(void);
23 typedef struct {
24     uint16_t cmd;      // submodule command
25     TestFunc testFunc; // function
26 } HdfTestFuncList;
27 typedef struct {
28     uint8_t subCmd;        // test case command
29     TestCaseFunc testFunc; // test case function
30 } HdfTestCaseList;
31 
32 struct TestService {
33     struct IDeviceIoService testRemoteService;
34 };
35 
36 // two hundred values allocated per submodule
37 typedef enum {
38     TEST_PAL_I2C_TYPE       = 0,
39     TEST_PAL_SPI_TYPE       = 1,
40     TEST_PAL_GPIO_TYPE      = 2,
41     TEST_PAL_PIN_TYPE       = 3,
42     TEST_PAL_CLOCK_TYPE     = 4,
43     TEST_PAL_REGULATOR_TYPE = 5,
44     TEST_PAL_MIPI_DSI_TYPE  = 6,
45     TEST_PAL_UART_TYPE      = 7,
46     TEST_PAL_SDIO_TYPE      = 8,
47     TEST_PAL_MDIO_TYPE      = 9,
48     TEST_PAL_APB_TYPE       = 10,
49     TEST_PAL_PCIE_TYPE      = 11,
50     TEST_PAL_PCM_TYPE       = 12,
51     TEST_PAL_I2S_TYPE       = 13,
52     TEST_PAL_PWM_TYPE       = 14,
53     TEST_PAL_DMA_TYPE       = 15,
54     TEST_PAL_EFUSE_TYPE     = 16,
55     TEST_PAL_FLASH_TYPE     = 17,
56     TEST_PAL_EMMC_TYPE      = 18,
57     TEST_PAL_RTC_TYPE       = 19,
58     TEST_PAL_ADC_TYPE       = 20,
59     TEST_PAL_WDT_TYPE       = 21,
60     TEST_PAL_I3C_TYPE       = 22,
61     TEST_PAL_MIPI_CSI_TYPE  = 23,
62     TEST_PAL_DAC_TYPE       = 24,
63     TEST_PAL_TIMER_TYPE     = 25,
64     TEST_PAL_CAN_TYPE       = 26,
65     TEST_PAL_MANAGER_TYPE   = 194,
66     TEST_PAL_DEVICE_TYPE    = 195,
67     TEST_PAL_QUEUE_TYPE     = 196,
68     TEST_PAL_EVENT_TYPE     = 197,
69     TEST_PAL_DUMPER_TYPE    = 198,
70     TEST_PAL_TRACE_TYPE     = 199,
71     TEST_PAL_END            = 200,
72     TEST_OSAL_BEGIN         = TEST_PAL_END,
73 #define HDF_OSAL_TEST_ITEM(v) (TEST_OSAL_BEGIN + (v))
74     TEST_OSAL_ITEM = HDF_OSAL_TEST_ITEM(1),
75     TEST_OSAL_END           = 400,
76     TEST_WIFI_BEGIN         = TEST_OSAL_END,
77     TEST_WIFI_TYPE          = TEST_WIFI_BEGIN + 1,
78     TEST_WIFI_END           = 600,
79     TEST_CONFIG_TYPE        = 601,
80     TEST_AUDIO_TYPE         = 701,
81     TEST_AUDIO_DRIVER_TYPE  = TEST_AUDIO_TYPE + 1,
82     TEST_HDF_FRAME_END      = 800,
83     TEST_USB_DEVICE_TYPE    = 900,
84     TEST_USB_HOST_TYPE      = 1000,
85     TEST_USB_HOST_RAW_TYPE  = 1100,
86 } HdfTestSubModuleCmd;
87 
88 struct HdfDeviceObject *GetDeviceObject(void);
89 
90 #endif // HDF_MAIN_TEST_H
91