• 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 #include "hdf_platform_entry_test.h"
10 
11 #include "can_test.h"
12 #include "hdf_log.h"
13 #include "platform_device_test.h"
14 #include "platform_dumper_test.h"
15 #include "platform_event_test.h"
16 #include "platform_manager_test.h"
17 #include "platform_queue_test.h"
18 #if defined(LOSCFG_DRIVERS_HDF_PLATFORM_TRACE) || defined(CONFIG_DRIVERS_HDF_PLATFORM_TRACE)
19 #include "platform_trace_test.h"
20 #endif
21 
22 #define HDF_LOG_TAG hdf_platform_entry_test
23 
HdfPlatformEventTestEntry(HdfTestMsg * msg)24 int32_t HdfPlatformEventTestEntry(HdfTestMsg *msg)
25 {
26     if (msg != NULL) {
27         msg->result = PlatformEventTestExecute(msg->subCmd);
28     }
29     return HDF_SUCCESS;
30 }
31 
HdfPlatformQueueTestEntry(HdfTestMsg * msg)32 int32_t HdfPlatformQueueTestEntry(HdfTestMsg *msg)
33 {
34     if (msg != NULL) {
35         msg->result = PlatformQueueTestExecute(msg->subCmd);
36     }
37     return HDF_SUCCESS;
38 }
39 
HdfPlatformDeviceTestEntry(HdfTestMsg * msg)40 int32_t HdfPlatformDeviceTestEntry(HdfTestMsg *msg)
41 {
42     if (msg != NULL) {
43         msg->result = PlatformDeviceTestExecute(msg->subCmd);
44     }
45     return HDF_SUCCESS;
46 }
47 
HdfPlatformManagerTestEntry(HdfTestMsg * msg)48 int32_t HdfPlatformManagerTestEntry(HdfTestMsg *msg)
49 {
50     if (msg != NULL) {
51         msg->result = PlatformManagerTestExecute(msg->subCmd);
52     }
53     return HDF_SUCCESS;
54 }
55 
56 // Platform DFX Modules
HdfPlatformDumperTestEntry(HdfTestMsg * msg)57 int32_t HdfPlatformDumperTestEntry(HdfTestMsg *msg)
58 {
59     if (msg != NULL) {
60 #if defined(LOSCFG_DRIVERS_HDF_PLATFORM_DUMPER) || defined(CONFIG_DRIVERS_HDF_PLATFORM_DUMPER)
61         msg->result = PlatformDumperTestExecute(msg->subCmd);
62 #endif
63     }
64     return HDF_SUCCESS;
65 }
66 
67 #if defined(LOSCFG_DRIVERS_HDF_PLATFORM_TRACE) || defined(CONFIG_DRIVERS_HDF_PLATFORM_TRACE)
HdfPlatformTraceTestEntry(HdfTestMsg * msg)68 int32_t HdfPlatformTraceTestEntry(HdfTestMsg *msg)
69 {
70     HDF_LOGD("HdfPlatformTraceTestEntry enter:");
71     if (msg != NULL) {
72         msg->result = PlatformTraceTestExecute(msg->subCmd);
73     }
74     return HDF_SUCCESS;
75 }
76 #endif
77 
78 // Platform Bussiness Modules
HdfCanTestEntry(HdfTestMsg * msg)79 int32_t HdfCanTestEntry(HdfTestMsg *msg)
80 {
81     if (msg != NULL) {
82 #if defined(LOSCFG_DRIVERS_HDF_PLATFORM_CAN) || defined(CONFIG_DRIVERS_HDF_PLATFORM_CAN)
83         msg->result = CanTestExecute(msg->subCmd);
84 #else
85         msg->result = HDF_SUCCESS;
86 #endif
87     }
88     return HDF_SUCCESS;
89 }
90