blob: 0d6a560e3c36f48377ffd8740f947f3e3d0968ab [file] [log] [blame]
yu.dongc33b3072024-08-21 23:14:49 -07001/*!
2 * @file sys_test.h
3 * @author TJ Chang <tj.chang@mediatek.com>
4 * @version 1.0
5 * @section LICENSE
6 *
7 * This software is protected by Copyright and the information contained
8 * herein is confidential. The software may not be copied and the information
9 * contained herein may not be used or disclosed except with the written
10 * permission of MediaTek Inc. (C) 2005
11 *
12 * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
13 * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
14 * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
15 * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
18 * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
19 * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
20 * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
21 * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
22 * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
23 * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
24 *
25 * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
26 * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
27 * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
28 * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
29 * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
30 *
31 * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
32 * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
33 * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
34 * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
35 * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
36 *
37 * @section DESCRIPTION
38 *
39 */
40#ifndef _SYS_TEST_H
41#define _SYS_TEST_H
42
43#include "kal_general_types.h"
44
45
46// ==========================================================
47// Data Structure Definition
48// ==========================================================
49/*!
50 * struct _ST_TCASE_T
51 *
52 * @brief register information of a test module.
53 *
54 * @param p_param the parameter of test function.
55 * @param p_ret_err_str returned string of error description.
56 * This string buffer is allocated by caller (sys_test) module,
57 * and the callee module fills in error description in this buffer.
58 *
59 * @param p_ret_err_str_sz The caller (sys_test) module use this parameter to define the max size of error string buffer,
60 * and the callee module fills in the actual size of error string buffer when returning.
61 * Note: The callee module CAN NOT fill into 'p_ret_err_str' with exceeding size limit.
62 */
63typedef kal_bool (*st_fn)(void *p_param, kal_char *p_ret_err_str, kal_uint32 *p_ret_err_str_sz);
64typedef struct _ST_TCASE_T {
65 kal_char *test_func_name; /* string description of test function */
66 st_fn test_func; /* entry point of test function */
67 void *test_param; /* parameter of test function */
68} ST_TCASE_T;
69
70
71// ==========================================================
72// SYS_TEST API
73// ==========================================================
74/*!
75 * st_reg_test
76 *
77 * @brief register test function to SYS_TEST module.
78 *
79 * @param p_mod_name test module naming.
80 * @param p_tcase test function information used to register.
81 * @param tcase_num number of test function struct.
82 *
83 * @return kal_bool KAL_TRUE if success, otherwise KAL_FALSE if fail.
84 */
85kal_bool st_reg_test(kal_char *p_mod_name, ST_TCASE_T *p_tcase, kal_uint32 tcase_num);
86
87
88#endif /* _SYS_TEST_H */
89