1 /*
2  * Copyright (c) 2020-2021 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 "osal_test_entry.h"
10 #include "hdf_base.h"
11 #include "hdf_log.h"
12 #include "osal_case_cmd_test.h"
13 #include "osal_get_case_test.h"
14 
HdfOsalEntry(HdfTestMsg * msg)15 int32_t HdfOsalEntry(HdfTestMsg *msg)
16 {
17     int32_t result = 0;
18     if (msg->subCmd < OSAL_TEST_MAX) {
19         if (msg->subCmd == OSAL_TEST_START) {
20             result = OsaTestBegin(msg->result);
21         } else if (msg->subCmd == OSAL_TEST_END) {
22             result = OsaTestEnd();
23         } else if (msg->subCmd == OSAL_TEST_ALL) {
24             result = OsaTestALLResult();
25         } else {
26             result = OsalGetTestResult(msg->subCmd);
27         }
28     } else {
29         return HDF_FAILURE;
30     }
31 
32     msg->result = (result != 0) ? HDF_FAILURE : HDF_SUCCESS;
33 
34     return HDF_SUCCESS;
35 }
36 
37